GRINS-0.8.0
|
#include <variable_factory.h>
Public Member Functions | |
VariableFactoryAbstract (const std::string &name) | |
~VariableFactoryAbstract () | |
virtual libMesh::UniquePtr< FEVariablesBase > | create () |
Subclasses implement the actual construction of the Base object in create(). More... | |
Public Member Functions inherited from GRINS::FactoryWithGetPot< FEVariablesBase > | |
FactoryWithGetPot (const std::string &name) | |
~FactoryWithGetPot () | |
Public Member Functions inherited from GRINS::FactoryAbstract< FEVariablesBase > | |
virtual | ~FactoryAbstract () |
Static Public Member Functions | |
static std::vector< std::string > | build_var_names (const std::string &name) |
Build the variable names for the FEVariablesBase type (name), returned in the std::vector. More... | |
static std::string | parse_fe_family (const std::string &name) |
static std::string | parse_fe_order (const std::string &name) |
static void | set_var_names (const std::vector< std::string > &var_names) |
Set the variable names before calling create() More... | |
static void | set_var_indices (const std::vector< VariableIndex > &var_indices) |
Set the variable indices before calling create() More... | |
static void | set_var_section (const std::string &var_section) |
Set the section for the input file before calling build_var_names() More... | |
static void | set_subdomain_ids (const std::set< libMesh::subdomain_id_type > &subdomain_ids) |
Static Public Member Functions inherited from GRINS::FactoryWithGetPot< FEVariablesBase > | |
static void | set_getpot (const GetPot &input) |
Static Public Member Functions inherited from GRINS::FactoryAbstract< FEVariablesBase > | |
static libMesh::UniquePtr< FEVariablesBase > | build (const std::string &name) |
Use this method to build objects of type Base. More... | |
Protected Member Functions | |
virtual void | check_create_state () const |
Helper function to check required data is set when calling create() More... | |
virtual void | reset_create_state () |
Helper function to reset data before next call to create() More... | |
virtual libMesh::UniquePtr< FEVariablesBase > | build_fe_var (const std::vector< std::string > &var_names, const std::vector< VariableIndex > &var_indices, const std::set< libMesh::subdomain_id_type > &subdomain_ids)=0 |
Subclasses implement construction of the FEVariablesBase object using the var_names and var_indices. More... | |
virtual std::vector< std::string > | parse_var_names (const GetPot &input, const std::string &var_section)=0 |
virtual std::string | parse_fe_family_impl (const GetPot &input, const std::string &var_section)=0 |
virtual std::string | parse_fe_order_impl (const GetPot &input, const std::string &var_section)=0 |
std::string | parse_var_option (const GetPot &input, const std::string &var_section, const std::string &option, const std::string &default_val) const |
Protected Member Functions inherited from GRINS::FactoryAbstract< FEVariablesBase > | |
FactoryAbstract (const std::string &name) | |
Constructor is protected. Use the build() method to construct Base objects. More... | |
Static Protected Member Functions | |
static void | check_build_parse_state () |
Helper function to check required data is set when calling build_* or parse_* methods. More... | |
static void | reset_build_parse_state () |
Helper function to check required data is set when calling build_* or parse_* methods. More... | |
Static Protected Member Functions inherited from GRINS::FactoryAbstract< FEVariablesBase > | |
static FactoryAbstract< FEVariablesBase > & | get_factory (const std::string &name) |
Helper method that looks up the factory and returns it if present, or error if it's not. More... | |
static DerivedType & | get_factory_subclass (const std::string &name) |
Like get_factory, but will downcast to DerivedType. More... | |
static std::map< std::string, FactoryAbstract< FEVariablesBase > * > & | factory_map () |
Static Protected Attributes | |
static const std::vector< std::string > * | _var_names = NULL |
Variable component names needed for FEVariableBase construction. More... | |
static const std::vector< VariableIndex > * | _var_indices = NULL |
Variable component indices needed for FEVariableBase construction. More... | |
static std::string | _var_section = std::string("DIE!") |
Section of input to parse variable names in build_var_names. More... | |
static const std::set< libMesh::subdomain_id_type > * | _subdomain_ids = NULL |
Subdomain ids for the variable. More... | |
Static Protected Attributes inherited from GRINS::FactoryWithGetPot< FEVariablesBase > | |
static const GetPot * | _input |
We store only a raw pointer here because we can't make a copy. More... | |
Private Member Functions | |
VariableFactoryAbstract () | |
Definition at line 42 of file variable_factory.h.
|
inline |
Definition at line 46 of file variable_factory.h.
|
inline |
Definition at line 50 of file variable_factory.h.
|
private |
|
protectedpure virtual |
Subclasses implement construction of the FEVariablesBase object using the var_names and var_indices.
This function will be called from within create(), which called from VariableFactoryAbstract::build. Note the var_names can be built a priori using the VariableFactoryAbstract::build_var_names() method.
Implemented in GRINS::SpeciesVariableFactory< VariableType >, and GRINS::VariableFactoryBasic< VariableType >.
Referenced by create().
|
static |
Build the variable names for the FEVariablesBase type (name), returned in the std::vector.
Similarly to build(), this will grab the factory subclass and then internally call parse_var_names. set_getpot() must called before calling this method.
Definition at line 45 of file variable_factory.C.
References GRINS::FactoryWithGetPot< FEVariablesBase >::_input, _var_section, check_build_parse_state(), parse_var_names(), and reset_build_parse_state().
Referenced by GRINS::DefaultVariableBuilder::parse_var_names().
|
staticprotected |
Helper function to check required data is set when calling build_* or parse_* methods.
Definition at line 107 of file variable_factory.C.
References GRINS::FactoryWithGetPot< FEVariablesBase >::_input, and _var_section.
Referenced by build_var_names(), parse_fe_family(), and parse_fe_order().
|
protectedvirtual |
Helper function to check required data is set when calling create()
Definition at line 87 of file variable_factory.C.
References _subdomain_ids, _var_indices, and _var_names.
Referenced by create().
|
virtual |
Subclasses implement the actual construction of the Base object in create().
Implements GRINS::FactoryAbstract< FEVariablesBase >.
Definition at line 30 of file variable_factory.C.
References _subdomain_ids, _var_indices, _var_names, build_fe_var(), check_create_state(), and reset_create_state().
|
static |
Definition at line 59 of file variable_factory.C.
References GRINS::FactoryWithGetPot< FEVariablesBase >::_input, _var_section, check_build_parse_state(), parse_fe_family_impl(), and reset_build_parse_state().
Referenced by GRINS::DefaultVariableBuilder::parse_fe_family().
|
protectedpure virtual |
Implemented in GRINS::ScalarVariableFactory< VariableType >, and GRINS::VariableFactoryBase.
Referenced by parse_fe_family().
|
static |
Definition at line 73 of file variable_factory.C.
References GRINS::FactoryWithGetPot< FEVariablesBase >::_input, _var_section, check_build_parse_state(), parse_fe_order_impl(), and reset_build_parse_state().
Referenced by GRINS::DefaultVariableBuilder::parse_fe_order().
|
protectedpure virtual |
Implemented in GRINS::VariableFactoryBase.
Referenced by parse_fe_order().
|
protectedpure virtual |
Implemented in GRINS::SpeciesVariableFactory< VariableType >, and GRINS::VariableFactoryBasic< VariableType >.
Referenced by build_var_names().
|
inlineprotected |
Definition at line 109 of file variable_factory.h.
Referenced by GRINS::VariableFactoryBase::parse_fe_family_impl(), and GRINS::VariableFactoryBase::parse_fe_order_impl().
|
staticprotected |
Helper function to check required data is set when calling build_* or parse_* methods.
Definition at line 116 of file variable_factory.C.
References GRINS::FactoryWithGetPot< FEVariablesBase >::_input, and _var_section.
Referenced by build_var_names(), parse_fe_family(), and parse_fe_order().
|
protectedvirtual |
Helper function to reset data before next call to create()
Definition at line 99 of file variable_factory.C.
References _subdomain_ids, _var_indices, and _var_names.
Referenced by create().
|
inlinestatic |
Definition at line 77 of file variable_factory.h.
References _subdomain_ids.
Referenced by GRINS::VariableBuilder::build_fe_var().
|
inlinestatic |
Set the variable indices before calling create()
Definition at line 69 of file variable_factory.h.
References _var_indices.
Referenced by GRINS::VariableBuilder::build_fe_var().
|
inlinestatic |
Set the variable names before calling create()
Definition at line 65 of file variable_factory.h.
References _var_names.
Referenced by GRINS::VariableBuilder::build_fe_var().
|
inlinestatic |
Set the section for the input file before calling build_var_names()
It is expected that user just need to call input(var_section+"/<user_option>")
Definition at line 74 of file variable_factory.h.
References _var_section.
Referenced by GRINS::DefaultVariableBuilder::parse_fe_family(), GRINS::DefaultVariableBuilder::parse_fe_order(), and GRINS::DefaultVariableBuilder::parse_var_names().
|
staticprotected |
Subdomain ids for the variable.
Definition at line 132 of file variable_factory.h.
Referenced by check_create_state(), create(), reset_create_state(), and set_subdomain_ids().
|
staticprotected |
Variable component indices needed for FEVariableBase construction.
Definition at line 126 of file variable_factory.h.
Referenced by check_create_state(), create(), reset_create_state(), and set_var_indices().
|
staticprotected |
Variable component names needed for FEVariableBase construction.
Definition at line 123 of file variable_factory.h.
Referenced by check_create_state(), create(), reset_create_state(), and set_var_names().
|
staticprotected |
Section of input to parse variable names in build_var_names.
Definition at line 129 of file variable_factory.h.
Referenced by build_var_names(), check_build_parse_state(), parse_fe_family(), parse_fe_order(), reset_build_parse_state(), and set_var_section().