OpenFCST: The open-source Fuel Cell Simulation Toolbox
|
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 ¶m) const |
Empty member function at the moment. More... | |
void | initialize (ParameterHandler ¶m) |
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 FEVector * | vector (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< FEVector > | block_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... | |
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().
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.
FuelCell::ApplicationCore::ApplicationData::ApplicationData | ( | ) |
Constructor.
FuelCell::ApplicationCore::ApplicationData::~ApplicationData | ( | ) |
Destructor, releasing all data.
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
.
|
inline |
Function to return the linear solver type.
|
inline |
Function to return the non-linear solver type.
|
inline |
Function to return refinement type.
|
inline |
Function to return the residual vector name in the FEVectors object.
References FuelCell::ApplicationCore::NEWTON3PP, FuelCell::ApplicationCore::NEWTONBASIC, FuelCell::ApplicationCore::NEWTONLINESEARCH, FuelCell::ApplicationCore::NONE, and FuelCell::ApplicationCore::PICARD.
|
inline |
Function to return solution vector name in the FEVectors object.
References FuelCell::ApplicationCore::NEWTON3PP, FuelCell::ApplicationCore::NEWTONBASIC, FuelCell::ApplicationCore::NEWTONLINESEARCH, FuelCell::ApplicationCore::NONE, and FuelCell::ApplicationCore::PICARD.
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.
|
inline |
Function to set the type of linear solver.
References FuelCell::ApplicationCore::BICGSTAB, FuelCell::ApplicationCore::CG, FuelCell::ApplicationCore::ILU_GMRES, FuelCell::ApplicationCore::MUMPS, and FuelCell::ApplicationCore::UMFPACK.
|
inline |
Function to set the type of non-linear solver.
References FuelCell::ApplicationCore::NEWTON3PP, FuelCell::ApplicationCore::NEWTONBASIC, FuelCell::ApplicationCore::NEWTONLINESEARCH, FuelCell::ApplicationCore::NONE, and FuelCell::ApplicationCore::PICARD.
|
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.
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.
|
protected |
|
private |
A map linking names of data to actual boolean flags.
|
private |
A map linking names of data to actual scalars.
|
private |
A map linking names of data to actual std vectors.
|
private |
A map linking names of data to actual std vectors of std vectors.
|
private |
A map linking names of data to actual vectors.
|
protected |
|
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.