GRINS-0.7.0
List of all members | Public Member Functions | Protected Member Functions
GRINS::DirichletBCFactoryAbstract Class Reference

#include <dirichlet_bc_factory_abstract.h>

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

Public Member Functions

 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 ()
 

Protected Member Functions

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...
 

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 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 dirichlet_bc_factory_abstract.h.

Constructor & Destructor Documentation

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

Definition at line 39 of file dirichlet_bc_factory_abstract.h.

40  : BCFactoryAbstract<libMesh::DirichletBoundary>(bc_type_name)
41  {}
GRINS::DirichletBCFactoryAbstract::~DirichletBCFactoryAbstract ( )
inline

Definition at line 43 of file dirichlet_bc_factory_abstract.h.

43 {};

Member Function Documentation

void GRINS::DirichletBCFactoryAbstract::check_for_vars ( const GetPot &  input,
const std::string &  section,
const std::vector< std::string > &  var_names,
std::set< std::string > *  vars_found = NULL 
)
protected

Helper function.

This will search the given section to make sure at least one of the var names as been set. An error will be thrown if no vars were found to be set. Those vars that have been set in the input file are returned in the vars_found variable, if vars_found is not NULL.

Definition at line 58 of file dirichlet_bc_factory_abstract.C.

Referenced by GRINS::ConstantFunctionDirichletBCFactory::build_func().

61  {
62  if( vars_found )
63  vars_found->clear();
64 
65  bool found_var = false;
66 
67  for( std::vector<std::string>::const_iterator name = var_names.begin();
68  name < var_names.end(); ++name )
69  {
70  if( input.have_variable( section+"/"+(*name) ) )
71  {
72  found_var = true;
73 
74  if( vars_found )
75  vars_found->insert( (*name) );
76  }
77  }
78 
79  // If no variables were found to be set, error out printing
80  // the section and the variable names we were looking for.
81  if( !found_var )
82  {
83  std::string err_msg = "ERROR: Could find any active variable assigned a Dirichlet boundary value\n";
84  err_msg += " in section "+section+". Active variables are:\n";
85 
86  for( std::vector<std::string>::const_iterator name = var_names.begin();
87  name < var_names.end(); ++name )
88  err_msg += " "+(*name)+"\n";
89 
90  libmesh_error_msg(err_msg);
91  }
92 
93  if( vars_found )
94  libmesh_assert(!vars_found->empty());
95  }

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

Generated on Thu Jun 2 2016 21:52:30 for GRINS-0.7.0 by  doxygen 1.8.10