Panzer Version of the Day
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
panzer_stk::IOClosureModelFactory< EvalT > Class Template Reference

A panzer::ClosureModelFactory decorator that provides evaluators for writing fields to exodus files. Wraps a user closure model factory. buildClosureModels() delegates to the wrapped factory for every evaluation type; the panzer::Traits::Residual specialization additionally builds the scatter evaluators needed to write selected nodal/cell fields out to the STK mesh for visualization/output, since output only needs to happen once per workset regardless of evaluation type. More...

#include <Panzer_STK_IOClosureModel_Factory_decl.hpp>

Inheritance diagram for panzer_stk::IOClosureModelFactory< EvalT >:
Inheritance graph
[legend]

Public Member Functions

 IOClosureModelFactory (const Teuchos::RCP< const panzer::ClosureModelFactory< EvalT > > userCMF_, const Teuchos::RCP< STK_Interface > &mesh, const Teuchos::ParameterList &outputList)
 Construct with the fields to write specified via an output ParameterList (parsed with parseOutputList()).
 
 IOClosureModelFactory (const Teuchos::RCP< const panzer::ClosureModelFactory< EvalT > > userCMF_, const Teuchos::RCP< STK_Interface > &mesh, const std::map< std::string, std::vector< std::string > > &nodalFields, const std::map< std::string, std::vector< std::string > > &cellFields)
 Construct with the fields to write specified explicitly, split into nodal and cell fields per element block.
 
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
 Delegates to the wrapped factory's buildClosureModels() for the named model.
 
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
 
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
 Delegates to the wrapped factory's buildClosureModels() for the named model, then adds the scatter-to-mesh evaluators needed for the fields requested at construction.
 
- Public Member Functions inherited from panzer::ClosureModelFactory< EvalT >
 ClosureModelFactory (bool throw_if_model_not_found=true)
 
virtual ~ClosureModelFactory ()
 
virtual 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 &equation_set_params, const Teuchos::ParameterList &user_data, const Teuchos::RCP< panzer::GlobalData > &global_data, PHX::FieldManager< panzer::Traits > &fm) const =0
 
virtual void registerEvaluators (const std::vector< Teuchos::RCP< PHX::Evaluator< panzer::Traits > > > &evaluators, PHX::FieldManager< panzer::Traits > &fm) const
 
virtual void setThrowOnModelNotFound (bool do_throw)
 
- Public Member Functions inherited from panzer::ClosureModelFactoryBase
 ClosureModelFactoryBase ()
 
virtual ~ClosureModelFactoryBase ()
 
- Public Member Functions inherited from panzer::Base
 Base ()
 
virtual ~Base ()
 
- Public Member Functions inherited from panzer::EvaluatorsRegistrar
int setDetailsIndex (const int details_index)
 
int getDetailsIndex () const
 Get the WorksetDetails index.
 

Private Member Functions

void parseOutputList (const Teuchos::ParameterList &pl, std::map< std::string, std::vector< std::string > > &blockIdToFields) const
 

Private Attributes

Teuchos::RCP< STK_Interfacemesh_
 Mesh pointer, will be passed around.
 
std::map< std::string, std::vector< std::string > > blockIdToCellAvgFields_
 Map showing which cell averaged fields need to be written out for each element block.
 
std::map< std::string, std::vector< std::string > > blockIdToCellAvgVectors_
 Map showing which cell averaged vector fields need to be written out for each element block.
 
std::map< std::string, std::vector< std::string > > blockIdToCellFields_
 Map showing which cell fields need to be written out for each element block.
 
std::map< std::string, std::vector< std::string > > blockIdToNodalFields_
 Map showing which nodal fields need to be written out for each element block.
 
std::map< std::string, bool > blockIdEvaluated_
 
Teuchos::RCP< const panzer::ClosureModelFactory< EvalT > > userCMF_
 we will reuse the drekar closure model factory
 

Additional Inherited Members

- Protected Member Functions inherited from panzer::EvaluatorsRegistrar
 EvaluatorsRegistrar ()
 Default ctor initializes WorksetDetails index to 0.
 
virtual ~EvaluatorsRegistrar ()
 
template<typename EvalT >
void registerEvaluator (PHX::FieldManager< panzer::Traits > &fm, const Teuchos::RCP< PHX::Evaluator< panzer::Traits > > &op) const
 
- Protected Attributes inherited from panzer::ClosureModelFactory< EvalT >
bool m_throw_if_model_not_found
 

Detailed Description

template<typename EvalT>
class panzer_stk::IOClosureModelFactory< EvalT >

A panzer::ClosureModelFactory decorator that provides evaluators for writing fields to exodus files. Wraps a user closure model factory. buildClosureModels() delegates to the wrapped factory for every evaluation type; the panzer::Traits::Residual specialization additionally builds the scatter evaluators needed to write selected nodal/cell fields out to the STK mesh for visualization/output, since output only needs to happen once per workset regardless of evaluation type.

Definition at line 39 of file Panzer_STK_IOClosureModel_Factory_decl.hpp.

Constructor & Destructor Documentation

◆ IOClosureModelFactory() [1/2]

template<typename EvalT >
panzer_stk::IOClosureModelFactory< EvalT >::IOClosureModelFactory ( const Teuchos::RCP< const panzer::ClosureModelFactory< EvalT > >  userCMF_,
const Teuchos::RCP< STK_Interface > &  mesh,
const Teuchos::ParameterList &  outputList 
)

Construct with the fields to write specified via an output ParameterList (parsed with parseOutputList()).

Parameters
[in]userCMF_the wrapped closure model factory to delegate buildClosureModels() calls to.
[in]meshthe STK mesh to write output fields to.
[in]outputListParameterList naming the fields to write out.

Definition at line 22 of file Panzer_STK_IOClosureModel_Factory_impl.hpp.

◆ IOClosureModelFactory() [2/2]

template<typename EvalT >
panzer_stk::IOClosureModelFactory< EvalT >::IOClosureModelFactory ( const Teuchos::RCP< const panzer::ClosureModelFactory< EvalT > >  userCMF_,
const Teuchos::RCP< STK_Interface > &  mesh,
const std::map< std::string, std::vector< std::string > > &  nodalFields,
const std::map< std::string, std::vector< std::string > > &  cellFields 
)

Construct with the fields to write specified explicitly, split into nodal and cell fields per element block.

Parameters
[in]userCMF_the wrapped closure model factory to delegate buildClosureModels() calls to.
[in]meshthe STK mesh to write output fields to.
[in]nodalFieldsnodal field names to write out, keyed by element block ID.
[in]cellFieldscell (element-averaged) field names to write out, keyed by element block ID.

Definition at line 37 of file Panzer_STK_IOClosureModel_Factory_impl.hpp.

Member Function Documentation

◆ buildClosureModels() [1/3]

template<typename EvalT >
Teuchos::RCP< std::vector< Teuchos::RCP< PHX::Evaluator< panzer::Traits > > > > panzer_stk::IOClosureModelFactory< EvalT >::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

Delegates to the wrapped factory's buildClosureModels() for the named model.

Parameters
[in]model_idthe closure model ID to build; selects which sublist of models to use.
[in]modelsParameterList of named closure model sublists, keyed by model ID.
[in]flthe field layouts available for the current physics block.
[in]irthe integration rule the built evaluators should evaluate on.
[in]default_paramsequation-set-level parameters used as defaults when building closures.
[in]user_datauser-supplied parameters passed through to closures that need additional application data.
[in]global_dataglobal data (parameter library, output stream) shared across the problem.
[in]fmthe field manager the built evaluators will be registered into.

Definition at line 79 of file Panzer_STK_IOClosureModel_Factory_impl.hpp.

◆ parseOutputList()

template<typename EvalT >
void panzer_stk::IOClosureModelFactory< EvalT >::parseOutputList ( const Teuchos::ParameterList &  pl,
std::map< std::string, std::vector< std::string > > &  blockIdToFields 
) const
private

Definition at line 58 of file Panzer_STK_IOClosureModel_Factory_impl.hpp.

◆ buildClosureModels() [2/3]

Teuchos::RCP< std::vector< Teuchos::RCP< PHX::Evaluator< panzer::Traits > > > > panzer_stk::IOClosureModelFactory< panzer::Traits::Residual >::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

Definition at line 21 of file Panzer_STK_IOClosureModel_Factory.cpp.

◆ buildClosureModels() [3/3]

Teuchos::RCP< std::vector< Teuchos::RCP< PHX::Evaluator< panzer::Traits > > > > panzer_stk::IOClosureModelFactory< panzer::Traits::Residual >::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

Delegates to the wrapped factory's buildClosureModels() for the named model, then adds the scatter-to-mesh evaluators needed for the fields requested at construction.

Parameters
[in]model_idthe closure model ID to build; selects which sublist of models to use.
[in]modelsParameterList of named closure model sublists, keyed by model ID.
[in]flthe field layouts available for the current physics block.
[in]irthe integration rule the built evaluators should evaluate on.
[in]default_paramsequation-set-level parameters used as defaults when building closures.
[in]user_datauser-supplied parameters passed through to closures that need additional application data.
[in]global_dataglobal data (parameter library, output stream) shared across the problem.
[in]fmthe field manager the built evaluators will be registered into.

Member Data Documentation

◆ mesh_

template<typename EvalT >
Teuchos::RCP<STK_Interface> panzer_stk::IOClosureModelFactory< EvalT >::mesh_
private

Mesh pointer, will be passed around.

Definition at line 90 of file Panzer_STK_IOClosureModel_Factory_decl.hpp.

◆ blockIdToCellAvgFields_

template<typename EvalT >
std::map<std::string,std::vector<std::string> > panzer_stk::IOClosureModelFactory< EvalT >::blockIdToCellAvgFields_
private

Map showing which cell averaged fields need to be written out for each element block.

Definition at line 93 of file Panzer_STK_IOClosureModel_Factory_decl.hpp.

◆ blockIdToCellAvgVectors_

template<typename EvalT >
std::map<std::string,std::vector<std::string> > panzer_stk::IOClosureModelFactory< EvalT >::blockIdToCellAvgVectors_
private

Map showing which cell averaged vector fields need to be written out for each element block.

Definition at line 96 of file Panzer_STK_IOClosureModel_Factory_decl.hpp.

◆ blockIdToCellFields_

template<typename EvalT >
std::map<std::string,std::vector<std::string> > panzer_stk::IOClosureModelFactory< EvalT >::blockIdToCellFields_
private

Map showing which cell fields need to be written out for each element block.

Definition at line 99 of file Panzer_STK_IOClosureModel_Factory_decl.hpp.

◆ blockIdToNodalFields_

template<typename EvalT >
std::map<std::string,std::vector<std::string> > panzer_stk::IOClosureModelFactory< EvalT >::blockIdToNodalFields_
private

Map showing which nodal fields need to be written out for each element block.

Definition at line 102 of file Panzer_STK_IOClosureModel_Factory_decl.hpp.

◆ blockIdEvaluated_

template<typename EvalT >
std::map<std::string,bool> panzer_stk::IOClosureModelFactory< EvalT >::blockIdEvaluated_
mutableprivate

Map stating if an evaluator for a particular block ID has been included.

This is a bit of hack that is done to gurantee only one evaluator is added to each field manager. However, if an instantiation of this closure model factory is used in multiple places then the appropriate evaluator will be added and required only once. So its likely that not every field manager will have (and require) the scatter cell evaluators.

Definition at line 112 of file Panzer_STK_IOClosureModel_Factory_decl.hpp.

◆ userCMF_

template<typename EvalT >
Teuchos::RCP<const panzer::ClosureModelFactory<EvalT> > panzer_stk::IOClosureModelFactory< EvalT >::userCMF_
private

we will reuse the drekar closure model factory

Definition at line 115 of file Panzer_STK_IOClosureModel_Factory_decl.hpp.


The documentation for this class was generated from the following files: