GRINS-0.8.0
List of all members | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Attributes
GRINS::BCFactoryAbstract< Base > Class Template Reference

#include <bc_factory_abstract.h>

Inheritance diagram for GRINS::BCFactoryAbstract< Base >:
Inheritance graph
[legend]
Collaboration diagram for GRINS::BCFactoryAbstract< Base >:
Collaboration graph
[legend]

Public Member Functions

 BCFactoryAbstract (const std::string &bc_type_name)
 
 ~BCFactoryAbstract ()
 
- Public Member Functions inherited from GRINS::FactoryWithGetPot< Base >
 FactoryWithGetPot (const std::string &name)
 
 ~FactoryWithGetPot ()
 
- Public Member Functions inherited from GRINS::FactoryAbstract< Base >
virtual ~FactoryAbstract ()
 
virtual libMesh::UniquePtr< Base > create ()=0
 Subclasses implement the actual construction of the Base object in create(). More...
 

Static Public Member Functions

static void set_system (MultiphysicsSystem &system)
 
static void set_bc_ids (const std::set< BoundaryID > &bc_ids)
 Boundary id for the current boundary condition section. More...
 
static void set_fe_var (const FEVariablesBase &fe_var)
 Active variable for the current boundary condition. More...
 
static void set_section (const std::string &section)
 Sets the current section of the input file. More...
 
static bool have_bc_type (const std::string &bc_type)
 
- Static Public Member Functions inherited from GRINS::FactoryWithGetPot< Base >
static void set_getpot (const GetPot &input)
 
- Static Public Member Functions inherited from GRINS::FactoryAbstract< Base >
static libMesh::UniquePtr< Base > build (const std::string &name)
 Use this method to build objects of type Base. More...
 

Protected Member Functions

void check_for_multiple_expressions (const GetPot &input, const std::string &section, const std::string &var_name) const
 Ensure that there is only one expression for the [Section/var_name] variable. More...
 
void build_var_indices (const MultiphysicsSystem &system, const std::vector< std::string > &var_names, std::vector< VariableIndex > &var_indices) const
 
virtual void check_state () const
 Helper function to reduce code duplication. More...
 
virtual void reset_state ()
 Helper function to redue code duplication. More...
 
template<>
MultiphysicsSystem_system
 
template<>
const std::set< BoundaryID > * _bc_ids
 
template<>
const FEVariablesBase_fe_var
 
template<>
std::string _section
 
template<>
MultiphysicsSystem_system
 
template<>
const std::set< BoundaryID > * _bc_ids
 
template<>
const FEVariablesBase_fe_var
 
template<>
std::string _section
 
template<>
MultiphysicsSystem_system
 
template<>
const std::set< BoundaryID > * _bc_ids
 
template<>
const FEVariablesBase_fe_var
 
template<>
std::string _section
 
- Protected Member Functions inherited from GRINS::FactoryWithGetPot< Base >
template<>
const GetPot * _input
 
template<>
const GetPot * _input
 
template<>
const GetPot * _input
 
template<>
const GetPot * _input
 
template<>
const GetPot * _input
 
template<>
const GetPot * _input
 
template<>
const GetPot * _input
 
template<>
const GetPot * _input
 
template<>
const GetPot * _input
 
template<>
const GetPot * _input
 
template<>
const GetPot * _input
 
template<>
const GetPot * _input
 
template<>
const GetPot * _input
 
- Protected Member Functions inherited from GRINS::FactoryAbstract< Base >
 FactoryAbstract (const std::string &name)
 Constructor is protected. Use the build() method to construct Base objects. More...
 
template<>
std::map< std::string, FactoryAbstract< CatalycityBase > * > & factory_map ()
 
template<>
std::map< std::string, FactoryAbstract< libMesh::DirichletBoundary > * > & factory_map ()
 
template<>
std::map< std::string, FactoryAbstract< NeumannBCContainer > * > & factory_map ()
 
template<>
std::map< std::string, FactoryAbstract< Physics > * > & factory_map ()
 
template<>
std::map< std::string, FactoryAbstract< Solver > * > & factory_map ()
 
template<>
std::map< std::string, FactoryAbstract< libMesh::ErrorEstimator > * > & factory_map ()
 
template<>
std::map< std::string, FactoryAbstract< FEVariablesBase > * > & factory_map ()
 

Static Protected Attributes

static MultiphysicsSystem_system
 We store only a raw pointer here because we can't make a copy. More...
 
static const std::set< BoundaryID > * _bc_ids
 BoundaryID for constructing a particular boundary condition. More...
 
static const FEVariablesBase_fe_var
 The FEVariablesBase class associated with the boundary condition being built. More...
 
static std::string _section
 
- Static Protected Attributes inherited from GRINS::FactoryWithGetPot< Base >
static const GetPot * _input
 We store only a raw pointer here because we can't make a copy. More...
 

Additional Inherited Members

- Static Protected Member Functions inherited from GRINS::FactoryAbstract< Base >
static FactoryAbstract< Base > & 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...
 
template<typename DerivedType >
static DerivedType & get_factory_subclass (const std::string &name)
 Like get_factory, but will downcast to DerivedType. More...
 
static std::map< std::string, FactoryAbstract< Base > * > & factory_map ()
 

Detailed Description

template<typename Base>
class GRINS::BCFactoryAbstract< Base >

Definition at line 44 of file bc_factory_abstract.h.

Constructor & Destructor Documentation

template<typename Base>
GRINS::BCFactoryAbstract< Base >::BCFactoryAbstract ( const std::string &  bc_type_name)
inline

Definition at line 47 of file bc_factory_abstract.h.

48  : FactoryWithGetPot<Base>(bc_type_name)
49  {}
template<typename Base>
GRINS::BCFactoryAbstract< Base >::~BCFactoryAbstract ( )
inline

Definition at line 51 of file bc_factory_abstract.h.

51 {};

Member Function Documentation

template<>
const std::set< BoundaryID > * GRINS::BCFactoryAbstract< NeumannBCContainer >::_bc_ids ( )
protected
template<>
const std::set< BoundaryID > * GRINS::BCFactoryAbstract< libMesh::DirichletBoundary >::_bc_ids ( )
protected

Definition at line 47 of file dirichlet_bc_factory_abstract.C.

template<>
const std::set< BoundaryID > * GRINS::BCFactoryAbstract< NeumannBCContainer >::_bc_ids ( )
protected

Definition at line 91 of file neumann_bc_factory_abstract.C.

template<>
const FEVariablesBase * GRINS::BCFactoryAbstract< NeumannBCContainer >::_fe_var ( )
protected
template<>
const FEVariablesBase * GRINS::BCFactoryAbstract< libMesh::DirichletBoundary >::_fe_var ( )
protected

Definition at line 50 of file dirichlet_bc_factory_abstract.C.

template<>
const FEVariablesBase * GRINS::BCFactoryAbstract< NeumannBCContainer >::_fe_var ( )
protected

Definition at line 94 of file neumann_bc_factory_abstract.C.

template<>
std::string GRINS::BCFactoryAbstract< NeumannBCContainer >::_section ( )
protected
template<>
std::string GRINS::BCFactoryAbstract< libMesh::DirichletBoundary >::_section ( )
protected

Definition at line 53 of file dirichlet_bc_factory_abstract.C.

template<>
std::string GRINS::BCFactoryAbstract< NeumannBCContainer >::_section ( )
protected

Definition at line 97 of file neumann_bc_factory_abstract.C.

template<>
MultiphysicsSystem * GRINS::BCFactoryAbstract< NeumannBCContainer >::_system ( )
protected
template<>
MultiphysicsSystem * GRINS::BCFactoryAbstract< libMesh::DirichletBoundary >::_system ( )
protected

Definition at line 44 of file dirichlet_bc_factory_abstract.C.

template<>
MultiphysicsSystem * GRINS::BCFactoryAbstract< NeumannBCContainer >::_system ( )
protected

Definition at line 88 of file neumann_bc_factory_abstract.C.

template<typename Base >
void GRINS::BCFactoryAbstract< Base >::build_var_indices ( const MultiphysicsSystem system,
const std::vector< std::string > &  var_names,
std::vector< VariableIndex > &  var_indices 
) const
inlineprotected

Definition at line 125 of file bc_factory_abstract.h.

128  {
129  var_indices.resize(var_names.size(),libMesh::invalid_uint);
130 
131  for( unsigned int i = 0; i < var_names.size(); i++ )
132  var_indices[i] = system.variable_number( var_names[i] );
133  }
template<typename Base >
void GRINS::BCFactoryAbstract< Base >::check_for_multiple_expressions ( const GetPot &  input,
const std::string &  section,
const std::string &  var_name 
) const
inlineprotected

Ensure that there is only one expression for the [Section/var_name] variable.

When parsing expressions to give to Parsed(FEM)Function, this function checks that there's only one expression for the given [Section/var_name] in the input file. This also helps protect against white space in the expression, which we don't currently support.

Definition at line 114 of file bc_factory_abstract.h.

116  {
117  std::string input_var = section+"/"+var_name;
118 
119  if( input.vector_variable_size(input_var) > 1 )
120  libmesh_error_msg("ERROR: expression size in input ["+input_var+"] is greater than 1!");
121  }
template<typename Base >
void GRINS::BCFactoryAbstract< Base >::check_state ( ) const
inlineprotectedvirtual

Helper function to reduce code duplication.

Reimplemented in GRINS::DirichletBCFactoryFunctionOldStyleBase< FunctionType >, GRINS::DirichletBCFactoryFunctionOldStyleBase< libMesh::FEMFunctionBase< libMesh::Number > >, GRINS::DirichletBCFactoryFunctionOldStyleBase< libMesh::FunctionBase< libMesh::Number > >, and GRINS::NeumannBCOldStyleFactoryAbstract.

Definition at line 137 of file bc_factory_abstract.h.

138  {
139  if( !this->_input )
140  libmesh_error_msg("ERROR: must call set_getpot() before building boundary condition!");
141 
142  if( !_system )
143  libmesh_error_msg("ERROR: must call set_system() before building boundary condition!");
144 
145  if( !_bc_ids )
146  libmesh_error_msg("ERROR: must call set_bc_ids() before building boundary condition!");
147 
148  if( !_fe_var )
149  libmesh_error_msg("ERROR: must call set_fe_var() before building boundary condition!");
150 
151  if( _section == std::string("DIE!") )
152  libmesh_error_msg("ERROR: must call set_section() before building boundary condition!");
153  }
const std::set< BoundaryID > * _bc_ids
template<typename Base >
bool GRINS::BCFactoryAbstract< Base >::have_bc_type ( const std::string &  bc_type)
inlinestatic

Definition at line 166 of file bc_factory_abstract.h.

References GRINS::FactoryAbstract< Base >::factory_map().

167  {
168  const std::map<std::string, FactoryAbstract<Base>*>& map =
170 
171  bool have_bc = false;
172 
173  if( map.find(bc_type) != map.end() )
174  have_bc = true;
175 
176  return have_bc;
177  }
static std::map< std::string, FactoryAbstract< Base > * > & factory_map()
template<typename Base >
void GRINS::BCFactoryAbstract< Base >::reset_state ( )
inlineprotectedvirtual
template<typename Base>
static void GRINS::BCFactoryAbstract< Base >::set_bc_ids ( const std::set< BoundaryID > &  bc_ids)
inlinestatic

Boundary id for the current boundary condition section.

Definition at line 57 of file bc_factory_abstract.h.

58  { _bc_ids = &bc_ids; }
const std::set< BoundaryID > * _bc_ids
template<typename Base>
static void GRINS::BCFactoryAbstract< Base >::set_fe_var ( const FEVariablesBase fe_var)
inlinestatic

Active variable for the current boundary condition.

Definition at line 61 of file bc_factory_abstract.h.

62  { _fe_var = &fe_var; }
template<typename Base>
static void GRINS::BCFactoryAbstract< Base >::set_section ( const std::string &  section)
inlinestatic

Sets the current section of the input file.

The section here corresponds to the section in the GetPot input file, e.g. if we're wanting to parse functions from [Variables/SideWall/Velocity/u], then section will be "Variables/SideWall/Velocity".

Definition at line 69 of file bc_factory_abstract.h.

70  { _section = section; }
template<typename Base>
static void GRINS::BCFactoryAbstract< Base >::set_system ( MultiphysicsSystem system)
inlinestatic

Definition at line 53 of file bc_factory_abstract.h.

54  { _system = &system; }

Member Data Documentation

template<typename Base>
const std::set<BoundaryID>* GRINS::BCFactoryAbstract< Base >::_bc_ids
staticprotected

BoundaryID for constructing a particular boundary condition.

Definition at line 100 of file bc_factory_abstract.h.

template<typename Base>
const FEVariablesBase* GRINS::BCFactoryAbstract< Base >::_fe_var
staticprotected

The FEVariablesBase class associated with the boundary condition being built.

We only build one boundary condition at a time, so this pointer will change with each boundary condition construction. We store a raw pointer here because we don't own this. Do not delete!

Definition at line 106 of file bc_factory_abstract.h.

template<typename Base>
std::string GRINS::BCFactoryAbstract< Base >::_section
staticprotected

Definition at line 108 of file bc_factory_abstract.h.

template<typename Base>
MultiphysicsSystem* GRINS::BCFactoryAbstract< Base >::_system
staticprotected

We store only a raw pointer here because we can't make a copy.

Otherwise, bad things will happen. We are not taking ownership of this, so we need to not delete this.

Definition at line 97 of file bc_factory_abstract.h.


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

Generated on Tue Dec 19 2017 12:47:30 for GRINS-0.8.0 by  doxygen 1.8.9.1