11 #ifndef PANZER_COMMON_ARRAY_FACTORIES_IMPL_HPP
12 #define PANZER_COMMON_ARRAY_FACTORIES_IMPL_HPP
15 #include "Phalanx_DataLayout_MDALayout.hpp"
16 #include "Phalanx_KokkosViewFactory.hpp"
21 template <
typename Scalar,
typename T0>
25 static_assert(std::is_same<Scalar,double>::value,
"ERROR: CommonArryFactory for DynRankView only supports double scalar type!");
26 return Kokkos::DynRankView<Scalar,PHX::Device>(str,d0);
29 template <
typename Scalar,
typename T0,
typename T1>
33 static_assert(std::is_same<Scalar,double>::value,
"ERROR: CommonArryFactory for DynRankView only supports double scalar type!");
34 return Kokkos::DynRankView<Scalar,PHX::Device>(str,d0,d1);
37 template <
typename Scalar,
typename T0,
typename T1,
typename T2>
39 buildArray(
const std::string & str,
int d0,
int d1,
int d2)
const
41 static_assert(std::is_same<Scalar,double>::value,
"ERROR: CommonArryFactory for DynRankView only supports double scalar type!");
42 return Kokkos::DynRankView<Scalar,PHX::Device>(str,d0,d1,d2);
45 template <
typename Scalar,
typename T0,
typename T1,
typename T2,
typename T3>
47 buildArray(
const std::string & str,
int d0,
int d1,
int d2,
int d3)
const
49 static_assert(std::is_same<Scalar,double>::value,
"ERROR: CommonArryFactory for DynRankView only supports double scalar type!");
50 return Kokkos::DynRankView<Scalar,PHX::Device>(str,d0,d1,d2,d3);
53 template <
typename Scalar,
typename T0,
typename T1,
typename T2,
typename T3,
typename T4>
55 buildArray(
const std::string & str,
int d0,
int d1,
int d2,
int d3,
int d4)
const
57 static_assert(std::is_same<Scalar,double>::value,
"ERROR: CommonArryFactory for DynRankView only supports double scalar type!");
58 return Kokkos::DynRankView<Scalar,PHX::Device>(str,d0,d1,d2,d3,d4);
62 template <
typename Scalar,
typename T0>
71 field.setFieldData(ViewFactory::buildView(field.fieldTag(),
ddims_));
76 template <
typename Scalar,
typename T0,
typename T1>
85 field.setFieldData(ViewFactory::buildView(field.fieldTag(),
ddims_));
90 template <
typename Scalar,
typename T0,
typename T1,
typename T2>
92 buildArray(
const std::string & str,
int d0,
int d1,
int d2)
const
99 field.setFieldData(ViewFactory::buildView(field.fieldTag(),
ddims_));
104 template <
typename Scalar,
typename T0,
typename T1,
typename T2,
typename T3>
106 buildArray(
const std::string & str,
int d0,
int d1,
int d2,
int d3)
const
113 field.setFieldData(ViewFactory::buildView(field.fieldTag(),
ddims_));
118 template <
typename Scalar,
typename T0,
typename T1,
typename T2,
typename T3,
typename T4>
120 buildArray(
const std::string & str,
int d0,
int d1,
int d2,
int d3,
int d4)
const
127 field.setFieldData(ViewFactory::buildView(field.fieldTag(),
ddims_));
133 template <
typename Scalar,
typename T0>
142 field.setFieldData(ViewFactory::buildView(field.fieldTag(),
ddims_));
147 template <
typename Scalar,
typename T0,
typename T1>
156 field.setFieldData(ViewFactory::buildView(field.fieldTag(),
ddims_));
161 template <
typename Scalar,
typename T0,
typename T1,
typename T2>
167 PHX::MDField<Scalar,T0,T1,T2> field =
PHX::MDField<Scalar,T0,T1,T2>(
prefix_+str,
Teuchos::rcp(
new PHX::MDALayout<T0,T1,T2>(d0,d1,d2)));
170 field.setFieldData(ViewFactory::buildView(field.fieldTag(),
ddims_));
175 template <
typename Scalar,
typename T0,
typename T1,
typename T2,
typename T3>
181 PHX::MDField<Scalar,T0,T1,T2,T3> field =
PHX::MDField<Scalar,T0,T1,T2,T3>(
prefix_+str,
Teuchos::rcp(
new PHX::MDALayout<T0,T1,T2,T3>(d0,d1,d2,d3)));
184 field.setFieldData(ViewFactory::buildView(field.fieldTag(),
ddims_));
189 template <
typename Scalar,
typename T0,
typename T1,
typename T2,
typename T3,
typename T4>
195 PHX::MDField<Scalar,T0,T1,T2,T3,T4> field =
PHX::MDField<Scalar,T0,T1,T2,T3,T4>(
prefix_+str,
Teuchos::rcp(
new PHX::MDALayout<T0,T1,T2,T3,T4>(d0,d1,d2,d3,d4)));
198 field.setFieldData(ViewFactory::buildView(field.fieldTag(),
ddims_));
std::vector< PHX::index_size_type > ddims_
PHX::MDField< Scalar, T0 > buildStaticArray(const std::string &str, int d0) const
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
Kokkos::DynRankView< Scalar, PHX::Device > buildArray(const std::string &str, int d0) const
PHX::MDField< ScalarT, panzer::Cell, panzer::BASIS > field
A field to which we'll contribute, or in which we'll store, the result of computing this integral...
PHX::MDField< Scalar > buildArray(const std::string &str, int d0) const