64 const Teuchos::RCP<const panzer::GlobalIndexer> & indexer,
65 const Teuchos::ParameterList& p)
70 const std::vector<std::string>& names =
71 *(p.get< Teuchos::RCP< std::vector<std::string> > >(
"DOF Names"));
73 indexerNames_ = p.get< Teuchos::RCP< std::vector<std::string> > >(
"Indexer Names");
76 Teuchos::RCP<const panzer::PureBasis> basis;
77 if(p.isType< Teuchos::RCP<panzer::PureBasis> >(
"Basis"))
78 basis = p.get< Teuchos::RCP<panzer::PureBasis> >(
"Basis");
80 basis = p.get< Teuchos::RCP<const panzer::PureBasis> >(
"Basis");
83 for (std::size_t fd = 0; fd < names.size(); ++fd) {
85 PHX::MDField<ScalarT,Cell,NODE>(names[fd],basis->functional);
93 if (p.isType<
bool>(
"Use Time Derivative Solution Vector"))
96 if (p.isType<std::string>(
"Global Data Key"))
99 this->setName(
"Gather Tangent");
131 using Teuchos::rcp_dynamic_cast;
137 RCP<GlobalEvaluationData> ged = d.gedc->getDataObject(
globalDataKey_);
138 RCP<LOCPair_GlobalEvaluationData> loc_pair =
139 rcp_dynamic_cast<LOCPair_GlobalEvaluationData>(ged);
141 if(loc_pair!=Teuchos::null) {
142 Teuchos::RCP<LinearObjContainer> loc = loc_pair->getGhostedLOC();
164 std::string blockId = this->
wda(workset).block_id;
166 Teuchos::RCP<typename LOC::VectorType> x;
172 auto cellLocalIdsKokkos = this->
wda(workset).getLocalCellIDs();
174 auto vov = Teuchos::rcp_dynamic_cast<const panzer::DOFManager>(
globalIndexer_,
true)->getGIDFieldOffsetsKokkos(blockId,
fieldIds_);
175 auto gidFieldOffsets = vov.getViewDevice();
177 auto x_view = x->getLocalViewDevice(Tpetra::Access::ReadWrite);
178 Kokkos::MDRangePolicy<PHX::Device::execution_space,Kokkos::Rank<2>> policy({0,0},{cellLocalIdsKokkos.extent(0),gidFieldOffsets.extent(0)});
179 Kokkos::parallel_for(
"GatherSolutionTpetra<Tangent>",policy,KOKKOS_LAMBDA(
const int worksetCellIndex,
const int fieldIndex) {
180 for(std::size_t basis=0;basis<gidFieldOffsets(fieldIndex).extent(0);basis++) {
181 int offset = gidFieldOffsets(fieldIndex)(basis);
182 LO lid = lids(cellLocalIdsKokkos(worksetCellIndex),offset);
183 auto& gf_ref = (gatherFieldsDevice[fieldIndex])(worksetCellIndex,basis);
184 gf_ref = x_view(lid,0);