43 #ifndef PANZER_STK_SCATTER_FIELDS_IMPL_HPP 44 #define PANZER_STK_SCATTER_FIELDS_IMPL_HPP 46 #include "Teuchos_Assert.hpp" 48 #include "Phalanx_ConfigDefs.hpp" 49 #include "Phalanx_Evaluator_Macros.hpp" 50 #include "Phalanx_MDField.hpp" 51 #include "Phalanx_DataLayout.hpp" 52 #include "Phalanx_DataLayout_MDALayout.hpp" 57 #include "Teuchos_FancyOStream.hpp" 61 template <
typename EvalT,
typename TraitsT>
64 const Teuchos::RCP<STK_Interface> mesh,
65 const Teuchos::RCP<const panzer::PureBasis> &
basis,
66 const std::vector<std::string> & names)
73 template <
typename EvalT,
typename TraitsT>
76 const Teuchos::RCP<STK_Interface> mesh,
77 const Teuchos::RCP<const panzer::PureBasis> &
basis,
78 const std::vector<std::string> & names,
79 const std::vector<double> &
scaling)
84 template <
typename EvalT,
typename TraitsT>
87 const Teuchos::RCP<STK_Interface> mesh,
88 const Teuchos::RCP<const panzer::PureBasis> &
basis,
89 const std::vector<std::string> & names,
90 const std::vector<double> &
scaling)
98 bool correctScaling = (names.size()==
scaling.size()) || (
scaling.size()==0);
99 TEUCHOS_TEST_FOR_EXCEPTION(!correctScaling,std::invalid_argument,
100 "panzer_stk::ScatterFields evaluator requites a consistent number of scaling parameters (equal to the number of field names) " 101 "or an empty \"Field Scaling\" vector");
105 for (std::size_t fd = 0; fd < names.size(); ++fd) {
107 PHX::MDField<const ScalarT,Cell,NODE>(names[fd],
basis->functional);
115 PHX::Tag<ScalarT> scatterHolder(scatterName,Teuchos::rcp(
new PHX::MDALayout<panzer::Dummy>(0)));
116 this->addEvaluatedField(scatterHolder);
118 this->setName(scatterName+
": STK-Scatter Fields");
121 template <
typename EvalT,
typename TraitsT>
134 template <
typename EvalT,
typename TraitsT>
138 TEUCHOS_ASSERT(
false);
146 const std::vector<std::size_t> & localCellIds = this->wda(workset).cell_local_ids;
147 std::string blockId = this->wda(workset).block_id;
149 for(std::size_t fieldIndex=0; fieldIndex<
scatterFields_.size();fieldIndex++) {
std::vector< PHX::MDField< const ScalarT, panzer::Cell, panzer::Point > > scatterFields_
void initialize(const std::string &scatterName, const Teuchos::RCP< STK_Interface > mesh, const Teuchos::RCP< const panzer::PureBasis > &basis, const std::vector< std::string > &names, const std::vector< double > &scaling)
void initialize(const Teuchos::RCP< const panzer::PointRule > &pointRule, const Teuchos::RCP< const panzer::PureBasis > &basis, bool derivativesRequired)
Initialization method to unify the constructors.
Teuchos::RCP< STK_Interface > mesh_
void postRegistrationSetup(typename TraitsT::SetupData d, PHX::FieldManager< TraitsT > &fm)
Teuchos::RCP< const panzer::PureBasis > basis
Interpolates basis DOF values to IP DOF values.
ScatterFields(const std::string &scatterName, const Teuchos::RCP< STK_Interface > mesh, const Teuchos::RCP< const panzer::PureBasis > &basis, const std::vector< std::string > &names)
std::vector< double > scaling_
void evaluateFields(typename TraitsT::EvalData d)