GRINS-0.8.0
List of all members | Public Member Functions | Protected Member Functions
GRINS::PrescribedVectorValueDirichletOldStyleBCFactory Class Referenceabstract

#include <prescribed_vector_value_dirichlet_old_style_bc_factory.h>

Inheritance diagram for GRINS::PrescribedVectorValueDirichletOldStyleBCFactory:
Inheritance graph
[legend]
Collaboration diagram for GRINS::PrescribedVectorValueDirichletOldStyleBCFactory:
Collaboration graph
[legend]

Public Member Functions

 PrescribedVectorValueDirichletOldStyleBCFactory (const std::string &bc_type_name)
 
 ~PrescribedVectorValueDirichletOldStyleBCFactory ()
 
- Public Member Functions inherited from GRINS::DirichletBCFactoryFunctionOldStyleBase< libMesh::FunctionBase< libMesh::Number > >
 DirichletBCFactoryFunctionOldStyleBase (const std::string &bc_type_name)
 
 ~DirichletBCFactoryFunctionOldStyleBase ()
 
- Public Member Functions inherited from GRINS::DirichletBCFactoryFunctionBase< libMesh::FunctionBase< libMesh::Number > >
 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 std::string var_input_string ()=0
 
virtual libMesh::UniquePtr< libMesh::FunctionBase< libMesh::Number > > build_func (const GetPot &input, MultiphysicsSystem &system, std::vector< std::string > &var_names, const std::string &section)
 Builds the FunctionBase object for boundary condition. More...
 
virtual void add_funcs (const GetPot &input, MultiphysicsSystem &system, const std::string &input_string, const std::vector< std::string > &var_names, libMesh::CompositeFunction< libMesh::Number > &composite_func) const
 
- Protected Member Functions inherited from GRINS::DirichletBCFactoryFunctionOldStyleBase< libMesh::FunctionBase< libMesh::Number > >
virtual void check_state () const
 Helper function. More...
 
virtual void reset_state ()
 Helper function. More...
 
virtual const std::vector< std::string > & get_var_names () const
 Helper function that can be overridded in subclasses. More...
 
- Protected Member Functions inherited from GRINS::DirichletBCFactoryFunctionBase< libMesh::FunctionBase< libMesh::Number > >
libMesh::UniquePtr< libMesh::DirichletBoundary > make_dirichlet_boundary (const std::set< BoundaryID > &bc_ids, const libMesh::System &system, libMesh::UniquePtr< libMesh::FunctionBase< libMesh::Number > > &func, const std::vector< VariableIndex > &var_indices)
 Dispatch, based on FunctionType, to the correct DirchletBoundary construction. More...
 
- 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
 
- 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...
 

Additional Inherited Members

- Static Public Member Functions inherited from GRINS::DirichletBCFactoryFunctionOldStyleBase< libMesh::FunctionBase< libMesh::Number > >
static void set_value_var_old_style (const std::string &value_var)
 Input variable for parsing old style. More...
 
static void set_value_index_old_style (unsigned int idx)
 Input variable index for parsing old style. More...
 
static void set_var_names_old_style (const std::vector< std::string > &var_names)
 
- 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::DirichletBCFactoryFunctionOldStyleBase< libMesh::FunctionBase< libMesh::Number > >
static std::string _value_var_old_style
 
static unsigned int _value_idx_old_style
 
static const std::vector< std::string > * _var_names_old_style
 
- 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

Definition at line 36 of file prescribed_vector_value_dirichlet_old_style_bc_factory.h.

Constructor & Destructor Documentation

GRINS::PrescribedVectorValueDirichletOldStyleBCFactory::PrescribedVectorValueDirichletOldStyleBCFactory ( const std::string &  bc_type_name)
inline

Definition at line 40 of file prescribed_vector_value_dirichlet_old_style_bc_factory.h.

41  : DirichletBCFactoryFunctionOldStyleBase<libMesh::FunctionBase<libMesh::Number> >(bc_type_name)
42  {}
GRINS::PrescribedVectorValueDirichletOldStyleBCFactory::~PrescribedVectorValueDirichletOldStyleBCFactory ( )
inline

Definition at line 44 of file prescribed_vector_value_dirichlet_old_style_bc_factory.h.

44 {};

Member Function Documentation

void GRINS::PrescribedVectorValueDirichletOldStyleBCFactory::add_funcs ( const GetPot &  input,
MultiphysicsSystem system,
const std::string &  input_string,
const std::vector< std::string > &  var_names,
libMesh::CompositeFunction< libMesh::Number > &  composite_func 
) const
protectedvirtual

Reimplemented in GRINS::PrescribedMoleFractionsDirichletOldStyleBCFactory.

Definition at line 77 of file prescribed_vector_value_dirichlet_old_style_bc_factory.C.

Referenced by build_func().

82  {
83  for( unsigned int n = 0; n < var_names.size(); n++ )
84  {
85  std::vector<VariableIndex> dbc_vars(1,system.variable_number(var_names[n]));
86  libMesh::Number value = input(input_string, 0.0, n);
87  libMesh::ConstFunction<libMesh::Number> const_func(value);
88  composite_func.attach_subfunction(const_func, dbc_vars);
89  }
90  }
libMesh::UniquePtr< libMesh::FunctionBase< libMesh::Number > > GRINS::PrescribedVectorValueDirichletOldStyleBCFactory::build_func ( const GetPot &  input,
MultiphysicsSystem system,
std::vector< std::string > &  var_names,
const std::string &  section 
)
protectedvirtual

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.

Implements GRINS::DirichletBCFactoryFunctionBase< libMesh::FunctionBase< libMesh::Number > >.

Definition at line 51 of file prescribed_vector_value_dirichlet_old_style_bc_factory.C.

References GRINS::BCFactoryAbstract< libMesh::DirichletBoundary >::_bc_ids, add_funcs(), and var_input_string().

55  {
56  libmesh_assert_equal_to(DirichletBCFactoryAbstract::_bc_ids->size(), 1 );
57 
58  std::string bc_id_string = StringUtilities::T_to_string<BoundaryID>( *(_bc_ids->begin()) );
59 
60  std::string var_input_string = this->var_input_string();
61 
62  std::string input_string = section+"/"+var_input_string+"_"+bc_id_string;
63 
64  unsigned int n_comps = input.vector_variable_size(input_string);
65 
66  if( var_names.size() > n_comps )
67  libmesh_error_msg("ERROR: Insufficient number of variable components in "+input_string+"!");
68 
69  libMesh::UniquePtr<libMesh::CompositeFunction<libMesh::Number> >
71 
72  this->add_funcs(input,system,input_string,var_names,*(remapped_func.get()));
73 
74  return libMesh::UniquePtr<libMesh::FunctionBase<libMesh::Number> >(remapped_func.release());
75  }
virtual void add_funcs(const GetPot &input, MultiphysicsSystem &system, const std::string &input_string, const std::vector< std::string > &var_names, libMesh::CompositeFunction< libMesh::Number > &composite_func) const
static const std::set< BoundaryID > * _bc_ids
BoundaryID for constructing a particular boundary condition.
virtual std::string GRINS::PrescribedVectorValueDirichletOldStyleBCFactory::var_input_string ( )
protectedpure virtual

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

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