GRINS-0.6.0
Public Member Functions | Protected Attributes | List of all members
GRINS::NBCContainer Class Reference

Simple helper class to setup general Neumann boundary conditions. More...

#include <nbc_container.h>

Public Member Functions

 NBCContainer ()
 
 ~NBCContainer ()
 
void set_bc_id (BoundaryID bc_id)
 Add variable for which this boundary condition is to be applied. More...
 
void add_var_func_pair (VariableIndex var, std::tr1::shared_ptr< NeumannFuncObj > func)
 Add boundary id and corresponding functor object to be applied on that boundary. More...
 
BoundaryID get_bc_id () const
 
std::tr1::shared_ptr< NeumannFuncObjget_func (VariableIndex var) const
 

Protected Attributes

BoundaryID _bc_id
 
std::map< VariableIndex, std::tr1::shared_ptr< NeumannFuncObj > > _funcs
 

Detailed Description

Simple helper class to setup general Neumann boundary conditions.

This class is to temporarily stash data necessary for setting up GRINS::NeumannFuncObj objects. Actual instantiation of GRINS::NeumannFuncObj object is handled internally by BCHandling objects. This class is structured on a per-bc ID basis. That is, each object works handles functions for one boundary ID at a time, but can handle multiple variable/function pairs. Currently, it is assumed one function per variable.

Definition at line 41 of file nbc_container.h.

Constructor & Destructor Documentation

GRINS::NBCContainer::NBCContainer ( )

Definition at line 30 of file nbc_container.C.

31  {
32  return;
33  }
GRINS::NBCContainer::~NBCContainer ( )

Definition at line 35 of file nbc_container.C.

36  {
37  return;
38  }

Member Function Documentation

void GRINS::NBCContainer::add_var_func_pair ( VariableIndex  var,
std::tr1::shared_ptr< NeumannFuncObj func 
)

Add boundary id and corresponding functor object to be applied on that boundary.

Definition at line 51 of file nbc_container.C.

References _funcs.

Referenced by GRINS::ThermallyDrivenFlowTestBCFactory::build_neumann().

53  {
54  if( _funcs.find(var) != _funcs.end() )
55  {
56  std::cerr << "Error: Can only specify one function per variable" << std::endl;
57  libmesh_error();
58  }
59 
60  _funcs.insert( std::make_pair( var, func ) );
61  return;
62  }
std::map< VariableIndex, std::tr1::shared_ptr< NeumannFuncObj > > _funcs
Definition: nbc_container.h:61
BoundaryID GRINS::NBCContainer::get_bc_id ( ) const

Definition at line 46 of file nbc_container.C.

References _bc_id.

Referenced by GRINS::BCHandlingBase::attach_neumann_bound_func().

47  {
48  return _bc_id;
49  }
std::tr1::shared_ptr< NeumannFuncObj > GRINS::NBCContainer::get_func ( VariableIndex  var) const

Definition at line 64 of file nbc_container.C.

References _funcs.

65  {
66  libmesh_assert( _funcs.find(var) != _funcs.end() );
67  return _funcs.find(var)->second;
68  }
std::map< VariableIndex, std::tr1::shared_ptr< NeumannFuncObj > > _funcs
Definition: nbc_container.h:61
void GRINS::NBCContainer::set_bc_id ( BoundaryID  bc_id)

Add variable for which this boundary condition is to be applied.

Definition at line 40 of file nbc_container.C.

References _bc_id.

Referenced by GRINS::ThermallyDrivenFlowTestBCFactory::build_neumann().

41  {
42  _bc_id = bc_id;
43  return;
44  }

Member Data Documentation

BoundaryID GRINS::NBCContainer::_bc_id
protected

Definition at line 60 of file nbc_container.h.

Referenced by get_bc_id(), and set_bc_id().

std::map<VariableIndex,std::tr1::shared_ptr<NeumannFuncObj> > GRINS::NBCContainer::_funcs
protected

Definition at line 61 of file nbc_container.h.

Referenced by add_var_func_pair(), and get_func().


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

Generated on Mon Jun 22 2015 21:32:23 for GRINS-0.6.0 by  doxygen 1.8.9.1