11 #ifndef PANZER_DOF_POINT_FIELD_DECL_HPP
12 #define PANZER_DOF_POINT_FIELD_DECL_HPP
17 #include "Intrepid2_FunctionSpaceTools.hpp"
19 #include "Phalanx_DataLayout_MDALayout.hpp"
24 template <
typename EvalT,
typename TRAITST>
27 const std::string & coordinateName,
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);
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();
59 template <
typename EvalT,
typename TRAITST>
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.
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>