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, const double * > | scalar_map |
The typedef for the map of scalars. | |
typedef std::map< std::string, const FEVector * > | vector_map |
The typedef for the map of vectors. | |
Public Member Functions | |
~ApplicationData () | |
Destructor, releasing all data. | |
void | enter (std::string name, const double &s) |
Register a named scalar. | |
void | enter (std::string name, const FEVector &v) |
Register a named vector. | |
void | erase_scalar (std::string name) |
Delete a previously registered scalar. | |
void | erase_vector (std::string name) |
Delete a previously registered vector. | |
const double * | scalar (std::string name) const |
Get read-only access to a registered scalar. | |
const FEVector * | vector (std::string name) const |
Get read-only access to a registered vector. | |
void | log () const |
List all stored objects to deallog. | |
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. | |
Public Attributes | |
GrowingVectorMemory< Vector < double > > | vector_pool |
VectorMemory object for simple vectors. | |
GrowingVectorMemory< FEVector > | block_vector_pool |
VectorMemory object for block vectors. | |
Private Attributes | |
scalar_map | named_scalars |
A map linking names of data to actual scalars. | |
vector_map | named_vectors |
A map linking names of data to actual vectors. | |
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(std::string,const double&) and enter(std::string,const FEVector&) can be used to enter 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 scalar() and vector().
typedef std::map< std::string, const double* > AppFrame::ApplicationData::scalar_map |
The typedef for the map of scalars.
typedef std::map< std::string, const FEVector* > AppFrame::ApplicationData::vector_map |
The typedef for the map of vectors.
|
inline |
Destructor, releasing all data.
AppFrame::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.
|
inline |
Register a named scalar.
|
inline |
Register a named vector.
|
inline |
Delete a previously registered scalar.
|
inline |
Delete a previously registered vector.
|
inline |
List all stored objects to deallog.
|
inline |
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 |
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> AppFrame::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.
|
private |
A map linking names of data to actual scalars.
|
private |
A map linking names of data to actual vectors.
GrowingVectorMemory< Vector<double> > AppFrame::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.