OpenFCST: The open-source Fuel Cell Simulation Toolbox
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Public Attributes | Protected Attributes | Private Attributes | List of all members
FuelCell::ApplicationCore::ApplicationData Class Reference

Here we handle general data of applications. More...

#include <application_data.h>

Public Types

typedef std::map< std::string,
bool > 
flag_map
 The typedef for the map of boolean flags. More...
 
typedef std::map< std::string,
const double * > 
scalar_map
 The typedef for the map of scalars. More...
 
typedef std::map< std::string,
const FEVector * > 
vector_map
 The typedef for the map of vectors. More...
 
typedef std::map< std::string,
const std::vector< double > * > 
std_vector_map
 The typedef for the map of std vectors. More...
 
typedef std::map< std::string,
const std::vector< std::vector
< double > > * > 
std_vector_std_vector_map
 The typedef for the map of std vectors of std vectors. More...
 

Public Member Functions

 ApplicationData ()
 Constructor. More...
 
 ~ApplicationData ()
 Destructor, releasing all data. More...
 
void declare_parameters (ParameterHandler &param) const
 Empty member function at the moment. More...
 
void initialize (ParameterHandler &param)
 Empty member function at the moment. More...
 
void enter_flag (std::string name, const bool &s)
 Register a named boolean flag. More...
 
void enter (std::string name, const double &s)
 Register a named scalar. More...
 
void enter (std::string name, const FEVector &v)
 Register a named vector. More...
 
void enter (std::string name, const std::vector< double > &v)
 Register a named std vector. More...
 
void enter (std::string name, const std::vector< std::vector< double > > &v)
 Register a named std vector of std vectors. More...
 
void erase_flag (std::string name)
 Delete a previously registered boolean flag. More...
 
void erase_scalar (std::string name)
 Delete a previously registered scalar. More...
 
void erase_vector (std::string name)
 Delete a previously registered vector. More...
 
void erase_std_vector (std::string name)
 Delete a previously registered std vector. More...
 
void erase_std_vector_of_std_vectors (std::string name)
 Delete a previously registered std vector of std vectors. More...
 
bool flag_exists (const std::string &name) const
 This function returns true if a boolean flag exists (doesn't matter if the flag itself is true or false). More...
 
bool flag (std::string name) const
 Get read-only access to a registered boolean flag. More...
 
const double * scalar (std::string name) const
 Get read-only access to a registered scalar. More...
 
const FEVectorvector (std::string name) const
 Get read-only access to a registered vector. More...
 
const std::vector< double > * std_vector (std::string name) const
 Get read-only access to a registered std vector. More...
 
const std::vector< std::vector
< double > > * 
std_vector_std_vector (std::string name) const
 Get read-only access to a registered std vector of std vectors. More...
 
void log () const
 List all stored objects to FcstUtilities::log. More...
 
FuelCell::ApplicationCore::LinearSolver get_linear_solver ()
 Function to return the linear solver type. More...
 
FuelCell::ApplicationCore::NonLinearSolver get_nonlinear_solver ()
 Function to return the non-linear solver type. More...
 
FuelCell::ApplicationCore::RefinementSolver get_refinement_solver ()
 Function to return refinement type. More...
 
void set_linear_solver (const std::string name)
 Function to set the type of linear solver. More...
 
void set_nonlinear_solver (const std::string name)
 Function to set the type of non-linear solver. More...
 
void set_refinement_solver (const std::string name)
 Function to set the type of refinement. More...
 
std::string get_solution_vector_name (FuelCell::ApplicationCore::NonLinearSolver in)
 Function to return solution vector name in the FEVectors object. More...
 
std::string get_residual_vector_name (FuelCell::ApplicationCore::NonLinearSolver in)
 Function to return the residual vector name in the FEVectors object. More...
 
 DeclException2 (ExcNotFound, char *, std::string,<< "A "<< arg1<< " with name "<< arg2<< " was not stored in this data object")
 Exception thrown when a named scalar or vector was searched but not found. More...
 

Public Attributes

GrowingVectorMemory< Vector
< double > > 
vector_pool
 VectorMemory object for simple vectors. More...
 
GrowingVectorMemory< FEVectorblock_vector_pool
 VectorMemory object for block vectors. More...
 
std::map< std::string,
std::map< int, double > > 
field_data
 Map of field data with names corresponding to the physical meaning of data, which can be read from VTK files. More...
 

Protected Attributes

FuelCell::ApplicationCore::LinearSolver lin_solver
 
FuelCell::ApplicationCore::NonLinearSolver nonlin_solver
 
FuelCell::ApplicationCore::RefinementSolver refinement_solver
 

Private Attributes

flag_map named_flags
 A map linking names of data to actual boolean flags. More...
 
scalar_map named_scalars
 A map linking names of data to actual scalars. More...
 
vector_map named_vectors
 A map linking names of data to actual vectors. More...
 
std_vector_map named_std_vectors
 A map linking names of data to actual std vectors. More...
 
std_vector_std_vector_map named_std_vectors_of_std_vectors
 A map linking names of data to actual std vectors of std vectors. More...
 

Detailed Description

Here we handle general data of applications.

It is the idea of this class that all applications inheriting from ApplicationBase share the same ApplicationData object, thus accessing the same vector pools and using the object as a means for communicating global information.

First purpose is providing vector memory objects for Vector and BlockVector objects for applications. These objects, vector_pool and block_vector_pool can be accessed directly.

Furthermore, it provides a map which allows applications to exchange data in named registers. To this end, the functions enter_flag(std::string,const bool&), enter(std::string,const double&), enter(std::string,const FEVector&), and enter(std::string,const std::vector<double>&) can be used to enter boolean flag, scalar and vector data, respectively. These data are entered as references, so the controlling application can change them at any time. All other applications sharing the same ApplicationData can access them read only through the functions flag(), scalar(), vector(), and std_vector().

Author
Guido Kanschat
Valentin N. Zingan

Member Typedef Documentation

typedef std::map< std::string, bool > FuelCell::ApplicationCore::ApplicationData::flag_map

The typedef for the map of boolean flags.

typedef std::map< std::string, const double* > FuelCell::ApplicationCore::ApplicationData::scalar_map

The typedef for the map of scalars.

typedef std::map< std::string, const std::vector<double>* > FuelCell::ApplicationCore::ApplicationData::std_vector_map

The typedef for the map of std vectors.

typedef std::map< std::string, const std::vector< std::vector<double> >* > FuelCell::ApplicationCore::ApplicationData::std_vector_std_vector_map

The typedef for the map of std vectors of std vectors.

typedef std::map< std::string, const FEVector* > FuelCell::ApplicationCore::ApplicationData::vector_map

The typedef for the map of vectors.

Constructor & Destructor Documentation

FuelCell::ApplicationCore::ApplicationData::ApplicationData ( )

Constructor.

FuelCell::ApplicationCore::ApplicationData::~ApplicationData ( )

Destructor, releasing all data.

Member Function Documentation

void FuelCell::ApplicationCore::ApplicationData::declare_parameters ( ParameterHandler &  param) const

Empty member function at the moment.

FuelCell::ApplicationCore::ApplicationData::DeclException2 ( ExcNotFound  ,
char *  ,
std::string  ,
<< "A "<< arg1<< " with name "<< arg2<< " was not stored in this data object"   
)

Exception thrown when a named scalar or vector was searched but not found.

void FuelCell::ApplicationCore::ApplicationData::enter ( std::string  name,
const double &  s 
)

Register a named scalar.

void FuelCell::ApplicationCore::ApplicationData::enter ( std::string  name,
const FEVector v 
)

Register a named vector.

void FuelCell::ApplicationCore::ApplicationData::enter ( std::string  name,
const std::vector< double > &  v 
)

Register a named std vector.

void FuelCell::ApplicationCore::ApplicationData::enter ( std::string  name,
const std::vector< std::vector< double > > &  v 
)

Register a named std vector of std vectors.

void FuelCell::ApplicationCore::ApplicationData::enter_flag ( std::string  name,
const bool &  s 
)

Register a named boolean flag.

void FuelCell::ApplicationCore::ApplicationData::erase_flag ( std::string  name)

Delete a previously registered boolean flag.

void FuelCell::ApplicationCore::ApplicationData::erase_scalar ( std::string  name)

Delete a previously registered scalar.

void FuelCell::ApplicationCore::ApplicationData::erase_std_vector ( std::string  name)

Delete a previously registered std vector.

void FuelCell::ApplicationCore::ApplicationData::erase_std_vector_of_std_vectors ( std::string  name)

Delete a previously registered std vector of std vectors.

void FuelCell::ApplicationCore::ApplicationData::erase_vector ( std::string  name)

Delete a previously registered vector.

bool FuelCell::ApplicationCore::ApplicationData::flag ( std::string  name) const

Get read-only access to a registered boolean flag.

bool FuelCell::ApplicationCore::ApplicationData::flag_exists ( const std::string &  name) const

This function returns true if a boolean flag exists (doesn't matter if the flag itself is true or false).

Otherwise returns false.

FuelCell::ApplicationCore::LinearSolver FuelCell::ApplicationCore::ApplicationData::get_linear_solver ( )
inline

Function to return the linear solver type.

FuelCell::ApplicationCore::NonLinearSolver FuelCell::ApplicationCore::ApplicationData::get_nonlinear_solver ( )
inline

Function to return the non-linear solver type.

FuelCell::ApplicationCore::RefinementSolver FuelCell::ApplicationCore::ApplicationData::get_refinement_solver ( )
inline

Function to return refinement type.

std::string FuelCell::ApplicationCore::ApplicationData::get_residual_vector_name ( FuelCell::ApplicationCore::NonLinearSolver  in)
inline
std::string FuelCell::ApplicationCore::ApplicationData::get_solution_vector_name ( FuelCell::ApplicationCore::NonLinearSolver  in)
inline
void FuelCell::ApplicationCore::ApplicationData::initialize ( ParameterHandler &  param)

Empty member function at the moment.

void FuelCell::ApplicationCore::ApplicationData::log ( ) const

List all stored objects to FcstUtilities::log.

const double* FuelCell::ApplicationCore::ApplicationData::scalar ( std::string  name) const

Get read-only access to a registered scalar.

It only offers read access and returns a null pointer, if the name has not been registered.

void FuelCell::ApplicationCore::ApplicationData::set_linear_solver ( const std::string  name)
inline
void FuelCell::ApplicationCore::ApplicationData::set_nonlinear_solver ( const std::string  name)
inline
void FuelCell::ApplicationCore::ApplicationData::set_refinement_solver ( const std::string  name)
inline

Function to set the type of refinement.

References FuelCell::ApplicationCore::ADAPTIVE.

const std::vector<double>* FuelCell::ApplicationCore::ApplicationData::std_vector ( std::string  name) const

Get read-only access to a registered std vector.

It only offers read access and returns a null pointer, if the name has not been registered.

const std::vector< std::vector<double> >* FuelCell::ApplicationCore::ApplicationData::std_vector_std_vector ( std::string  name) const

Get read-only access to a registered std vector of std vectors.

It only offers read access and returns a null pointer, if the name has not been registered.

const FEVector* FuelCell::ApplicationCore::ApplicationData::vector ( std::string  name) const

Get read-only access to a registered vector.

It only offers read access and returns a null pointer, if the name has not been registered.

Member Data Documentation

GrowingVectorMemory<FEVector> FuelCell::ApplicationCore::ApplicationData::block_vector_pool

VectorMemory object for block vectors.

All applications should allocate their vectors here, so they can be reused and operating system memory management can be avoided.

std::map<std::string,std::map<int,double> > FuelCell::ApplicationCore::ApplicationData::field_data

Map of field data with names corresponding to the physical meaning of data, which can be read from VTK files.

This can be used for passing Knudsen raidus of the microstructures by mapping Knudsen radius to cell index or any such data which can be mapped to cell index.

FuelCell::ApplicationCore::LinearSolver FuelCell::ApplicationCore::ApplicationData::lin_solver
protected
flag_map FuelCell::ApplicationCore::ApplicationData::named_flags
private

A map linking names of data to actual boolean flags.

scalar_map FuelCell::ApplicationCore::ApplicationData::named_scalars
private

A map linking names of data to actual scalars.

std_vector_map FuelCell::ApplicationCore::ApplicationData::named_std_vectors
private

A map linking names of data to actual std vectors.

std_vector_std_vector_map FuelCell::ApplicationCore::ApplicationData::named_std_vectors_of_std_vectors
private

A map linking names of data to actual std vectors of std vectors.

vector_map FuelCell::ApplicationCore::ApplicationData::named_vectors
private

A map linking names of data to actual vectors.

FuelCell::ApplicationCore::NonLinearSolver FuelCell::ApplicationCore::ApplicationData::nonlin_solver
protected
FuelCell::ApplicationCore::RefinementSolver FuelCell::ApplicationCore::ApplicationData::refinement_solver
protected
GrowingVectorMemory< Vector<double> > FuelCell::ApplicationCore::ApplicationData::vector_pool

VectorMemory object for simple vectors.

All applications should allocate their vectors here, so they can be reused and operating system memory management can be avoided.


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