27 const std::string & coordinateName,
28 const Teuchos::RCP<PHX::DataLayout> & coordLayout,
29 const Teuchos::RCP<PHX::DataLayout> & quadLayout,
30 const std::string & postfixFieldName)
34 int cellCount = fieldBasis.
functional->extent(0);
35 int coeffCount = fieldBasis.
functional->extent(1);
36 int pointCount = coordLayout->extent(0);
37 int dimCount = coordLayout->extent(1);
39 Teuchos::RCP<PHX::DataLayout> basisLayout = fieldBasis.
functional;
41 coordinates = PHX::MDField<const ScalarT,Point,Dim>(coordinateName,coordLayout);
42 dof_coeff = PHX::MDField<const ScalarT>(fieldName,basisLayout);
43 dof_field = PHX::MDField<ScalarT>(fieldName+postfixFieldName,quadLayout);
45 this->addDependentField(coordinates);
46 this->addDependentField(dof_coeff);
47 this->addEvaluatedField(dof_field);
50 basisRef = Kokkos::DynRankView<double,PHX::Device>(
"basisRef",coeffCount,pointCount);
51 basis = Kokkos::DynRankView<double,PHX::Device>(
"basis",cellCount,coeffCount,pointCount);
52 intrpCoords = Kokkos::DynRankView<double,PHX::Device>(
"intrpCoords",pointCount,dimCount);
54 std::string n =
"DOF_PointField: " + dof_field.fieldTag().name();
63 dof_field.deep_copy(
ScalarT(0.0));
66 auto l_intrpCoords = PHX::as_view(intrpCoords);
67 auto l_coordinates = coordinates.get_static_view();
68 Kokkos::parallel_for(
"DOF PointFields", l_coordinates.extent_int(0), KOKKOS_LAMBDA (
int i) {
69 for (
int j = 0; j < l_coordinates.extent_int(1); ++j)
70 l_intrpCoords(i,j) = Sacado::scalarValue(l_coordinates(i,j));
73 if(workset.num_cells>0) {
75 intrepidBasis->getValues(basisRef, intrpCoords, Intrepid2::OPERATOR_VALUE);
78 Intrepid2::FunctionSpaceTools<PHX::exec_space>::
79 HGRADtransformVALUE(basis,basisRef);
82 Intrepid2::FunctionSpaceTools<PHX::exec_space>::
83 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.