43 #ifndef PANZER_GATHER_ORIENTATION_IMPL_HPP 44 #define PANZER_GATHER_ORIENTATION_IMPL_HPP 46 #include "Teuchos_Assert.hpp" 47 #include "Phalanx_DataLayout.hpp" 53 #include "Teuchos_FancyOStream.hpp" 55 template<
typename EvalT,
typename TRAITS,
typename LO,
typename GO>
59 const Teuchos::ParameterList& p)
61 indexers_.push_back(indexer);
63 const std::vector<std::string>& names =
64 *(p.get< Teuchos::RCP< std::vector<std::string> > >(
"DOF Names"));
66 indexerNames_ = p.get< Teuchos::RCP< std::vector<std::string> > >(
"Indexer Names");
69 Teuchos::RCP<const panzer::PureBasis>
basis;
70 if(p.isType< Teuchos::RCP<panzer::PureBasis> >(
"Basis"))
71 basis = p.get< Teuchos::RCP<panzer::PureBasis> >(
"Basis");
73 basis = p.get< Teuchos::RCP<const panzer::PureBasis> >(
"Basis");
75 gatherFieldOrientations_.resize(names.size());
76 for (std::size_t fd = 0; fd < names.size(); ++fd) {
77 gatherFieldOrientations_[fd] =
79 PHX::MDField<ScalarT,Cell,NODE>(
basis->name()+
" Orientation",
basis->functional);
80 this->addEvaluatedField(gatherFieldOrientations_[fd]);
83 this->setName(
"Gather Orientation");
86 template<
typename EvalT,
typename TRAITS,
typename LO,
typename GO>
89 const Teuchos::ParameterList& p)
92 const std::vector<std::string>& names =
93 *(p.get< Teuchos::RCP< std::vector<std::string> > >(
"DOF Names"));
95 indexerNames_ = p.get< Teuchos::RCP< std::vector<std::string> > >(
"Indexer Names");
98 Teuchos::RCP<const panzer::PureBasis>
basis;
99 if(p.isType< Teuchos::RCP<panzer::PureBasis> >(
"Basis"))
100 basis = p.get< Teuchos::RCP<panzer::PureBasis> >(
"Basis");
102 basis = p.get< Teuchos::RCP<const panzer::PureBasis> >(
"Basis");
105 for (std::size_t fd = 0; fd < names.size(); ++fd) {
107 PHX::MDField<ScalarT,Cell,NODE>(
basis->name()+
" Orientation",
basis->functional);
111 this->setName(
"Gather Orientation");
115 template<
typename EvalT,
typename TRAITS,
typename LO,
typename GO>
120 TEUCHOS_ASSERT(gatherFieldOrientations_.size() == indexerNames_->size());
122 indexerIds_.resize(gatherFieldOrientations_.size());
123 subFieldIds_.resize(gatherFieldOrientations_.size());
125 for (std::size_t fd = 0; fd < gatherFieldOrientations_.size(); ++fd) {
127 const std::string& fieldName = (*indexerNames_)[fd];
130 subFieldIds_[fd] = indexers_[indexerIds_[fd]]->getFieldNum(fieldName);
133 this->utils.setFieldData(gatherFieldOrientations_[fd],fm);
136 indexerNames_ = Teuchos::null;
140 template<
typename EvalT,
typename TRAITS,
typename LO,
typename GO>
147 std::string blockId = this->wda(workset).block_id;
148 const std::vector<std::size_t> & localCellIds = this->wda(workset).cell_local_ids;
151 for (std::size_t fieldIndex=0; fieldIndex<gatherFieldOrientations_.size();fieldIndex++) {
153 int indexerId = indexerIds_[fieldIndex];
154 int subFieldNum = subFieldIds_[fieldIndex];
156 auto subRowIndexer = indexers_[indexerId];
157 const std::vector<int> & elmtOffset = subRowIndexer->getGIDFieldOffsets(blockId,subFieldNum);
160 for(std::size_t worksetCellIndex=0;worksetCellIndex<localCellIds.size();++worksetCellIndex) {
161 std::size_t cellLocalId = localCellIds[worksetCellIndex];
163 subRowIndexer->getElementOrientation(cellLocalId,
orientation);
Teuchos::RCP< std::vector< std::string > > indexerNames_
int getFieldBlock(const std::string &fieldName, const std::vector< Teuchos::RCP< UniqueGlobalIndexer< LocalOrdinalT, GlobalOrdinalT > > > &ugis)
PHX::MDField< ScalarT, panzer::Cell, panzer::BASIS > orientation
PHX::MDField< ScalarT > vector
std::vector< PHX::MDField< ScalarT, Cell, NODE > > gatherFieldOrientations_
void evaluateFields(typename TRAITS::EvalData d)
Teuchos::RCP< const panzer::PureBasis > basis
Interpolates basis DOF values to IP DOF values.
void postRegistrationSetup(typename TRAITS::SetupData d, PHX::FieldManager< TRAITS > &vm)