GRINS-0.8.0
List of all members | Public Member Functions | Protected Member Functions
GRINS::ParsedFunctionNeumannBCFactoryHelper< FunctionType > Class Template Reference

#include <parsed_function_neumann_bc_factory_helper.h>

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

Public Member Functions

 ParsedFunctionNeumannBCFactoryHelper ()
 
 ~ParsedFunctionNeumannBCFactoryHelper ()
 

Protected Member Functions

SharedPtr< NeumannBCAbstractbuild_neumman_func_common (const GetPot &input, MultiphysicsSystem &system, const FEVariablesBase &fe_var, const std::string &flux_input)
 Helper function containing common code. More...
 
SharedPtr< NeumannBCAbstractbuild_parsed_neumann_func (MultiphysicsSystem &system, const std::string &expression, VariableIndex var_idx)
 Helper function that builds the right BC object depending on the FunctionType. More...
 
SharedPtr< NeumannBCAbstractbuild_composite_parsed_neumann_func (MultiphysicsSystem &system, const std::vector< std::string > &expressions, const std::vector< VariableIndex > &var_indices)
 Helper function that builds the right CompositeBC object depending on the FunctionType. More...
 
template<>
SharedPtr< NeumannBCAbstractbuild_parsed_neumann_func (MultiphysicsSystem &, const std::string &expression, VariableIndex var_idx)
 
template<>
SharedPtr< NeumannBCAbstractbuild_parsed_neumann_func (MultiphysicsSystem &system, const std::string &expression, VariableIndex var_idx)
 
template<>
SharedPtr< NeumannBCAbstractbuild_composite_parsed_neumann_func (MultiphysicsSystem &, const std::vector< std::string > &expressions, const std::vector< VariableIndex > &var_indices)
 
template<>
SharedPtr< NeumannBCAbstractbuild_composite_parsed_neumann_func (MultiphysicsSystem &system, const std::vector< std::string > &expressions, const std::vector< VariableIndex > &var_indices)
 

Detailed Description

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

Definition at line 48 of file parsed_function_neumann_bc_factory_helper.h.

Constructor & Destructor Documentation

template<typename FunctionType >
GRINS::ParsedFunctionNeumannBCFactoryHelper< FunctionType >::ParsedFunctionNeumannBCFactoryHelper ( )
inline

Definition at line 52 of file parsed_function_neumann_bc_factory_helper.h.

52 {};
template<typename FunctionType >
GRINS::ParsedFunctionNeumannBCFactoryHelper< FunctionType >::~ParsedFunctionNeumannBCFactoryHelper ( )
inline

Definition at line 54 of file parsed_function_neumann_bc_factory_helper.h.

54 {};

Member Function Documentation

template<typename FunctionType >
SharedPtr<NeumannBCAbstract> GRINS::ParsedFunctionNeumannBCFactoryHelper< FunctionType >::build_composite_parsed_neumann_func ( MultiphysicsSystem system,
const std::vector< std::string > &  expressions,
const std::vector< VariableIndex > &  var_indices 
)
protected

Helper function that builds the right CompositeBC object depending on the FunctionType.

template<>
SharedPtr< NeumannBCAbstract > GRINS::ParsedFunctionNeumannBCFactoryHelper< libMesh::FunctionBase< libMesh::Number > >::build_composite_parsed_neumann_func ( MultiphysicsSystem ,
const std::vector< std::string > &  expressions,
const std::vector< VariableIndex > &  var_indices 
)
protected

Definition at line 91 of file parsed_function_neumann_bc_factory_helper.C.

93  {
94  return SharedPtr<NeumannBCAbstract>( new CompositeParsedNeumannBC<libMesh::Number>(expressions,var_indices) );
95  }
template<>
SharedPtr< NeumannBCAbstract > GRINS::ParsedFunctionNeumannBCFactoryHelper< libMesh::FEMFunctionBase< libMesh::Number > >::build_composite_parsed_neumann_func ( MultiphysicsSystem system,
const std::vector< std::string > &  expressions,
const std::vector< VariableIndex > &  var_indices 
)
protected

Definition at line 100 of file parsed_function_neumann_bc_factory_helper.C.

102  {
103  return SharedPtr<NeumannBCAbstract>( new CompositeParsedFEMNeumannBC<libMesh::Number>(expressions,var_indices,system) );
104  }
template<typename FunctionType >
SharedPtr< NeumannBCAbstract > GRINS::ParsedFunctionNeumannBCFactoryHelper< FunctionType >::build_neumman_func_common ( const GetPot &  input,
MultiphysicsSystem system,
const FEVariablesBase fe_var,
const std::string &  flux_input 
)
protected

Helper function containing common code.

This way, it's easy to add a new flux variable name to be parsed from input.

Definition at line 38 of file parsed_function_neumann_bc_factory_helper.C.

References GRINS::FEVariablesBase::active_var_names(), and GRINS::FEVariablesBase::var_indices().

Referenced by GRINS::ParsedFunctionNeumannBCFactory< FunctionType >::build_neumann_func().

42  {
43  const std::vector<std::string>& var_names = fe_var.active_var_names();
44 
45  SharedPtr<NeumannBCAbstract> func;
46 
47  // Use "standard" parsed version if there's only one variable
48  if( var_names.size() == 1 )
49  {
50  libmesh_assert_equal_to( fe_var.var_indices().size(), 1 );
51  std::string expression = input(flux_input,std::string("DIE!"));
52  func = this->build_parsed_neumann_func(system,expression,fe_var.var_indices()[0]);
53  }
54  // Otherwise, use the composite versions
55  else
56  {
57  libmesh_assert_equal_to( fe_var.var_indices().size(), var_names.size() );
58 
59  // We already checked size consistency for flux input and var_names
60  // so just use var_names for the size
61  std::vector<std::string> expressions(var_names.size());
62 
63  for( unsigned int i = 0; i < var_names.size(); i++ )
64  expressions[i] = input(flux_input,std::string("DIE!"),i);
65 
66  func = this->build_composite_parsed_neumann_func(system,expressions,fe_var.var_indices());
67  }
68 
69  return func;
70  }
SharedPtr< NeumannBCAbstract > build_composite_parsed_neumann_func(MultiphysicsSystem &system, const std::vector< std::string > &expressions, const std::vector< VariableIndex > &var_indices)
Helper function that builds the right CompositeBC object depending on the FunctionType.
SharedPtr< NeumannBCAbstract > build_parsed_neumann_func(MultiphysicsSystem &system, const std::string &expression, VariableIndex var_idx)
Helper function that builds the right BC object depending on the FunctionType.
template<typename FunctionType >
SharedPtr<NeumannBCAbstract> GRINS::ParsedFunctionNeumannBCFactoryHelper< FunctionType >::build_parsed_neumann_func ( MultiphysicsSystem system,
const std::string &  expression,
VariableIndex  var_idx 
)
protected

Helper function that builds the right BC object depending on the FunctionType.

template<>
SharedPtr< NeumannBCAbstract > GRINS::ParsedFunctionNeumannBCFactoryHelper< libMesh::FunctionBase< libMesh::Number > >::build_parsed_neumann_func ( MultiphysicsSystem ,
const std::string &  expression,
VariableIndex  var_idx 
)
protected

Definition at line 75 of file parsed_function_neumann_bc_factory_helper.C.

76  {
77  return SharedPtr<NeumannBCAbstract>( new ParsedNeumannBC<libMesh::Number>(expression,var_idx) );
78  }
template<>
SharedPtr< NeumannBCAbstract > GRINS::ParsedFunctionNeumannBCFactoryHelper< libMesh::FEMFunctionBase< libMesh::Number > >::build_parsed_neumann_func ( MultiphysicsSystem system,
const std::string &  expression,
VariableIndex  var_idx 
)
protected

Definition at line 83 of file parsed_function_neumann_bc_factory_helper.C.

84  {
85  return SharedPtr<NeumannBCAbstract>( new ParsedFEMNeumannBC<libMesh::Number>(expression,system,var_idx) );
86  }

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

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