43 #ifndef PANZER_DOF_IMPL_HPP
44 #define PANZER_DOF_IMPL_HPP
54 #include "Intrepid2_FunctionSpaceTools.hpp"
67 template<
typename EvalT,
typename TRAITS>
71 const std::string fieldName = p.
get<std::string>(
"Name");
74 is_vector_basis = basis->isVectorBasis();
76 std::string evalName = fieldName+
"_"+pointRule->getName();
77 if(p.
isType<
bool>(
"Use DOF Name")) {
78 if(p.
get<
bool>(
"Use DOF Name"))
82 dof_basis = PHX::MDField<const ScalarT,Cell,Point>(fieldName, basis->functional);
84 this->addDependentField(dof_basis);
89 basisValues->setupArrays(layout,
false);
93 if(basis->isScalarBasis()) {
94 dof_ip_scalar = PHX::MDField<ScalarT,Cell,Point>(
96 pointRule->dl_scalar);
97 this->addEvaluatedField(dof_ip_scalar);
98 constBasisRefScalar_ = basisValues->basis_ref_scalar;
99 constBasisScalar_ = basisValues->basis_scalar;
100 this->addDependentField(constBasisRefScalar_);
101 this->addDependentField(constBasisScalar_);
103 else if(basis->isVectorBasis()) {
104 dof_ip_vector = PHX::MDField<ScalarT,Cell,Point,Dim>(
106 pointRule->dl_vector);
107 this->addEvaluatedField(dof_ip_vector);
108 constBasisRefVector_ = basisValues->basis_ref_vector;
109 constBasisVector_ = basisValues->basis_vector;
110 this->addDependentField(constBasisRefVector_);
111 this->addDependentField(constBasisVector_);
116 std::string n =
"DOF_PointValues: " + dof_basis.fieldTag().name();
121 template<
typename EvalT,
typename TRAITS>
126 if(!is_vector_basis) {
127 this->utils.setFieldData(basisValues->basis_ref_scalar,fm);
128 this->utils.setFieldData(basisValues->basis_scalar,fm);
131 this->utils.setFieldData(basisValues->basis_ref_vector,fm);
132 this->utils.setFieldData(basisValues->basis_vector,fm);
137 template<
typename EvalT,
typename TRAITS>
143 if(is_vector_basis) {
144 int spaceDim = basisValues->basis_vector.extent(3);
147 Kokkos::parallel_for(Kokkos::TeamPolicy<PHX::Device>(workset.num_cells,Kokkos::AUTO(),vector_size),functor);
151 Kokkos::parallel_for(Kokkos::TeamPolicy<PHX::Device>(workset.num_cells,Kokkos::AUTO(),vector_size),functor);
156 Kokkos::parallel_for(workset.num_cells,functor);
167 template<
typename TRAITS>
171 const std::string fieldName = p.
get<std::string>(
"Name");
180 offsets_array = Kokkos::View<int*,PHX::Device>(
"offsets",offsets.size());
181 for(std::size_t i=0;i<offsets.size();i++)
182 offsets_array(i) = offsets[i];
184 accelerate_jacobian =
true;
187 accelerate_jacobian =
false;
189 std::string evalName = fieldName+
"_"+pointRule->getName();
190 if(p.
isType<
bool>(
"Use DOF Name")) {
191 if(p.
get<
bool>(
"Use DOF Name"))
192 evalName = fieldName;
195 dof_basis = PHX::MDField<const ScalarT,Cell,Point>(fieldName, basis->functional);
206 if(basis->isScalarBasis()) {
209 pointRule->dl_scalar);
216 else if(basis->isVectorBasis()) {
219 pointRule->dl_vector);
229 std::string n =
"DOF_PointValues: " +
dof_basis.fieldTag().name() +
" Jacobian";
234 template<
typename TRAITS>
240 this->utils.setFieldData(
basisValues->basis_ref_scalar,fm);
241 this->utils.setFieldData(
basisValues->basis_scalar,fm);
244 this->utils.setFieldData(
basisValues->basis_ref_vector,fm);
245 this->utils.setFieldData(
basisValues->basis_vector,fm);
250 template<
typename TRAITS>
257 if(accelerate_jacobian) {
258 int spaceDim =
basisValues->basis_vector.extent(3);
261 Kokkos::parallel_for(workset.num_cells,functor);
265 Kokkos::parallel_for(workset.num_cells,functor);
269 int spaceDim =
basisValues->basis_vector.extent(3);
272 Kokkos::parallel_for(Kokkos::TeamPolicy<PHX::Device>(workset.num_cells,Kokkos::AUTO(),vector_size),functor);
276 Kokkos::parallel_for(Kokkos::TeamPolicy<PHX::Device>(workset.num_cells,Kokkos::AUTO(),vector_size),functor);
281 if(accelerate_jacobian) {
283 Kokkos::parallel_for(workset.num_cells,functor);
287 Kokkos::parallel_for(workset.num_cells,functor);
PHX::MDField< const double, BASIS, IP, void, void, void, void, void, void > constBasisRefScalar_
T & get(const std::string &name, T def_value)
void evaluateFields(typename TRAITS::EvalData d)
PHX::MDField< ScalarT, Cell, Point, Dim > dof_ip_vector
PHX::MDField< const double, Cell, BASIS, IP, void, void, void, void, void > constBasisScalar_
panzer::Traits::Jacobian::ScalarT ScalarT
PHX::MDField< const ScalarT, Cell, Point > dof_basis
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
Teuchos::RCP< const PureBasis > basis
void postRegistrationSetup(typename TRAITS::SetupData d, PHX::FieldManager< TRAITS > &fm)
PHX::MDField< const double, Cell, BASIS, IP, Dim, void, void, void, void > constBasisVector_
int vectorSize() const
Returns the vector size. Specialized for AD scalar types.
bool isType(const std::string &name) const
static HP & inst()
Private ctor.
PHX::MDField< ScalarT, Cell, Point > dof_ip_scalar
Teuchos::RCP< BasisValues2< double > > basisValues
#define TEUCHOS_ASSERT(assertion_test)
DOF_PointValues(const Teuchos::ParameterList &p)
PHX::MDField< const double, BASIS, IP, Dim, void, void, void, void, void > constBasisRefVector_
Kokkos::View< const int *, PHX::Device > offsets