73 const Teuchos::RCP<STK_Interface> mesh,
74 const Teuchos::RCP<const panzer::PointRule> & pointRule,
75 const std::vector<std::string> & names,
76 const std::vector<double> & scaling)
87 TEUCHOS_ASSERT(pointRule->num_points==1);
92 for (std::size_t fd = 0; fd < names.size(); ++fd) {
94 PHX::MDField<const ScalarT,Cell,IP,Dim>(
names_[fd]+
"_"+pointRule->getName(),pointRule->dl_vector);
99 PHX::Tag<ScalarT> scatterHolder(scatterName,Teuchos::rcp(
new PHX::MDALayout<panzer::Dummy>(0)));
100 this->addEvaluatedField(scatterHolder);
102 this->setName(scatterName+
": STK-Scatter Vector Fields");
120 std::vector<std::string> dimStrings(3);
126 const std::vector<std::size_t> & localCellIds = this->wda(workset).cell_local_ids;
127 std::string blockId = this->wda(workset).block_id;
129 for(
int d=0;d<spatialDimension_;d++) {
130 for(std::size_t fieldIndex=0; fieldIndex<scatterFields_.size();fieldIndex++) {
131 PHX::MDField<const ScalarT,panzer::Cell,panzer::IP,panzer::Dim> &
field = scatterFields_[fieldIndex];
132 std::string fieldName = names_[fieldIndex]+dimStrings[d];
134 PHX::MDField<double,panzer::Cell,panzer::NODE> cellValue
138 double scaling = (scaling_.size()>0) ? scaling_[fieldIndex] : 1.0;
140 auto cellValue_v = cellValue.get_static_view();
141 auto field_v =
field.get_static_view();
142 Kokkos::parallel_for(field_v.extent(0), KOKKOS_LAMBDA (
int i) {
143 cellValue_v(i,0) = field_v(i,0,d);
148 mesh_->setCellFieldData(fieldName,blockId,localCellIds,cellValue.get_view(),scaling);
PHX::MDField< ScalarT, panzer::Cell, panzer::BASIS > field
A field to which we'll contribute, or in which we'll store, the result of computing this integral.