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 this->addDependentField(basisValues->basis_ref_scalar);
99 this->addDependentField(basisValues->basis_scalar);
101 else if(basis->isVectorBasis()) {
102 dof_ip_vector = PHX::MDField<ScalarT,Cell,Point,Dim>(
104 pointRule->dl_vector);
105 this->addEvaluatedField(dof_ip_vector);
106 this->addDependentField(basisValues->basis_ref_vector);
107 this->addDependentField(basisValues->basis_vector);
112 std::string n =
"DOF_PointValues: " + dof_basis.fieldTag().name();
117 template<
typename EvalT,
typename TRAITS>
122 if(!is_vector_basis) {
123 this->utils.setFieldData(basisValues->basis_ref_scalar,fm);
124 this->utils.setFieldData(basisValues->basis_scalar,fm);
127 this->utils.setFieldData(basisValues->basis_ref_vector,fm);
128 this->utils.setFieldData(basisValues->basis_vector,fm);
133 template<
typename EvalT,
typename TRAITS>
139 if(is_vector_basis) {
140 int spaceDim = basisValues->basis_vector.extent(3);
143 Kokkos::parallel_for(Kokkos::TeamPolicy<PHX::Device>(workset.num_cells,Kokkos::AUTO(),vector_size),functor);
147 Kokkos::parallel_for(Kokkos::TeamPolicy<PHX::Device>(workset.num_cells,Kokkos::AUTO(),vector_size),functor);
152 Kokkos::parallel_for(workset.num_cells,functor);
163 template<
typename TRAITS>
167 const std::string fieldName = p.
get<std::string>(
"Name");
176 offsets_array = Kokkos::View<int*,PHX::Device>(
"offsets",offsets.size());
177 for(std::size_t i=0;i<offsets.size();i++)
178 offsets_array(i) = offsets[i];
180 accelerate_jacobian =
true;
183 accelerate_jacobian =
false;
185 std::string evalName = fieldName+
"_"+pointRule->getName();
186 if(p.
isType<
bool>(
"Use DOF Name")) {
187 if(p.
get<
bool>(
"Use DOF Name"))
188 evalName = fieldName;
191 dof_basis = PHX::MDField<const ScalarT,Cell,Point>(fieldName, basis->functional);
202 if(basis->isScalarBasis()) {
205 pointRule->dl_scalar);
207 this->addDependentField(
basisValues->basis_ref_scalar);
208 this->addDependentField(
basisValues->basis_scalar);
210 else if(basis->isVectorBasis()) {
213 pointRule->dl_vector);
215 this->addDependentField(
basisValues->basis_ref_vector);
216 this->addDependentField(
basisValues->basis_vector);
221 std::string n =
"DOF_PointValues: " +
dof_basis.fieldTag().name() +
" Jacobian";
226 template<
typename TRAITS>
232 this->utils.setFieldData(
basisValues->basis_ref_scalar,fm);
233 this->utils.setFieldData(
basisValues->basis_scalar,fm);
236 this->utils.setFieldData(
basisValues->basis_ref_vector,fm);
237 this->utils.setFieldData(
basisValues->basis_vector,fm);
242 template<
typename TRAITS>
249 if(accelerate_jacobian) {
250 int spaceDim =
basisValues->basis_vector.extent(3);
253 Kokkos::parallel_for(workset.num_cells,functor);
257 Kokkos::parallel_for(workset.num_cells,functor);
261 int spaceDim =
basisValues->basis_vector.extent(3);
264 Kokkos::parallel_for(Kokkos::TeamPolicy<PHX::Device>(workset.num_cells,Kokkos::AUTO(),vector_size),functor);
268 Kokkos::parallel_for(Kokkos::TeamPolicy<PHX::Device>(workset.num_cells,Kokkos::AUTO(),vector_size),functor);
273 if(accelerate_jacobian) {
275 Kokkos::parallel_for(workset.num_cells,functor);
279 Kokkos::parallel_for(workset.num_cells,functor);
T & get(const std::string &name, T def_value)
void evaluateFields(typename TRAITS::EvalData d)
PHX::MDField< ScalarT, Cell, Point, Dim > dof_ip_vector
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)
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)
Kokkos::View< const int *, PHX::Device > offsets