11 #ifndef PANZER_DOF_IMPL_HPP
12 #define PANZER_DOF_IMPL_HPP
22 #include "Intrepid2_FunctionSpaceTools.hpp"
35 template<
typename EvalT,
typename TRAITS>
39 const std::string fieldName = p.
get<std::string>(
"Name");
42 is_vector_basis = basis->isVectorBasis();
44 std::string evalName = fieldName+
"_"+pointRule->getName();
45 if(p.
isType<
bool>(
"Use DOF Name")) {
46 if(p.
get<
bool>(
"Use DOF Name"))
52 this->addDependentField(dof_basis);
57 basisValues->setupArrays(layout,
false);
61 if(basis->isScalarBasis()) {
64 pointRule->dl_scalar);
65 this->addEvaluatedField(dof_ip_scalar);
66 this->addNonConstDependentField(basisValues->basis_ref_scalar);
67 this->addNonConstDependentField(basisValues->basis_scalar);
69 else if(basis->isVectorBasis()) {
72 pointRule->dl_vector);
73 this->addEvaluatedField(dof_ip_vector);
74 this->addNonConstDependentField(basisValues->basis_ref_vector);
75 this->addNonConstDependentField(basisValues->basis_vector);
80 std::string n =
"DOF_PointValues: " + dof_basis.fieldTag().name();
85 template<
typename EvalT,
typename TRAITS>
90 if(!is_vector_basis) {
91 this->utils.setFieldData(basisValues->basis_ref_scalar,fm);
92 this->utils.setFieldData(basisValues->basis_scalar,fm);
95 this->utils.setFieldData(basisValues->basis_ref_vector,fm);
96 this->utils.setFieldData(basisValues->basis_vector,fm);
101 template<
typename EvalT,
typename TRAITS>
107 if(is_vector_basis) {
108 int spaceDim = basisValues->basis_vector.extent(3);
111 Kokkos::parallel_for(Kokkos::TeamPolicy<PHX::Device>(workset.num_cells,Kokkos::AUTO(),vector_size),functor);
115 Kokkos::parallel_for(Kokkos::TeamPolicy<PHX::Device>(workset.num_cells,Kokkos::AUTO(),vector_size),functor);
120 Kokkos::parallel_for(workset.num_cells,functor);
131 template<
typename TRAITS>
135 const std::string fieldName = p.
get<std::string>(
"Name");
144 offsets_array = PHX::View<int*>(
"offsets",offsets.size());
145 for(std::size_t i=0;i<offsets.size();i++)
146 offsets_array(i) = offsets[i];
148 accelerate_jacobian =
true;
151 accelerate_jacobian =
false;
153 std::string evalName = fieldName+
"_"+pointRule->getName();
154 if(p.
isType<
bool>(
"Use DOF Name")) {
155 if(p.
get<
bool>(
"Use DOF Name"))
156 evalName = fieldName;
170 if(basis->isScalarBasis()) {
173 pointRule->dl_scalar);
175 this->addNonConstDependentField(
basisValues->basis_ref_scalar);
176 this->addNonConstDependentField(
basisValues->basis_scalar);
178 else if(basis->isVectorBasis()) {
181 pointRule->dl_vector);
183 this->addNonConstDependentField(
basisValues->basis_ref_vector);
184 this->addNonConstDependentField(
basisValues->basis_vector);
189 std::string n =
"DOF_PointValues: " +
dof_basis.fieldTag().name() +
" Jacobian";
194 template<
typename TRAITS>
200 this->utils.setFieldData(
basisValues->basis_ref_scalar,fm);
201 this->utils.setFieldData(
basisValues->basis_scalar,fm);
204 this->utils.setFieldData(
basisValues->basis_ref_vector,fm);
205 this->utils.setFieldData(
basisValues->basis_vector,fm);
210 template<
typename TRAITS>
217 if(accelerate_jacobian) {
218 int spaceDim =
basisValues->basis_vector.extent(3);
221 Kokkos::parallel_for(workset.num_cells,functor);
225 Kokkos::parallel_for(workset.num_cells,functor);
229 int spaceDim =
basisValues->basis_vector.extent(3);
232 Kokkos::parallel_for(Kokkos::TeamPolicy<PHX::Device>(workset.num_cells,Kokkos::AUTO(),vector_size),functor);
236 Kokkos::parallel_for(Kokkos::TeamPolicy<PHX::Device>(workset.num_cells,Kokkos::AUTO(),vector_size),functor);
241 if(accelerate_jacobian) {
243 Kokkos::parallel_for(workset.num_cells,functor);
247 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::View< const int * > offsets
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)