11 #ifndef PANZER_BasisValues_Evaluator_IMPL_HPP
12 #define PANZER_BasisValues_Evaluator_IMPL_HPP
21 template<
typename EvalT,
typename Traits>
25 : derivativesRequired_(true)
32 bool derivativesRequired =
true;
33 if(p.
isType<
bool>(
"Derivatives Required"))
34 derivativesRequired = p.
get<
bool>(
"Derivatives Required");
36 initialize(pointRule,inBasis,derivativesRequired);
40 template <
typename EvalT,
typename TRAITST>
43 : derivativesRequired_(true)
45 bool derivativesRequired =
true;
46 initialize(pointRule,inBasis,derivativesRequired);
50 template <
typename EvalT,
typename TRAITST>
53 bool derivativesRequired)
54 : derivativesRequired_(true)
56 initialize(pointRule,inBasis,derivativesRequired);
60 template <
typename EvalT,
typename TRAITST>
63 bool derivativesRequired)
66 derivativesRequired_ = derivativesRequired;
76 constPointValues = pointValues;
77 this->addDependentField(constPointValues.coords_ref);
78 this->addDependentField(constPointValues.jac);
79 this->addDependentField(constPointValues.jac_inv);
80 this->addDependentField(constPointValues.jac_det);
86 basisValues->setupArrays(layout,derivativesRequired_);
91 this->addEvaluatedField(basisValues->basis_ref_scalar);
92 this->addEvaluatedField(basisValues->basis_scalar);
94 if(derivativesRequired) {
95 this->addEvaluatedField(basisValues->grad_basis_ref);
96 this->addEvaluatedField(basisValues->grad_basis);
101 this->addEvaluatedField(basisValues->basis_ref_vector);
102 this->addEvaluatedField(basisValues->basis_vector);
104 if(derivativesRequired && space_dim==2) {
105 this->addEvaluatedField(basisValues->curl_basis_ref_scalar);
106 this->addEvaluatedField(basisValues->curl_basis_scalar);
108 else if(derivativesRequired && space_dim==3) {
109 this->addEvaluatedField(basisValues->curl_basis_ref_vector);
110 this->addEvaluatedField(basisValues->curl_basis_vector);
115 this->addEvaluatedField(basisValues->basis_ref_vector);
116 this->addEvaluatedField(basisValues->basis_vector);
118 if(derivativesRequired) {
119 this->addEvaluatedField(basisValues->div_basis_ref);
120 this->addEvaluatedField(basisValues->div_basis);
124 std::string n =
"BasisValues_Evaluator: " +basis->name() +
"_" + pointRule->
getName();
129 template<
typename EvalT,
typename Traits>
136 int space_dim = basis->dimension();
140 basisValues->setExtendedDimensions(fm.template getKokkosExtendedDataTypeDimensions<EvalT>());
143 this->utils.setFieldData(pointValues.coords_ref,fm);
144 this->utils.setFieldData(pointValues.jac,fm);
145 this->utils.setFieldData(pointValues.jac_inv,fm);
146 this->utils.setFieldData(pointValues.jac_det,fm);
151 this->utils.setFieldData(basisValues->basis_ref_scalar,fm);
152 this->utils.setFieldData(basisValues->basis_scalar,fm);
154 if(derivativesRequired_) {
155 this->utils.setFieldData(basisValues->grad_basis_ref,fm);
156 this->utils.setFieldData(basisValues->grad_basis,fm);
161 this->utils.setFieldData(basisValues->basis_ref_vector,fm);
162 this->utils.setFieldData(basisValues->basis_vector,fm);
164 if(derivativesRequired_ && space_dim==2) {
165 this->utils.setFieldData(basisValues->curl_basis_ref_scalar,fm);
166 this->utils.setFieldData(basisValues->curl_basis_scalar,fm);
168 else if(derivativesRequired_ && space_dim==3) {
169 this->utils.setFieldData(basisValues->curl_basis_ref_vector,fm);
170 this->utils.setFieldData(basisValues->curl_basis_vector,fm);
175 this->utils.setFieldData(basisValues->basis_ref_vector,fm);
176 this->utils.setFieldData(basisValues->basis_vector,fm);
178 if(derivativesRequired_) {
179 this->utils.setFieldData(basisValues->div_basis_ref,fm);
180 this->utils.setFieldData(basisValues->div_basis,fm);
187 template<
typename EvalT,
typename Traits>
194 basisValues->evaluateValues(pointValues.coords_ref,
201 if(basis->requiresOrientations()) {
204 std::vector<Intrepid2::Orientation> ortPerWorkset;
205 for (index_t c=0;c<workset.
num_cells;++c)
206 ortPerWorkset.push_back((*orientations)[details.
cell_local_ids[c]]);
208 basisValues->applyOrientations(ortPerWorkset, (
int) workset.
num_cells);
Teuchos::RCP< const std::vector< Intrepid2::Orientation > > orientations_
int num_cells
DEPRECATED - use: numCells()
BasisValues_Evaluator(const Teuchos::ParameterList &p)
T & get(const std::string &name, T def_value)
std::vector< size_t > cell_local_ids
const std::string & getName() const
int dimension() const
Returns the dimension of the basis from the topology.
void setupArrays(const Teuchos::RCP< const panzer::PointRule > &pr)
Sizes/allocates memory for arrays.
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
void initialize(const Teuchos::RCP< const panzer::PointRule > &pointRule, const Teuchos::RCP< const panzer::PureBasis > &basis, bool derivativesRequired)
Initialization method to unify the constructors.
void evaluateFields(typename Traits::EvalData d)
void postRegistrationSetup(typename Traits::SetupData d, PHX::FieldManager< Traits > &fm)
bool isType(const std::string &name) const