43 #ifndef PANZER_GATHER_SOLUTION_TPETRA_SG_IMPL_HPP
44 #define PANZER_GATHER_SOLUTION_TPETRA_SG_IMPL_HPP
46 #include "Panzer_config.hpp"
49 #include "Teuchos_Assert.hpp"
50 #include "Phalanx_DataLayout.hpp"
56 #include "Teuchos_FancyOStream.hpp"
58 #include "Tpetra_Vector.hpp"
59 #include "Tpetra_Map.hpp"
65 template<
typename TRAITS,
typename LO,
typename GO,
typename NodeT>
70 : globalIndexer_(indexer)
71 , useTimeDerivativeSolutionVector_(false)
72 , globalDataKey_(
"Solution Gather Container")
74 const std::vector<std::string>& names =
82 gatherFields_.resize(names.size());
83 for (std::size_t fd = 0; fd < names.size(); ++fd) {
85 PHX::MDField<ScalarT,Cell,NODE>(names[fd],basis->functional);
86 this->addEvaluatedField(gatherFields_[fd]);
89 if (p.
isType<
bool>(
"Use Time Derivative Solution Vector"))
90 useTimeDerivativeSolutionVector_ = p.
get<
bool>(
"Use Time Derivative Solution Vector");
92 if (p.
isType<std::string>(
"Global Data Key"))
93 globalDataKey_ = p.
get<std::string>(
"Global Data Key");
95 this->setName(
"Gather Solution");
99 template<
typename TRAITS,
typename LO,
typename GO,
typename NodeT>
107 fieldIds_.resize(gatherFields_.size());
109 for (std::size_t fd = 0; fd < gatherFields_.size(); ++fd) {
112 const std::string& fieldName = (*indexerNames_)[fd];
113 fieldIds_[fd] = globalIndexer_->getFieldNum(fieldName);
116 this->utils.setFieldData(gatherFields_[fd],fm);
119 indexerNames_ = Teuchos::null;
123 template<
typename TRAITS,
typename LO,
typename GO,
typename NodeT>
130 sgTpetraContainer_ = Teuchos::rcp_dynamic_cast<SGLOC>(d.gedc.getDataObject(globalDataKey_),
true);
134 template<
typename TRAITS,
typename LO,
typename GO,
typename NodeT>
211 template<
typename TRAITS,
typename LO,
typename GO,
typename NodeT>
216 : globalIndexer_(indexer)
217 , useTimeDerivativeSolutionVector_(false)
218 , globalDataKey_(
"Solution Gather Container")
220 const std::vector<std::string>& names =
228 gatherFields_.resize(names.size());
229 for (std::size_t fd = 0; fd < names.size(); ++fd) {
230 PHX::MDField<ScalarT,Cell,NODE> f(names[fd],dl);
231 gatherFields_[fd] = f;
232 this->addEvaluatedField(gatherFields_[fd]);
235 if (p.
isType<
bool>(
"Use Time Derivative Solution Vector"))
236 useTimeDerivativeSolutionVector_ = p.
get<
bool>(
"Use Time Derivative Solution Vector");
238 if (p.
isType<std::string>(
"Global Data Key"))
239 globalDataKey_ = p.
get<std::string>(
"Global Data Key");
241 this->setName(
"Gather Solution");
245 template<
typename TRAITS,
typename LO,
typename GO,
typename NodeT>
253 fieldIds_.resize(gatherFields_.size());
255 for (std::size_t fd = 0; fd < gatherFields_.size(); ++fd) {
258 const std::string& fieldName = (*indexerNames_)[fd];
259 fieldIds_[fd] = globalIndexer_->getFieldNum(fieldName);
262 this->utils.setFieldData(gatherFields_[fd],fm);
265 indexerNames_ = Teuchos::null;
269 template<
typename TRAITS,
typename LO,
typename GO,
typename NodeT>
276 sgTpetraContainer_ = Teuchos::rcp_dynamic_cast<SGLOC>(d.gedc.getDataObject(globalDataKey_),
true);
280 template<
typename TRAITS,
typename LO,
typename GO,
typename NodeT>
365 #endif // end HAVE_STOKHOS
T & get(const std::string &name, T def_value)
Gathers solution values from the Newton solution vector into the nodal fields of the field manager...
Teuchos::RCP< const panzer::PureBasis > basis
Interpolates basis DOF values to IP DOF values.
bool isType(const std::string &name) const
#define TEUCHOS_ASSERT(assertion_test)