55 Teuchos::rcp(
new PHX::Tag<ScalarT>(scatterName,Teuchos::rcp(
new PHX::MDALayout<Dummy>(0))));
70 scatterFields_[eq] = PHX::MDField<const ScalarT,Cell,NODE>(names[eq],dl);
130 std::vector<double> jacRow;
132 bool useColumnIndexer = colGlobalIndexer_!=Teuchos::null;
135 std::string blockId = this->wda(workset).block_id;
136 const std::vector<std::size_t> & localCellIds = this->wda(workset).cell_local_ids;
138 Teuchos::RCP<Epetra_Vector> r = epetraContainer_->get_f();
139 Teuchos::RCP<Epetra_CrsMatrix> Jac = epetraContainer_->get_A();
141 const Teuchos::RCP<const panzer::GlobalIndexer>&
142 colGlobalIndexer = useColumnIndexer ? colGlobalIndexer_ : globalIndexer_;
150 for(std::size_t worksetCellIndex=0;worksetCellIndex<localCellIds.size();++worksetCellIndex) {
151 std::size_t cellLocalId = localCellIds[worksetCellIndex];
153 auto rLIDs = globalIndexer_->getElementLIDs(cellLocalId);
154 auto initial_cLIDs = colGlobalIndexer->getElementLIDs(cellLocalId);
156 for (
int i(0); i < static_cast<int>(initial_cLIDs.extent(0)); ++i)
157 cLIDs.push_back(initial_cLIDs(i));
158 if (Teuchos::nonnull(workset.other)) {
159 const std::size_t other_cellLocalId = workset.other->cell_local_ids[worksetCellIndex];
160 auto other_cLIDs = colGlobalIndexer->getElementLIDs(other_cellLocalId);
161 for (
int i(0); i < static_cast<int>(other_cLIDs.extent(0)); ++i)
162 cLIDs.push_back(other_cLIDs(i));
166 for(std::size_t fieldIndex = 0; fieldIndex < scatterFields_.size(); fieldIndex++) {
167 int fieldNum = fieldIds_[fieldIndex];
168 const std::vector<int> & elmtOffset = globalIndexer_->getGIDFieldOffsets(blockId,fieldNum);
171 for(std::size_t rowBasisNum = 0; rowBasisNum < elmtOffset.size(); rowBasisNum++) {
172 const ScalarT scatterField = (scatterFields_[fieldIndex])(worksetCellIndex,rowBasisNum);
173 int rowOffset = elmtOffset[rowBasisNum];
174 int row = rLIDs[rowOffset];
177 jacRow.resize(scatterField.size());
179 for(
int sensIndex=0;sensIndex<scatterField.size();++sensIndex)
180 jacRow[sensIndex] = scatterField.fastAccessDx(sensIndex).fastAccessDx(0);
183 int err = Jac->SumIntoMyValues(
185 std::min(cLIDs.size(),
static_cast<size_t>(scatterField.size())),
188 TEUCHOS_ASSERT_EQUALITY(err,0);