59 const std::string & coordinateName,
60 const Teuchos::RCP<PHX::DataLayout> & coordLayout,
61 const Teuchos::RCP<PHX::DataLayout> & quadLayout,
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);
71 Teuchos::RCP<PHX::DataLayout> basisLayout = fieldBasis.
functional;
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();
95 dof_field.deep_copy(
ScalarT(0.0));
98 auto l_intrpCoords = PHX::as_view(intrpCoords);
99 auto l_coordinates = coordinates.get_static_view();
100 Kokkos::parallel_for(
"DOF PointFields", l_coordinates.extent_int(0), KOKKOS_LAMBDA (
int i) {
101 for (
int j = 0; j < l_coordinates.extent_int(1); ++j)
102 l_intrpCoords(i,j) = Sacado::scalarValue(l_coordinates(i,j));
105 if(workset.num_cells>0) {
107 intrepidBasis->getValues(basisRef, intrpCoords, Intrepid2::OPERATOR_VALUE);
110 Intrepid2::FunctionSpaceTools<PHX::exec_space>::
111 HGRADtransformVALUE(basis,basisRef);
114 Intrepid2::FunctionSpaceTools<PHX::exec_space>::
115 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.