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 | Private Attributes | List of all members
AppFrame::ApplicationData Class Reference

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 FEVectorvector (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< FEVectorblock_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.
 

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(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().

Member Typedef Documentation

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.

Constructor & Destructor Documentation

AppFrame::ApplicationData::~ApplicationData ( )
inline

Destructor, releasing all data.

Member Function Documentation

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.

void AppFrame::ApplicationData::enter ( std::string  name,
const double &  s 
)
inline

Register a named scalar.

void AppFrame::ApplicationData::enter ( std::string  name,
const FEVector v 
)
inline

Register a named vector.

void AppFrame::ApplicationData::erase_scalar ( std::string  name)
inline

Delete a previously registered scalar.

void AppFrame::ApplicationData::erase_vector ( std::string  name)
inline

Delete a previously registered vector.

void AppFrame::ApplicationData::log ( ) const
inline

List all stored objects to deallog.

const double * AppFrame::ApplicationData::scalar ( std::string  name) const
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.

const FEVector * AppFrame::ApplicationData::vector ( std::string  name) const
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.

Member Data Documentation

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.

scalar_map AppFrame::ApplicationData::named_scalars
private

A map linking names of data to actual scalars.

vector_map AppFrame::ApplicationData::named_vectors
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.


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