OpenFCST: The open-source Fuel Cell Simulation Toolbox
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members
FuelCellShop::Layer::BaseLayer< dim > Class Template Reference

Virtual class used to characterize a generic layer interface. More...

#include <base_layer.h>

Inheritance diagram for FuelCellShop::Layer::BaseLayer< dim >:
Inheritance graph
[legend]
Collaboration diagram for FuelCellShop::Layer::BaseLayer< dim >:
Collaboration graph
[legend]

Public Member Functions

Initialization
virtual void set_derivative_flags (const std::vector< VariableNames > &flags)
 Set the variables for which you would like to compute the derivatives. More...
 
void set_position (const std::vector< Point< dim > > &p)
 Member function used by some applications such as dummyGDL in order to know which value to return. More...
 
virtual void set_local_material_id (const unsigned int &id)
 Function for setting local material id, for unit testing purposes. More...
 
void unset_local_material_id ()
 Function for unsetting local material id, so that it isn't incorrectly used later Once the key is "unset" to some invalid value, an error will be thrown if the key is requested again without being set. More...
 
virtual void set_constant_solution (const double &value, const VariableNames &name)
 Set those solution variables which are constant in the particular application. More...
 
virtual void set_solution (const std::vector< SolutionVariable > &)
 If the effective properties in the layer depend on the solution, the solution for a given cell should be passed to the class using this member function. More...
 
Accessors and info
bool belongs_to_material (const unsigned int material_id)
 Check if a given cell belongs to the catalyst layer and assign. More...
 
const std::string & name_layer () const
 Return the name of the layer. More...
 
virtual const std::type_info & get_base_type () const
 This member function return the name of the type of layer, i.e. More...
 
virtual void print_layer_properties () const
 This member function is a virtual class that can be used to output to screen information from the layer. More...
 
virtual bool test_layer ()
 This virtual class should be used for any derived class to be able to test the functionality of the class. More...
 
std::vector< unsigned int > get_material_ids ()
 Return the local material id of the layer. More...
 
unsigned int local_material_id () const
 Return the local material id of the layer, performs a check. More...
 

Protected Member Functions

Constructors, destructor, and initalization
 BaseLayer ()
 Constructor. More...
 
 BaseLayer (const std::string &name)
 Constructor. More...
 
virtual ~BaseLayer ()
 Destructor. More...
 
virtual void declare_parameters (const std::string &object_name, ParameterHandler &param) const
 Declare parameters for a parameter file. More...
 
virtual void declare_parameters (ParameterHandler &param) const
 Declare parameters for a parameter file. More...
 
virtual void set_parameters (const std::string &object_name, const std::vector< std::string > &name_dvar, const std::vector< double > &value_dvar, ParameterHandler &param)
 Member function used to change the values in the parameter file for a given list of parameters. More...
 
virtual void set_parameters (const std::vector< std::string > &name_dvar, const std::vector< double > &value_dvar, ParameterHandler &param)
 Set parameters in parameter file. More...
 
virtual void initialize (ParameterHandler &param)
 Member function used to read in data and initialize the necessary data to compute the coefficients. More...
 

Basic layer information

const std::string name
 Name of the layer. More...
 
std::vector< unsigned int > material_ids
 List of material IDs that belong to the layer. More...
 
std::vector< Point< dim > > point
 Coordinates of the point where we would like to compute the effective properties. More...
 
std::vector< VariableNamesderivative_flags
 Flags for derivatives: These flags are used to request derivatives. More...
 
std::map< VariableNames, double > constant_solutions
 Map storing values of solution variables constant in a particular application. More...
 
unsigned int local_material_id_
 Local material ID to select the appropriate properties. More...
 

Detailed Description

template<int dim>
class FuelCellShop::Layer::BaseLayer< dim >

Virtual class used to characterize a generic layer interface.

Note that his class does not contain enough information to characterize any useful layer yet. Please see children.

The base layer is used to store an identification number for the layer and the geometry of the layer.

Author
M. Secanell
M. Bhaiya
V. Zingan

Constructor & Destructor Documentation

template<int dim>
FuelCellShop::Layer::BaseLayer< dim >::BaseLayer ( )
inlineprotected

Constructor.

Warning
For internal use only
template<int dim>
FuelCellShop::Layer::BaseLayer< dim >::BaseLayer ( const std::string &  name)
protected

Constructor.

template<int dim>
virtual FuelCellShop::Layer::BaseLayer< dim >::~BaseLayer ( )
protectedvirtual

Destructor.

Member Function Documentation

template<int dim>
bool FuelCellShop::Layer::BaseLayer< dim >::belongs_to_material ( const unsigned int  material_id)

Check if a given cell belongs to the catalyst layer and assign.

Parameters
material_idto current_local_material_id_ of layers that are graded.
template<int dim>
virtual void FuelCellShop::Layer::BaseLayer< dim >::declare_parameters ( const std::string &  object_name,
ParameterHandler &  param 
) const
inlineprotectedvirtual
template<int dim>
virtual void FuelCellShop::Layer::BaseLayer< dim >::declare_parameters ( ParameterHandler &  param) const
inlineprotectedvirtual
template<int dim>
virtual const std::type_info& FuelCellShop::Layer::BaseLayer< dim >::get_base_type ( ) const
inlinevirtual

This member function return the name of the type of layer, i.e.

Note that this is necessary if we want to find out not the name of the actual class which can be obtain using

const std::type_info& name = typeid(*this)

but the name of the parent class.

Note
Do not implement this class anywhere other than the following "base" classes:

Reimplemented in FuelCellShop::Layer::CatalystLayer< dim >, FuelCellShop::Layer::ExperimentalPorousLayer< dim >, FuelCellShop::Layer::GasDiffusionLayer< dim >, FuelCellShop::Layer::MicroPorousLayer< dim >, FuelCellShop::Layer::MembraneLayer< dim >, FuelCellShop::Layer::SolidLayer< dim >, and FuelCellShop::Layer::Channel< dim >.

References FcstUtilities::log.

Referenced by FuelCellShop::PostProcessing::WaterSorptionResponse< dim >::compute_responses().

Here is the caller graph for this function:

template<int dim>
std::vector<unsigned int> FuelCellShop::Layer::BaseLayer< dim >::get_material_ids ( )
inline

Return the local material id of the layer.

template<int dim>
virtual void FuelCellShop::Layer::BaseLayer< dim >::initialize ( ParameterHandler &  param)
protectedvirtual
template<int dim>
unsigned int FuelCellShop::Layer::BaseLayer< dim >::local_material_id ( ) const
inline

Return the local material id of the layer, performs a check.

Referenced by FuelCellShop::Layer::DummyCL< dim >::get_active_area_Pt(), and FuelCellShop::Layer::MultiScaleCL< deal_II_dimension >::get_properties().

Here is the caller graph for this function:

template<int dim>
const std::string& FuelCellShop::Layer::BaseLayer< dim >::name_layer ( ) const
inline

Return the name of the layer.

template<int dim>
virtual void FuelCellShop::Layer::BaseLayer< dim >::print_layer_properties ( ) const
virtual

This member function is a virtual class that can be used to output to screen information from the layer.

This function should be re-implemented in each layer with data that is relevant in each case.

Reimplemented in FuelCellShop::Layer::PorousLayer< dim >, FuelCellShop::Layer::ExperimentalPorousLayer< dim >, FuelCellShop::Layer::Channel< dim >, FuelCellShop::Layer::MultiScaleCL< dim >, FuelCellShop::Layer::MultiScaleCL< deal_II_dimension >, and FuelCellShop::Layer::ConventionalCL< dim >.

template<int dim>
virtual void FuelCellShop::Layer::BaseLayer< dim >::set_constant_solution ( const double &  value,
const VariableNames name 
)
inlinevirtual

Set those solution variables which are constant in the particular application.

If the effective properties in the layer depend on other variables that are usually part of the solution vector but are assumed to be constant in this simulation, the const solution value should be passed to the class using this member function. This method should be called in the initialization section of the application. This function takes value to be set as the first argument and the VariableNames as second argument. For instance, it's required to store constant temperature value for an isothermal application, in that case this method can be used. e.g., in order to set temperature as 353.0 [Kelvin] in the layer, you can use the following code:

* // In the initialization section of the application.
* layer.set_constant_solution(353.0, VariableNames::temperature_of_REV);
*

Reimplemented in FuelCellShop::Layer::MembraneLayer< dim >, and FuelCellShop::Layer::CatalystLayer< dim >.

Referenced by FuelCellShop::Layer::CatalystLayer< dim >::set_constant_solution(), and FuelCellShop::Layer::MembraneLayer< dim >::set_constant_solution().

Here is the caller graph for this function:

template<int dim>
virtual void FuelCellShop::Layer::BaseLayer< dim >::set_derivative_flags ( const std::vector< VariableNames > &  flags)
inlinevirtual

Set the variables for which you would like to compute the derivatives.

It takes a vector of VariableNames as an input argument.

Reimplemented in FuelCellShop::Layer::CatalystLayer< dim >, and FuelCellShop::Layer::MembraneLayer< dim >.

template<int dim>
virtual void FuelCellShop::Layer::BaseLayer< dim >::set_local_material_id ( const unsigned int &  id)
inlinevirtual

Function for setting local material id, for unit testing purposes.

Reimplemented in FuelCellShop::Layer::ConventionalCL< dim >.

Referenced by FuelCellShop::Layer::ConventionalCL< dim >::set_local_material_id().

Here is the caller graph for this function:

template<int dim>
virtual void FuelCellShop::Layer::BaseLayer< dim >::set_parameters ( const std::string &  object_name,
const std::vector< std::string > &  name_dvar,
const std::vector< double > &  value_dvar,
ParameterHandler &  param 
)
inlineprotectedvirtual

Member function used to change the values in the parameter file for a given list of parameters.

  • name_param should ideally contain the string as it would appear in the input file, i.e. "Thickness of the agglomerate radius"
  • value_param contains the value that the variable should be set at
  • param is the ParameterHandler that contains all the information that has been read from file

Note that this is a static function, therefore it requires as the first argument the string with the name of the section you would like to create for the object of this class.

template<int dim>
virtual void FuelCellShop::Layer::BaseLayer< dim >::set_parameters ( const std::vector< std::string > &  name_dvar,
const std::vector< double > &  value_dvar,
ParameterHandler &  param 
)
inlineprotectedvirtual

Set parameters in parameter file.

Deprecated:
Cannot be used if using layer_generator.h

Reimplemented in FuelCellShop::Layer::DesignMPL< dim >.

template<int dim>
void FuelCellShop::Layer::BaseLayer< dim >::set_position ( const std::vector< Point< dim > > &  p)
inline

Member function used by some applications such as dummyGDL in order to know which value to return.

For other classes this class is not used.

template<int dim>
virtual void FuelCellShop::Layer::BaseLayer< dim >::set_solution ( const std::vector< SolutionVariable > &  )
inlinevirtual

If the effective properties in the layer depend on the solution, the solution for a given cell should be passed to the class using this member function.

It is used to set SolutionVariable structure inside the layer. This structure stores the solution variable values at all quadrature points in the cell. For sample usage details, please see documentation of FuelCellShop::SolutionVariable structure.

Note, this function in the base layer sets the interface. It has to be reimplemented in respective child layer classes for respective uses.

Note
Use only for solution variables.

Reimplemented in FuelCellShop::Layer::CatalystLayer< dim >.

References FcstUtilities::log.

template<int dim>
virtual bool FuelCellShop::Layer::BaseLayer< dim >::test_layer ( )
inlinevirtual

This virtual class should be used for any derived class to be able to test the functionality of the class.

References FcstUtilities::log.

template<int dim>
void FuelCellShop::Layer::BaseLayer< dim >::unset_local_material_id ( )
inline

Function for unsetting local material id, so that it isn't incorrectly used later Once the key is "unset" to some invalid value, an error will be thrown if the key is requested again without being set.

The programmer should be concious of which material id they are using the layer for, therfore the must always set it before using the layer. Manually unsetting the key is a good practise to ensure that you do not solve for the wrong layer id.

Member Data Documentation

template<int dim>
std::map< VariableNames, double > FuelCellShop::Layer::BaseLayer< dim >::constant_solutions
protected

Map storing values of solution variables constant in a particular application.

Referenced by FuelCellShop::Layer::MultiScaleCL< deal_II_dimension >::get_properties().

template<int dim>
std::vector<VariableNames> FuelCellShop::Layer::BaseLayer< dim >::derivative_flags
protected

Flags for derivatives: These flags are used to request derivatives.

Referenced by FuelCellShop::Layer::MembraneLayer< dim >::set_derivative_flags(), and FuelCellShop::Layer::CatalystLayer< dim >::set_derivative_flags().

template<int dim>
unsigned int FuelCellShop::Layer::BaseLayer< dim >::local_material_id_
private

Local material ID to select the appropriate properties.

This value is used in graded layers which within the given layer have several properties

This variable is private, it should be accessed by acessor local_material_id_() which performs debug checks

template<int dim>
std::vector<unsigned int> FuelCellShop::Layer::BaseLayer< dim >::material_ids
protected

List of material IDs that belong to the layer.

The parameter local_material_id_ is an integer in this list

template<int dim>
const std::string FuelCellShop::Layer::BaseLayer< dim >::name
protected
template<int dim>
std::vector<Point<dim> > FuelCellShop::Layer::BaseLayer< dim >::point
protected

Coordinates of the point where we would like to compute the effective properties.


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