11#ifndef PANZER_PointValues_Evaluator_IMPL_HPP
12#define PANZER_PointValues_Evaluator_IMPL_HPP
22template<
typename EvalT,
typename Traits>
25 const Teuchos::ParameterList& p)
29 Teuchos::RCP<const panzer::PointRule> pointRule
30 = p.get< Teuchos::RCP<const panzer::PointRule> >(
"Point Rule");
31 Teuchos::RCP<const Kokkos::DynRankView<double,PHX::Device> > userArray
32 = p.get<Teuchos::RCP<const Kokkos::DynRankView<double,PHX::Device> > >(
"Point Array");
34 initialize(pointRule,userArray.ptr(),Teuchos::null);
38template <
typename EvalT,
typename TRAITST>
40 const Kokkos::DynRankView<double,PHX::Device> & userArray)
44 initialize(pointRule,Teuchos::ptrFromRef(userArray),Teuchos::null);
48template <
typename EvalT,
typename TRAITST>
50 const PHX::MDField<double, panzer::IP, panzer::Dim> & userArray)
54 initialize(pointRule,Teuchos::ptrFromRef(userArray),Teuchos::null);
58template <
typename EvalT,
typename TRAITST>
60 const Teuchos::RCP<const panzer::PureBasis> & pureBasis)
64 Teuchos::Ptr<const PHX::MDField<double, panzer::IP, panzer::Dim> > userArray;
65 initialize(pointRule,userArray,pureBasis);
69template <
typename EvalT,
typename TRAITST>
70template <
typename ArrayT>
72 const Teuchos::Ptr<const ArrayT> & userArray,
73 const Teuchos::RCP<const panzer::PureBasis> & pureBasis)
77 if(userArray!=Teuchos::null && basis==Teuchos::null)
78 useBasisValuesRefArray =
false;
79 else if(userArray==Teuchos::null && basis!=Teuchos::null)
80 useBasisValuesRefArray =
true;
83 TEUCHOS_ASSERT(
false);
87 if(userArray!=Teuchos::null) {
88 TEUCHOS_ASSERT(userArray->rank()==2);
91 refPointArray = md_af.
buildStaticArray<double,
NODE,
Dim>(
"refPointArray",userArray->extent(0),userArray->extent(1));
92 Kokkos::deep_copy(PHX::as_view(refPointArray), PHX::as_view(*userArray));
98 pointValues.setupArrays(pointRule);
101 this->addEvaluatedField(pointValues.coords_ref);
102 this->addEvaluatedField(pointValues.node_coordinates);
103 this->addEvaluatedField(pointValues.jac);
104 this->addEvaluatedField(pointValues.jac_inv);
105 this->addEvaluatedField(pointValues.jac_det);
106 this->addEvaluatedField(pointValues.point_coords);
108 std::string n =
"PointValues_Evaluator: " + pointRule->getName();
113template<
typename EvalT,
typename Traits>
121 this->utils.setFieldData(pointValues.coords_ref,fm);
122 this->utils.setFieldData(pointValues.node_coordinates,fm);
123 this->utils.setFieldData(pointValues.jac,fm);
124 this->utils.setFieldData(pointValues.jac_inv,fm);
125 this->utils.setFieldData(pointValues.jac_det,fm);
126 this->utils.setFieldData(pointValues.point_coords,fm);
128 if(useBasisValuesRefArray) {
133 TEUCHOS_ASSERT(basis->supportsBasisCoordinates());
138template<
typename EvalT,
typename Traits>
144 if(useBasisValuesRefArray) {
148 pointValues.
evaluateValues(this->wda(workset).cell_node_coordinates,
154 pointValues.evaluateValues(this->wda(workset).cell_node_coordinates,refPointArray,
Array_BasisDim basis_coordinates_ref
void evaluateValues(const PHX::MDField< Scalar, IP, Dim > &cub_points, const PHX::MDField< Scalar, Cell, IP, Dim, Dim > &jac, const PHX::MDField< Scalar, Cell, IP > &jac_det, const PHX::MDField< Scalar, Cell, IP, Dim, Dim > &jac_inv, const int in_num_cells=-1)
PHX::MDField< Scalar, T0 > buildStaticArray(const std::string &str, int d0) const
PointValues_Evaluator(const Teuchos::ParameterList &p)
void initialize(const Teuchos::RCP< const panzer::PointRule > &pointRule, const Teuchos::Ptr< const ArrayT > &userArray, const Teuchos::RCP< const panzer::PureBasis > &pureBasis)
Initialization method to unify the constructors.
void postRegistrationSetup(typename Traits::SetupData d, PHX::FieldManager< Traits > &fm)
void evaluateFields(typename Traits::EvalData d)
int num_cells
DEPRECATED - use: numCells()
std::vector< std::string >::size_type getPureBasisIndex(std::string basis_name, const panzer::Workset &workset, WorksetDetailsAccessor &wda)
Returns the index in the workset bases for a particular PureBasis name.
User-defined data passed to PHX::Evaluator::postRegistrationSetup() during the one-time setup phase.
Teuchos::RCP< const std::vector< panzer::Workset > > worksets_
All worksets that will be evaluated over the lifetime of this evaluator.