43 #ifndef PANZER_DOF_POINT_FIELD_DECL_HPP
44 #define PANZER_DOF_POINT_FIELD_DECL_HPP
49 #include "Intrepid2_FunctionSpaceTools.hpp"
51 #include "Phalanx_DataLayout_MDALayout.hpp"
56 template <
typename EvalT,
typename TRAITST>
59 const std::string & coordinateName,
62 const std::string & postfixFieldName)
66 int cellCount = fieldBasis.
functional->extent(0);
67 int coeffCount = fieldBasis.
functional->extent(1);
68 int pointCount = coordLayout->extent(0);
69 int dimCount = coordLayout->extent(1);
73 coordinates = PHX::MDField<const ScalarT,Point,Dim>(coordinateName,coordLayout);
74 dof_coeff = PHX::MDField<const ScalarT>(fieldName,basisLayout);
75 dof_field = PHX::MDField<ScalarT>(fieldName+postfixFieldName,quadLayout);
77 this->addDependentField(coordinates);
78 this->addDependentField(dof_coeff);
79 this->addEvaluatedField(dof_field);
82 basisRef = Kokkos::DynRankView<double,PHX::Device>(
"basisRef",coeffCount,pointCount);
83 basis = Kokkos::DynRankView<double,PHX::Device>(
"basis",cellCount,coeffCount,pointCount);
84 intrpCoords = Kokkos::DynRankView<double,PHX::Device>(
"intrpCoords",pointCount,dimCount);
86 std::string n =
"DOF_PointField: " + dof_field.fieldTag().name();
91 template <
typename EvalT,
typename TRAITST>
95 dof_field.deep_copy(
ScalarT(0.0));
98 for (
int i = 0; i < coordinates.extent_int(0); ++i)
99 for (
int j = 0; j < coordinates.extent_int(1); ++j)
100 intrpCoords(i,j) = Sacado::ScalarValue<ScalarT>::eval(coordinates(i,j));
102 if(workset.num_cells>0) {
104 intrepidBasis->getValues(basisRef, intrpCoords, Intrepid2::OPERATOR_VALUE);
107 Intrepid2::FunctionSpaceTools<PHX::exec_space>::
108 HGRADtransformVALUE(basis,basisRef);
111 Intrepid2::FunctionSpaceTools<PHX::exec_space>::
112 evaluate(dof_field.get_view(),dof_coeff.get_view(),basis);
void initialize(const std::string &fieldName, const PureBasis &fieldBasis, const std::string &coordinateName, const Teuchos::RCP< PHX::DataLayout > &coordLayout, const Teuchos::RCP< PHX::DataLayout > &quadLayout, const std::string &postfixFieldName)
Convenience initialization routine, see constructor above.
void evaluateFields(typename TRAITST::EvalData workset)
Teuchos::RCP< Intrepid2::Basis< PHX::Device::execution_space, double, double > > getIntrepid2Basis() const
Description and data layouts associated with a particular basis.
Teuchos::RCP< PHX::DataLayout > functional
<Cell,Basis> or <Cell,Basis>