11 #include "PanzerAdaptersSTK_config.hpp"
13 #include "Panzer_STK_IOClosureModel_Factory.hpp"
14 #include "Panzer_STK_ScatterCellAvgQuantity.hpp"
15 #include "Panzer_STK_ScatterCellAvgVector.hpp"
16 #include "Panzer_STK_ScatterCellQuantity.hpp"
17 #include "Panzer_STK_ScatterFields.hpp"
38 userCMF_->buildClosureModels(model_id,models,fl,ir,default_params,user_data,global_data,fm);
42 rcp(
new std::vector<
RCP<Evaluator<panzer::Traits> > > );
45 std::string block_id = default_params.
get<std::string>(
"Block ID");
47 if(!blockIdEvaluated_[block_id]) {
48 typedef std::map<std::string,std::vector<std::string> > BlockIdToFields;
50 int worksetsize = ir->
dl_scalar->extent(0);
54 if (user_data.
isParameter(
"Variable Scale Factors Map"))
60 BlockIdToFields::const_iterator cellAvgItr = blockIdToCellAvgFields_.find(block_id);
61 if(cellAvgItr!=blockIdToCellAvgFields_.end() ) {
68 pl.
set(
"Field Names",fieldNames);
69 pl.
set(
"Scatter Name", block_id+
"_Cell_Avg_Fields");
70 pl.
set(
"Variable Scale Factors Map", varScaleFactors);
76 evaluators->push_back(eval);
78 blockIdEvaluated_[block_id] =
true;
82 BlockIdToFields::const_iterator cellAvgVecItr = blockIdToCellAvgVectors_.find(block_id);
83 if(cellAvgVecItr != blockIdToCellAvgVectors_.end() ) {
90 pl.
set(
"Field Names",fieldNames);
91 pl.
set(
"Scatter Name", block_id+
"_Cell_Avg_Vectors");
92 pl.
set(
"Variable Scale Factors Map", varScaleFactors);
98 evaluators->push_back(eval);
100 blockIdEvaluated_[block_id] =
true;
104 BlockIdToFields::const_iterator cellItr = blockIdToCellFields_.find(block_id);
105 if(cellItr!=blockIdToCellFields_.end() ) {
110 pl.
set(
"Mesh",mesh_);
111 pl.
set(
"Workset Size",worksetsize);
112 pl.
set(
"Field Names",fieldNames);
113 pl.
set(
"Scatter Name", block_id+
"_Cell_Fields");
114 pl.
set(
"Variable Scale Factors Map", varScaleFactors);
120 evaluators->push_back(eval);
122 blockIdEvaluated_[block_id] =
true;
126 BlockIdToFields::const_iterator nodalItr = blockIdToNodalFields_.find(block_id);
127 if(nodalItr!=blockIdToNodalFields_.end() ) {
133 std::vector<double> scale_factors_(fieldNames->size(),1.0);
134 if (!varScaleFactors.
is_null()) {
135 for(
size_t f=0; f < fieldNames->size(); ++f) {
136 std::map<std::string,double>::const_iterator f2s_itr = varScaleFactors->find((*fieldNames)[f]);
137 if(f2s_itr != varScaleFactors->end()) {
138 scale_factors_[f] = f2s_itr->second;
149 evaluators->push_back(eval);
151 blockIdEvaluated_[block_id] =
true;
155 evaluators->insert(evaluators->end(),user_evals->begin(),user_evals->end());
160 #ifdef HAVE_PANZER_EXPLICIT_INSTANTIATION
T & get(const std::string &name, T def_value)
ParameterList & set(std::string const &name, T &&value, std::string const &docString="", RCP< const ParameterEntryValidator > const &validator=null)
#define PANZER_INSTANTIATE_TEMPLATE_CLASS_ONE_T(name)
bool isParameter(const std::string &name) const
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
Teuchos::RCP< PHX::DataLayout > dl_scalar
Data layout for scalar fields.
Teuchos::RCP< const shards::CellTopology > topology
Description and data layouts associated with a particular basis.
Teuchos::RCP< std::vector< Teuchos::RCP< PHX::Evaluator< panzer::Traits > > > > buildClosureModels(const std::string &model_id, const Teuchos::ParameterList &models, const panzer::FieldLayoutLibrary &fl, const Teuchos::RCP< panzer::IntegrationRule > &ir, const Teuchos::ParameterList &default_params, const Teuchos::ParameterList &user_data, const Teuchos::RCP< panzer::GlobalData > &global_data, PHX::FieldManager< panzer::Traits > &fm) const