GRINS-0.8.0
List of all members | Public Member Functions | Protected Member Functions | Private Member Functions
GRINS::DirichletBCFactoryFunctionBase< FunctionType > Class Template Referenceabstract

#include <dirichlet_bc_factory_function_base.h>

Inheritance diagram for GRINS::DirichletBCFactoryFunctionBase< FunctionType >:
Inheritance graph
[legend]
Collaboration diagram for GRINS::DirichletBCFactoryFunctionBase< FunctionType >:
Collaboration graph
[legend]

Public Member Functions

 DirichletBCFactoryFunctionBase (const std::string &bc_type_name)
 
 ~DirichletBCFactoryFunctionBase ()
 
- Public Member Functions inherited from GRINS::DirichletBCFactoryAbstract
 DirichletBCFactoryAbstract (const std::string &bc_type_name)
 
 ~DirichletBCFactoryAbstract ()
 
- Public Member Functions inherited from GRINS::BCFactoryAbstract< libMesh::DirichletBoundary >
 BCFactoryAbstract (const std::string &bc_type_name)
 
 ~BCFactoryAbstract ()
 
- Public Member Functions inherited from GRINS::FactoryWithGetPot< libMesh::DirichletBoundary >
 FactoryWithGetPot (const std::string &name)
 
 ~FactoryWithGetPot ()
 
- Public Member Functions inherited from GRINS::FactoryAbstract< libMesh::DirichletBoundary >
virtual ~FactoryAbstract ()
 

Protected Member Functions

virtual libMesh::UniquePtr< FunctionType > build_func (const GetPot &input, MultiphysicsSystem &system, std::vector< std::string > &var_names, const std::string &section)=0
 Builds the FunctionBase object for boundary condition. More...
 
libMesh::UniquePtr< libMesh::DirichletBoundary > make_dirichlet_boundary (const std::set< BoundaryID > &bc_ids, const libMesh::System &system, libMesh::UniquePtr< FunctionType > &func, const std::vector< VariableIndex > &var_indices)
 Dispatch, based on FunctionType, to the correct DirchletBoundary construction. More...
 
virtual const std::vector< std::string > & get_var_names () const
 Helper function that can be overridded in subclasses. More...
 
template<>
libMesh::UniquePtr< libMesh::DirichletBoundary > make_dirichlet_boundary (const std::set< BoundaryID > &bc_ids, const libMesh::System &, libMesh::UniquePtr< libMesh::FunctionBase< libMesh::Number > > &func, const std::vector< VariableIndex > &var_indices)
 
template<>
libMesh::UniquePtr< libMesh::DirichletBoundary > make_dirichlet_boundary (const std::set< BoundaryID > &bc_ids, const libMesh::System &system, libMesh::UniquePtr< libMesh::FEMFunctionBase< libMesh::Number > > &func, const std::vector< VariableIndex > &var_indices)
 
- Protected Member Functions inherited from GRINS::DirichletBCFactoryAbstract
void check_for_vars (const GetPot &input, const std::string &section, const std::vector< std::string > &var_names, std::set< std::string > *vars_found=NULL)
 Helper function. More...
 
- Protected Member Functions inherited from GRINS::BCFactoryAbstract< libMesh::DirichletBoundary >
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...
 
- Protected Member Functions inherited from GRINS::FactoryAbstract< libMesh::DirichletBoundary >
 FactoryAbstract (const std::string &name)
 Constructor is protected. Use the build() method to construct Base objects. More...
 

Private Member Functions

virtual libMesh::UniquePtr< libMesh::DirichletBoundary > create ()
 Subclasses implement the actual construction of the Base object in create(). More...
 

Additional Inherited Members

- Static Public Member Functions inherited from GRINS::BCFactoryAbstract< libMesh::DirichletBoundary >
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< libMesh::DirichletBoundary >
static void set_getpot (const GetPot &input)
 
- Static Public Member Functions inherited from GRINS::FactoryAbstract< libMesh::DirichletBoundary >
static libMesh::UniquePtr< libMesh::DirichletBoundary > build (const std::string &name)
 Use this method to build objects of type Base. More...
 
- Static Protected Member Functions inherited from GRINS::FactoryAbstract< libMesh::DirichletBoundary >
static FactoryAbstract< libMesh::DirichletBoundary > & 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< libMesh::DirichletBoundary > * > & factory_map ()
 
- Static Protected Attributes inherited from GRINS::BCFactoryAbstract< libMesh::DirichletBoundary >
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< libMesh::DirichletBoundary >
static const GetPot * _input
 We store only a raw pointer here because we can't make a copy. More...
 

Detailed Description

template<typename FunctionType>
class GRINS::DirichletBCFactoryFunctionBase< FunctionType >

Definition at line 35 of file dirichlet_bc_factory_function_base.h.

Constructor & Destructor Documentation

template<typename FunctionType>
GRINS::DirichletBCFactoryFunctionBase< FunctionType >::DirichletBCFactoryFunctionBase ( const std::string &  bc_type_name)
inline

Definition at line 39 of file dirichlet_bc_factory_function_base.h.

40  : DirichletBCFactoryAbstract(bc_type_name)
41  {}
DirichletBCFactoryAbstract(const std::string &bc_type_name)
template<typename FunctionType>
GRINS::DirichletBCFactoryFunctionBase< FunctionType >::~DirichletBCFactoryFunctionBase ( )
inline

Definition at line 43 of file dirichlet_bc_factory_function_base.h.

43 {};

Member Function Documentation

template<typename FunctionType>
virtual libMesh::UniquePtr<FunctionType> GRINS::DirichletBCFactoryFunctionBase< FunctionType >::build_func ( const GetPot &  input,
MultiphysicsSystem system,
std::vector< std::string > &  var_names,
const std::string &  section 
)
protectedpure virtual

Builds the FunctionBase object for boundary condition.

Subclasses should override this function to build the FunctionBase object that corresponds to the variables passed in var_names. The variable names passed in will correspond to only a single VariableBase object, e.g. Velocity. The section arguments corresponds to the section to parse for the variables in the input file, e.g. input(section+"/"+var_names[0]).

The variable names passed in correspond to all the active variable names for a Variable group. The variable names present in var_names after this function is called will correspond to those variables. Note that var_names is NOT const. This is because one of the behaviors of subclasses may be to remove variables from the list. For example, for some symmetry conditions, we only want to enforce zero on certain components of the solution while leaving others untouched.

Implemented in GRINSTesting::SATurbNuBCFactory, GRINSTesting::SATurbUBCFactory, GRINS::ConstantFunctionDirichletBCFactory, GRINS::ParsedFunctionDirichletBCFactory< FunctionType >, GRINS::ParsedFunctionDirichletBCFactory< libMesh::FEMFunctionBase< libMesh::Number > >, GRINS::ParsedFunctionDirichletBCFactory< libMesh::FunctionBase< libMesh::Number > >, GRINS::SymmetryTypeBCFactories, GRINS::ParsedFunctionDirichletOldStyleBCFactory< FunctionType >, GRINS::PrescribedVectorValueDirichletOldStyleBCFactory, GRINS::ParsedFunctionDirichletOldStyleBCFactory< libMesh::FEMFunctionBase< libMesh::Number > >, GRINS::ParsedFunctionDirichletOldStyleBCFactory< libMesh::FunctionBase< libMesh::Number > >, GRINS::HomogeneousDirichletBCFactory, and GRINS::IsothermalDirichletOldStyleBCFactory.

template<typename FunctionType >
libMesh::UniquePtr< libMesh::DirichletBoundary > GRINS::DirichletBCFactoryFunctionBase< FunctionType >::create ( )
privatevirtual

Subclasses implement the actual construction of the Base object in create().

Implements GRINS::FactoryAbstract< libMesh::DirichletBoundary >.

Definition at line 35 of file dirichlet_bc_factory_function_base.C.

36  {
37  // Make sure all necessary state has been setup
38  this->check_state();
39 
40  // We need to make a copy of var_names because subclasses may
41  // modify what variable names are present to allow the boundary
42  // condition factory implementation to apply only a subset of the
43  // variables.
44  std::vector<std::string> local_var_names = this->get_var_names();
45 
46  libMesh::UniquePtr<FunctionType>
47  func = this->build_func( *(this->_input), *(this->_system),
48  local_var_names, this->_section );
49 
50  libmesh_assert(func);
51 
52  std::vector<VariableIndex> local_var_indices;
53  this->build_var_indices(*(this->_system), local_var_names, local_var_indices);
54 
55  libMesh::UniquePtr<libMesh::DirichletBoundary> new_dbc =
56  this->make_dirichlet_boundary( *(this->_bc_ids), *(this->_system),
57  func, local_var_indices );
58 
59  // Reset state for error checking during next construction
60  this->reset_state();
61 
62  return new_dbc;
63  }
virtual void reset_state()
Helper function to redue code duplication.
libMesh::UniquePtr< libMesh::DirichletBoundary > make_dirichlet_boundary(const std::set< BoundaryID > &bc_ids, const libMesh::System &system, libMesh::UniquePtr< FunctionType > &func, const std::vector< VariableIndex > &var_indices)
Dispatch, based on FunctionType, to the correct DirchletBoundary construction.
static const std::set< BoundaryID > * _bc_ids
BoundaryID for constructing a particular boundary condition.
virtual libMesh::UniquePtr< FunctionType > build_func(const GetPot &input, MultiphysicsSystem &system, std::vector< std::string > &var_names, const std::string &section)=0
Builds the FunctionBase object for boundary condition.
static const GetPot * _input
We store only a raw pointer here because we can't make a copy.
virtual const std::vector< std::string > & get_var_names() const
Helper function that can be overridded in subclasses.
virtual void check_state() const
Helper function to reduce code duplication.
void build_var_indices(const MultiphysicsSystem &system, const std::vector< std::string > &var_names, std::vector< VariableIndex > &var_indices) const
static MultiphysicsSystem * _system
We store only a raw pointer here because we can't make a copy.
template<typename FunctionType>
virtual const std::vector<std::string>& GRINS::DirichletBCFactoryFunctionBase< FunctionType >::get_var_names ( ) const
inlineprotectedvirtual

Helper function that can be overridded in subclasses.

Mainly for backward compatibility with OldStyle parsing.

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

Definition at line 78 of file dirichlet_bc_factory_function_base.h.

79  { return this->_fe_var->active_var_names(); }
const std::vector< std::string > & active_var_names() const
Return the var names that are active from this class.
static const FEVariablesBase * _fe_var
The FEVariablesBase class associated with the boundary condition being built.
template<>
libMesh::UniquePtr< libMesh::DirichletBoundary > GRINS::DirichletBCFactoryFunctionBase< libMesh::FunctionBase< libMesh::Number > >::make_dirichlet_boundary ( const std::set< BoundaryID > &  bc_ids,
const libMesh::System &  ,
libMesh::UniquePtr< libMesh::FunctionBase< libMesh::Number > > &  func,
const std::vector< VariableIndex > &  var_indices 
)
protected

Definition at line 68 of file dirichlet_bc_factory_function_base.C.

72  {
73  return libMesh::UniquePtr<libMesh::DirichletBoundary>(new libMesh::DirichletBoundary(bc_ids, var_indices, func.get()));
74  }
template<typename FunctionType>
libMesh::UniquePtr<libMesh::DirichletBoundary> GRINS::DirichletBCFactoryFunctionBase< FunctionType >::make_dirichlet_boundary ( const std::set< BoundaryID > &  bc_ids,
const libMesh::System &  system,
libMesh::UniquePtr< FunctionType > &  func,
const std::vector< VariableIndex > &  var_indices 
)
protected

Dispatch, based on FunctionType, to the correct DirchletBoundary construction.

template<>
libMesh::UniquePtr< libMesh::DirichletBoundary > GRINS::DirichletBCFactoryFunctionBase< libMesh::FEMFunctionBase< libMesh::Number > >::make_dirichlet_boundary ( const std::set< BoundaryID > &  bc_ids,
const libMesh::System &  system,
libMesh::UniquePtr< libMesh::FEMFunctionBase< libMesh::Number > > &  func,
const std::vector< VariableIndex > &  var_indices 
)
protected

Definition at line 79 of file dirichlet_bc_factory_function_base.C.

83  {
84  return libMesh::UniquePtr<libMesh::DirichletBoundary>( new libMesh::DirichletBoundary(bc_ids, var_indices, system, func.get()) );
85  }

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

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