50 const std::vector<Teuchos::RCP<const GlobalIndexer>>&
52 const Teuchos::ParameterList& p)
55 useTimeDerivativeSolutionVector_(false),
56 globalDataKey_(
"Tangent Gather Container")
67 const vector<string>& names = *(p.get<RCP<vector<string>>>(
"DOF Names"));
69 RCP<PureBasis> basis = p.get<RCP<PureBasis>>(
"Basis");
70 if (p.isType<
bool>(
"Use Time Derivative Solution Vector"))
72 p.get<
bool>(
"Use Time Derivative Solution Vector");
73 if (p.isType<
string>(
"Global Data Key"))
82 MDField<ScalarT, Cell, NODE>(names[fd], basis->functional);
87 string firstName(
"<none>");
90 string n(
"GatherTangent (Blocked Epetra): " + firstName +
" (" +
91 print<EvalT>() +
")");
159 typename TRAITS::EvalData workset)
165 using Teuchos::ArrayRCP;
166 using Teuchos::ptrFromRef;
168 using Teuchos::rcp_dynamic_cast;
170 using Thyra::SpmdVectorBase;
174 if (xBvRoGed_.is_null())
178 string blockId(this->wda(workset).block_id);
179 const vector<size_t>& localCellIds = this->wda(workset).cell_local_ids;
180 int numFields(gatherFields_.size()), numCells(localCellIds.size());
183 for (
int fieldIndex(0); fieldIndex <
numFields; ++fieldIndex)
185 MDField<ScalarT, Cell, NODE>&
field = gatherFields_[fieldIndex];
186 int indexerId(indexerIds_[fieldIndex]),
187 subFieldNum(subFieldIds_[fieldIndex]);
190 auto xEvRoGed = xBvRoGed_->getGEDBlock(indexerId);
191 auto subRowIndexer = indexers_[indexerId];
192 const vector<int>& elmtOffset =
193 subRowIndexer->getGIDFieldOffsets(blockId, subFieldNum);
194 int numBases(elmtOffset.size());
197 for (
int cell(0); cell < numCells; ++cell)
199 LO cellLocalId = localCellIds[cell];
200 auto LIDs = subRowIndexer->getElementLIDs(cellLocalId);
203 for (
int basis(0); basis < numBases; ++basis)
205 int offset(elmtOffset[basis]), lid(LIDs[offset]);
206 field(cell, basis) = (*xEvRoGed)[lid];
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.