45 PHX::MDField<ScalarT,Cell,NODE>(names[fd],basis->functional);
58 for (std::size_t fd = 0; fd < gatherFields_.size(); ++fd) {
59 std::string fieldName = gatherFields_[fd].fieldTag().name();
61 stkFields_[fd] = mesh_->getMetaData()->get_field<
double>(stk::topology::NODE_RANK, fieldName);
63 if(stkFields_[fd]==0) {
65 mesh_->printMetaData(ss);
66 TEUCHOS_TEST_FOR_EXCEPTION(
true,std::invalid_argument,
67 "panzer_stk::GatherFields: STK field " <<
"\"" << fieldName <<
"\" "
68 "not found.\n STK meta data follows: \n\n" << ss.str());
78 const std::vector<stk::mesh::Entity> & localElements = *mesh_->getElementsOrderedByLID();
81 const std::vector<std::size_t> & localCellIds = this->wda(workset).cell_local_ids;
84 for (std::size_t fieldIndex=0; fieldIndex<gatherFields_.size();fieldIndex++) {
87 auto field_view_d = gatherFields_[fieldIndex].get_static_view();
88 auto field_view_h = Kokkos::create_mirror_view(field_view_d);
89 Kokkos::deep_copy(field_view_h, field_view_d);
91 std::size_t basisCnt = field_view_h.extent(1);
94 for(std::size_t worksetCellIndex=0;worksetCellIndex<localCellIds.size();++worksetCellIndex) {
95 std::size_t cellLocalId = localCellIds[worksetCellIndex];
96 stk::mesh::Entity
const* relations = mesh_->getBulkData()->begin_nodes(localElements[cellLocalId]);
100 field_view_h(worksetCellIndex,0) = *stk::mesh::field_data(*
field, localElements[cellLocalId]);
104 for(std::size_t basis=0;basis<basisCnt;basis++) {
105 stk::mesh::Entity node = relations[basis];
106 field_view_h(worksetCellIndex,basis) = *stk::mesh::field_data(*
field, node);
110 Kokkos::deep_copy(field_view_d, field_view_h);
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.