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
FuelCell::SystemManagement Class Reference

IMPORTANT: Add all new solution variables and equations here ! More...

#include <system_management.h>

Inheritance diagram for FuelCell::SystemManagement:
Inheritance graph
[legend]
Collaboration diagram for FuelCell::SystemManagement:
Collaboration graph
[legend]

Public Member Functions

Constructors, destructor, and initialization
 SystemManagement ()
 Constructor assembling. More...
 
 SystemManagement (FuelCell::ApplicationCore::BlockInfo &block_info, Table< 2, DoFTools::Coupling > &cell_couplings, Table< 2, DoFTools::Coupling > &flux_couplings)
 Constructor assembling. More...
 
 ~SystemManagement ()
 Destructor. More...
 
void initialize (FuelCell::ApplicationCore::BlockInfo &rblock_info, Table< 2, DoFTools::Coupling > &rcell_couplings, Table< 2, DoFTools::Coupling > &rflux_couplings)
 This function assembles. More...
 
void declare_parameters (ParameterHandler &param) const
 Declare parameters. More...
 
void initialize (ParameterHandler &param)
 Initialize parameters. More...
 
Service functions
const std::string & get_VariableNames (const VariableNames value)
 
const bool solution_in_userlist (const std::string &name) const
 This function returns a boolean stating whether an available FCST solution variable with name name stored in solution_names. More...
 
const unsigned int solution_name_to_index (const std::string &name) const
 This function returns the index of a user defined solution variable with name name stored in solution_names. More...
 
const unsigned int equation_name_to_index (const std::string &name) const
 This function returns the index of a user defined solution variable with name name stored in solution_names. More...
 
const unsigned int matrix_block_index (const std::string &equation_name, const std::string &solution_name) const
 This function returns the index of a system matrix block based on. More...
 
bool matrix_block_index_exists (const std::string &equation_name, const std::string &solution_name) const
 Check if, based on cell_couplings, this block must be assembled. More...
 
void make_cell_couplings (const std::vector< couplings_map > &src)
 This function fills out the* cell_couplings object based on the information drawn from the actual equation classes in use. More...
 
void make_flux_couplings (const std::vector< couplings_map > &src)
 This function fills out the flux_couplings (DG FEM only) object based on the information drawn from the actual equation classes in use. More...
 
Accessors and info
const std::vector< std::string > & get_all_solution_names () const
 This function returns all_solution_names. More...
 
const std::vector< std::string > & get_all_equation_names () const
 This function returns all_equation_names. More...
 
const std::vector< std::string > & get_solution_names () const
 This function returns solution_names. More...
 
const std::vector< std::string > & get_equation_names () const
 This function returns equation_names. More...
 
const unsigned int & get_number_of_solution_names () const
 This function returns n_solution_names. More...
 
void print_system_info () const
 This function prints out the information on available FCST solution variables and equations and what you have picked out. More...
 
Exceptions
 DeclException2 (VariableNotFoundInFCSTVariables, std::string, std::string,<< "A "<< arg1<< " with name \""<< arg2<< "\" is not stored in available FCST solution variables")
 Exception thrown when a user defined solution variable is not found among available FCST solution variables. More...
 
 DeclException2 (EquationNotFoundInFCSTEquations, std::string, std::string,<< "An "<< arg1<< " with name \""<< arg2<< "\" is not stored in available FCST equations")
 Exception thrown when a user defined equation is not found among available FCST equations. More...
 
 DeclException2 (VariableNotFoundInUserVariables, std::string, std::string,<< "A "<< arg1<< " with name \""<< arg2<< "\" is not stored in user defined solution variables")
 Exception thrown when a name in solution_name_to_index function is not found among user defined solution variables. More...
 
 DeclException2 (EquationNotFoundInUserEquations, std::string, std::string,<< "An "<< arg1<< " with name \""<< arg2<< "\" is not stored in user defined equations")
 Exception thrown when a name in equation_name_to_index function is not found among user defined equations. More...
 
 DeclException5 (SystemMatrixBlockDoesNotExist, std::string, unsigned int, unsigned int, std::string, std::string,<< "A "<< arg1<< " ("<< arg2<< ","<< arg3<< ") "<< "does not exist, because the variable \""<< arg4<< "\" is not coupled with the equation \""<< arg5<< "\"")
 Exception thrown when a requested system matrix block does not exist. More...
 

Public Attributes

External data pointers
FuelCell::ApplicationCore::BlockInfoblock_info
 Pointer to the external YourApplication<dim>::block_info object. More...
 
Table< 2, DoFTools::Coupling > * cell_couplings
 Pointer to the external YourApplication<dim>::cell_couplings object. More...
 
Table< 2, DoFTools::Coupling > * flux_couplings
 Pointer to the external YourApplication<dim>::flux_couplings (DG FEM only) object. More...
 

Protected Member Functions

Other functions
void set_all_solution_names ()
 This function fills out all_solution_names. More...
 
void set_all_equation_names ()
 This function fills out all_equation_names. More...
 
void check_solution_names () const
 This function throws an exception if a user defined solution variable is not found among available FCST solution variables. More...
 
void check_equation_names () const
 This function throws an exception if a user defined equation is not found among available FCST equations. More...
 

Protected Attributes

System properties
std::vector< std::string > all_solution_names
 Vector storing the names of available FCST solution variables. More...
 
std::vector< std::string > all_equation_names
 Vector storing the names of available FCST equations. More...
 
std::vector< std::string > solution_names
 Vector storing the names of user defined solution variables. More...
 
std::vector< std::string > equation_names
 Vector storing the names of user defined equations. More...
 
unsigned int n_solution_names
 The number of user defined solution variables. More...
 
std::map< VariableNames,
std::string > 
VariableNames_strings
 

Detailed Description

IMPORTANT: Add all new solution variables and equations here !

This class contains all the information on available FCST solution variables and equations and feeds the actual equation classes with different types of information on the linear system structure.

Available FCST solution variables:

Available FCST equations:

Author
Valentin N. Zingan, 2012
Marc Secanell Gallart, 2012

Constructor & Destructor Documentation

FuelCell::SystemManagement::SystemManagement ( )

Constructor assembling.

  • all_solution_names,
  • all_equation_names.
FuelCell::SystemManagement::SystemManagement ( FuelCell::ApplicationCore::BlockInfo block_info,
Table< 2, DoFTools::Coupling > &  cell_couplings,
Table< 2, DoFTools::Coupling > &  flux_couplings 
)

Constructor assembling.

  • all_solution_names,
  • all_equation_names,
  • block_info (AppFrame structure) will be initialized by the AppFrame itself,
  • cell_couplings (AppFrame structure) will be initialized by the make_cell_couplings function of this class called by a user defined application,
  • flux_couplings (AppFrame structure) will be initialized by the make_flux_couplings function of this class called by a user defined application (DG FEM only).
FuelCell::SystemManagement::~SystemManagement ( )

Destructor.

Member Function Documentation

void FuelCell::SystemManagement::check_equation_names ( ) const
protected

This function throws an exception if a user defined equation is not found among available FCST equations.

void FuelCell::SystemManagement::check_solution_names ( ) const
protected

This function throws an exception if a user defined solution variable is not found among available FCST solution variables.

void FuelCell::SystemManagement::declare_parameters ( ParameterHandler &  param) const

Declare parameters.

FuelCell::SystemManagement::DeclException2 ( VariableNotFoundInFCSTVariables  ,
std::string  ,
std::string  ,
<< "A "<< arg1<< " with name \""<< arg2<< "\" is not stored in available FCST solution variables"   
)

Exception thrown when a user defined solution variable is not found among available FCST solution variables.

FuelCell::SystemManagement::DeclException2 ( EquationNotFoundInFCSTEquations  ,
std::string  ,
std::string  ,
<< "An "<< arg1<< " with name \""<< arg2<< "\" is not stored in available FCST equations"   
)

Exception thrown when a user defined equation is not found among available FCST equations.

FuelCell::SystemManagement::DeclException2 ( VariableNotFoundInUserVariables  ,
std::string  ,
std::string  ,
<< "A "<< arg1<< " with name \""<< arg2<< "\" is not stored in user defined solution variables"   
)

Exception thrown when a name in solution_name_to_index function is not found among user defined solution variables.

FuelCell::SystemManagement::DeclException2 ( EquationNotFoundInUserEquations  ,
std::string  ,
std::string  ,
<< "An "<< arg1<< " with name \""<< arg2<< "\" is not stored in user defined equations"   
)

Exception thrown when a name in equation_name_to_index function is not found among user defined equations.

FuelCell::SystemManagement::DeclException5 ( SystemMatrixBlockDoesNotExist  ,
std::string  ,
unsigned  int,
unsigned  int,
std::string  ,
std::string  ,
<< "A "<< arg1<< " ("<< arg2<< ","<< arg3<< ") "<< "does not  exist,
because the variable\""<< arg4<< "\" is not coupled with the equation \""<< arg5<< "\""   
)

Exception thrown when a requested system matrix block does not exist.

Note
Such a block has cell_couplings(equation_name, solution_name) = DoFTools::none.
const unsigned int FuelCell::SystemManagement::equation_name_to_index ( const std::string &  name) const

This function returns the index of a user defined solution variable with name name stored in solution_names.

This function returns the index of a user defined equation with name name stored in equation_names.

const std::vector<std::string>& FuelCell::SystemManagement::get_all_equation_names ( ) const
inline

This function returns all_equation_names.

const std::vector<std::string>& FuelCell::SystemManagement::get_all_solution_names ( ) const
inline

This function returns all_solution_names.

const std::vector<std::string>& FuelCell::SystemManagement::get_equation_names ( ) const
inline

This function returns equation_names.

const unsigned int& FuelCell::SystemManagement::get_number_of_solution_names ( ) const
inline
const std::vector<std::string>& FuelCell::SystemManagement::get_solution_names ( ) const
inline

This function returns solution_names.

const std::string& FuelCell::SystemManagement::get_VariableNames ( const VariableNames  value)
inline
void FuelCell::SystemManagement::initialize ( FuelCell::ApplicationCore::BlockInfo rblock_info,
Table< 2, DoFTools::Coupling > &  rcell_couplings,
Table< 2, DoFTools::Coupling > &  rflux_couplings 
)
inline

This function assembles.

  • block_info (AppFrame structure) will be initialized by the AppFrame itself,
  • cell_couplings (AppFrame structure) will be initialized by the make_cell_couplings function of this class called by a user defined application,
  • flux_couplings (AppFrame structure) will be initialized by the make_flux_couplings function of this class called by a user defined application (DG FEM only)

if the empty constructor was used.

void FuelCell::SystemManagement::initialize ( ParameterHandler &  param)

Initialize parameters.

void FuelCell::SystemManagement::make_cell_couplings ( const std::vector< couplings_map > &  src)

This function fills out the* cell_couplings object based on the information drawn from the actual equation classes in use.

void FuelCell::SystemManagement::make_flux_couplings ( const std::vector< couplings_map > &  src)

This function fills out the flux_couplings (DG FEM only) object based on the information drawn from the actual equation classes in use.

const unsigned int FuelCell::SystemManagement::matrix_block_index ( const std::string &  equation_name,
const std::string &  solution_name 
) const

This function returns the index of a system matrix block based on.

  • equation_name (line),
  • solution_name (column),
  • cell_couplings.
Note
A system matrix block with cell_couplings(equation_name, solution_name) = DoFTools::none is missed.
bool FuelCell::SystemManagement::matrix_block_index_exists ( const std::string &  equation_name,
const std::string &  solution_name 
) const
inline

Check if, based on cell_couplings, this block must be assembled.

void FuelCell::SystemManagement::print_system_info ( ) const

This function prints out the information on available FCST solution variables and equations and what you have picked out.

It also displays the basic linear system structure.

void FuelCell::SystemManagement::set_all_equation_names ( )
protected

This function fills out all_equation_names.

If you have a name of a new FCST equation, add it here.

void FuelCell::SystemManagement::set_all_solution_names ( )
protected

This function fills out all_solution_names.

If you have a name of a new FCST solution variable, add it here.

const bool FuelCell::SystemManagement::solution_in_userlist ( const std::string &  name) const

This function returns a boolean stating whether an available FCST solution variable with name name stored in solution_names.

const unsigned int FuelCell::SystemManagement::solution_name_to_index ( const std::string &  name) const

Member Data Documentation

std::vector<std::string> FuelCell::SystemManagement::all_equation_names
protected

Vector storing the names of available FCST equations.

std::vector<std::string> FuelCell::SystemManagement::all_solution_names
protected

Vector storing the names of available FCST solution variables.

FuelCell::ApplicationCore::BlockInfo* FuelCell::SystemManagement::block_info

Pointer to the external YourApplication<dim>::block_info object.

Direct access is provided.

Table<2, DoFTools::Coupling>* FuelCell::SystemManagement::cell_couplings

Pointer to the external YourApplication<dim>::cell_couplings object.

Direct access is provided.

std::vector<std::string> FuelCell::SystemManagement::equation_names
protected

Vector storing the names of user defined equations.

Table<2, DoFTools::Coupling>* FuelCell::SystemManagement::flux_couplings

Pointer to the external YourApplication<dim>::flux_couplings (DG FEM only) object.

Direct access is provided.

unsigned int FuelCell::SystemManagement::n_solution_names
protected

The number of user defined solution variables.

The number of user defined equations is implicitly assumed to be the same.

std::vector<std::string> FuelCell::SystemManagement::solution_names
protected

Vector storing the names of user defined solution variables.

std::map<VariableNames, std::string> FuelCell::SystemManagement::VariableNames_strings
protected

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