44 const Teuchos::RCP<const panzer::GlobalIndexer>& indexer,
45 const Teuchos::ParameterList& p)
47 globalIndexer_(indexer),
48 useTimeDerivativeSolutionVector_(false),
49 globalDataKey_(
"Tangent Gather Container")
60 const vector<string>& names = *(p.get<RCP<vector<string>>>(
"DOF Names"));
62 RCP<const PureBasis> basis;
63 if (p.isType<RCP<PureBasis>>(
"Basis"))
64 basis = p.get<RCP<PureBasis>>(
"Basis");
66 basis = p.get<RCP<const PureBasis>>(
"Basis");
67 if (p.isType<
bool>(
"Use Time Derivative Solution Vector"))
69 p.get<
bool>(
"Use Time Derivative Solution Vector");
70 if (p.isType<
string>(
"Global Data Key"))
79 MDField<ScalarT, Cell, NODE>(names[fd], basis->functional);
89 string firstName(
"<none>");
92 string n(
"GatherTangent (Epetra): " + firstName +
" (" +
93 print<EvalT>() +
")");
161 typename TRAITS::EvalData workset)
167 using Teuchos::ArrayRCP;
168 using Teuchos::ptrFromRef;
170 using Teuchos::rcp_dynamic_cast;
171 using Thyra::SpmdVectorBase;
175 if (dxdpEvRoGed_.is_null())
179 string blockId(this->wda(workset).block_id);
180 const vector<size_t>& localCellIds = this->wda(workset).cell_local_ids;
181 int numCells(localCellIds.size()),
numFields(gatherFields_.size());
188 auto LIDs = globalIndexer_->getLIDs();
189 auto LIDs_h = Kokkos::create_mirror_view(LIDs);
190 Kokkos::deep_copy(LIDs_h, LIDs);
192 for (
int fieldIndex(0); fieldIndex <
numFields; ++fieldIndex)
194 MDField<ScalarT, Cell, NODE>&
field = gatherFields_[fieldIndex];
195 auto field_h = Kokkos::create_mirror_view(
field.get_static_view());
196 for (
int cell(0); cell < numCells; ++cell)
198 size_t cellLocalId(localCellIds[cell]);
199 int fieldNum(fieldIds_[fieldIndex]);
200 const vector<int>& elmtOffset =
201 globalIndexer_->getGIDFieldOffsets(blockId, fieldNum);
202 int numBases(elmtOffset.size());
205 for (
int basis(0); basis < numBases; ++basis)
207 int offset(elmtOffset[basis]), lid(LIDs_h(cellLocalId, offset));
208 field_h(cell, basis) = (*dxdpEvRoGed_)[lid];
211 Kokkos::deep_copy(
field.get_static_view(), field_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.