43 #ifndef PANZER_BasisValues_Evaluator_IMPL_HPP
44 #define PANZER_BasisValues_Evaluator_IMPL_HPP
53 template<
typename EvalT,
typename Traits>
57 : derivativesRequired_(true)
64 bool derivativesRequired =
true;
65 if(p.
isType<
bool>(
"Derivatives Required"))
66 derivativesRequired = p.
get<
bool>(
"Derivatives Required");
68 initialize(pointRule,inBasis,derivativesRequired);
72 template <
typename EvalT,
typename TRAITST>
75 : derivativesRequired_(true)
77 bool derivativesRequired =
true;
78 initialize(pointRule,inBasis,derivativesRequired);
82 template <
typename EvalT,
typename TRAITST>
85 bool derivativesRequired)
86 : derivativesRequired_(true)
88 initialize(pointRule,inBasis,derivativesRequired);
92 template <
typename EvalT,
typename TRAITST>
95 bool derivativesRequired)
98 derivativesRequired_ = derivativesRequired;
108 constPointValues = pointValues;
109 this->addDependentField(constPointValues.coords_ref);
110 this->addDependentField(constPointValues.jac);
111 this->addDependentField(constPointValues.jac_inv);
112 this->addDependentField(constPointValues.jac_det);
118 basisValues->setupArrays(layout,derivativesRequired_);
123 this->addEvaluatedField(basisValues->basis_ref_scalar);
124 this->addEvaluatedField(basisValues->basis_scalar);
126 if(derivativesRequired) {
127 this->addEvaluatedField(basisValues->grad_basis_ref);
128 this->addEvaluatedField(basisValues->grad_basis);
133 this->addEvaluatedField(basisValues->basis_ref_vector);
134 this->addEvaluatedField(basisValues->basis_vector);
136 if(derivativesRequired && space_dim==2) {
137 this->addEvaluatedField(basisValues->curl_basis_ref_scalar);
138 this->addEvaluatedField(basisValues->curl_basis_scalar);
140 else if(derivativesRequired && space_dim==3) {
141 this->addEvaluatedField(basisValues->curl_basis_ref_vector);
142 this->addEvaluatedField(basisValues->curl_basis_vector);
147 this->addEvaluatedField(basisValues->basis_ref_vector);
148 this->addEvaluatedField(basisValues->basis_vector);
150 if(derivativesRequired) {
151 this->addEvaluatedField(basisValues->div_basis_ref);
152 this->addEvaluatedField(basisValues->div_basis);
156 std::string n =
"BasisValues_Evaluator: " +basis->name() +
"_" + pointRule->
getName();
161 template<
typename EvalT,
typename Traits>
168 int space_dim = basis->dimension();
172 basisValues->setExtendedDimensions(fm.template getKokkosExtendedDataTypeDimensions<EvalT>());
175 this->utils.setFieldData(pointValues.coords_ref,fm);
176 this->utils.setFieldData(pointValues.jac,fm);
177 this->utils.setFieldData(pointValues.jac_inv,fm);
178 this->utils.setFieldData(pointValues.jac_det,fm);
183 this->utils.setFieldData(basisValues->basis_ref_scalar,fm);
184 this->utils.setFieldData(basisValues->basis_scalar,fm);
186 if(derivativesRequired_) {
187 this->utils.setFieldData(basisValues->grad_basis_ref,fm);
188 this->utils.setFieldData(basisValues->grad_basis,fm);
193 this->utils.setFieldData(basisValues->basis_ref_vector,fm);
194 this->utils.setFieldData(basisValues->basis_vector,fm);
196 if(derivativesRequired_ && space_dim==2) {
197 this->utils.setFieldData(basisValues->curl_basis_ref_scalar,fm);
198 this->utils.setFieldData(basisValues->curl_basis_scalar,fm);
200 else if(derivativesRequired_ && space_dim==3) {
201 this->utils.setFieldData(basisValues->curl_basis_ref_vector,fm);
202 this->utils.setFieldData(basisValues->curl_basis_vector,fm);
207 this->utils.setFieldData(basisValues->basis_ref_vector,fm);
208 this->utils.setFieldData(basisValues->basis_vector,fm);
210 if(derivativesRequired_) {
211 this->utils.setFieldData(basisValues->div_basis_ref,fm);
212 this->utils.setFieldData(basisValues->div_basis,fm);
219 template<
typename EvalT,
typename Traits>
226 basisValues->evaluateValues(pointValues.coords_ref,
233 if(basis->requiresOrientations()) {
236 std::vector<Intrepid2::Orientation> ortPerWorkset;
237 for (index_t c=0;c<workset.
num_cells;++c)
238 ortPerWorkset.push_back((*orientations)[details.
cell_local_ids[c]]);
240 basisValues->applyOrientations(ortPerWorkset, (
int) workset.
num_cells);
Teuchos::RCP< const std::vector< Intrepid2::Orientation > > orientations_
BasisValues_Evaluator(const Teuchos::ParameterList &p)
T & get(const std::string &name, T def_value)
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
std::vector< GO > cell_local_ids