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

The data type used in function calls of Application. More...

#include <fe_vectors.h>

Inheritance diagram for AppFrame::FEVectors:
Inheritance graph
[legend]
Collaboration diagram for AppFrame::FEVectors:
Collaboration graph
[legend]

Public Member Functions

 FEVectors ()
 Standard constructor.
 
 DeclException2 (ExcNameMismatch, int, std::string,<< "Name at position "<< arg1<< " is not equal to "<< arg2)
 Exception indicating that a function expected a vector to have a certain name in this position, but FEVectors had a different name in that position.
 
Adding members
void add_scalar (double &s, const std::string &name)
 Add a new scalar to the end of the collection.
 
void add_vector (FEVector &v, const std::string &name)
 Add a new vector to the end of the collection.
 
void add_vector (const FEVector &v, const std::string &name)
 Add a new constant vector.
 
void merge (FEVectors &other)
 Merge the data of another FEVectors to the end of this object.
 
void merge (const FEVectors &other)
 Merge the data of another FEVectors to the end of this object.
 
unsigned int n_scalars () const
 Accessing and querying contents.
 
unsigned int n_vectors () const
 Number of stored vectors.
 
double & scalar (unsigned int i)
 Access to a scalar stored.
 
const double & scalar (unsigned int i) const
 Read-only access to a scalar stored.
 
FEVectorvector (unsigned int i)
 Access to a vector stored.
 
const FEVectorvector (unsigned int i) const
 Read-only access to a vector stored.
 
const std::string & scalar_name (unsigned int i) const
 Name of a scalar.
 
const std::string & vector_name (unsigned int i) const
 Name of a vector.
 
unsigned int find_scalar (const std::string &name) const
 Find index of a named scalar.
 
unsigned int find_vector (const std::string &name) const
 Find index of a named vector.
 
template<typename OUT >
void list (OUT &out, unsigned int verbosity=1) const
 List names of both stored scalars and vectors.
 

Private Attributes

bool is_constant
 True if the object is to be treated constant.
 
std::vector< double * > scalars
 The scalars stored.
 
std::vector< std::string > scalar_names
 The names of the scalars.
 
std::vector< FEVector * > vectors
 The vectors stored.
 
std::vector< std::string > vector_names
 The names of the vectors.
 

Detailed Description

The data type used in function calls of Application.

This class is a collection of pointers to BlockVector objects representing finite element functions and additional parameters that ought to be handed down to applications.

Any class inheriting Application using its own data should create a new FEVectors object and add its own data first, then merge() with the data handed down from the enclosing Application.

This policy ensures that the first vectors available at a certain point are always the ones of the next enclosing Application.

Author
Guido Kanschat, 2007

Constructor & Destructor Documentation

AppFrame::FEVectors::FEVectors ( )
inline

Standard constructor.

Member Function Documentation

void AppFrame::FEVectors::add_scalar ( double &  s,
const std::string &  name 
)
inline

Add a new scalar to the end of the collection.

References is_constant, scalar_names, and scalars.

Referenced by merge().

Here is the caller graph for this function:

void AppFrame::FEVectors::add_vector ( FEVector v,
const std::string &  name 
)
inline

Add a new vector to the end of the collection.

References is_constant, vector_names, and vectors.

Referenced by merge().

Here is the caller graph for this function:

void AppFrame::FEVectors::add_vector ( const FEVector v,
const std::string &  name 
)
inline

Add a new constant vector.

References is_constant, vector_names, and vectors.

AppFrame::FEVectors::DeclException2 ( ExcNameMismatch  ,
int  ,
std::string  ,
<< "Name at position "<< arg1<< " is not equal to "<<  arg2 
)

Exception indicating that a function expected a vector to have a certain name in this position, but FEVectors had a different name in that position.

unsigned int AppFrame::FEVectors::find_scalar ( const std::string &  name) const
inline

Find index of a named scalar.

References scalar_names.

unsigned int AppFrame::FEVectors::find_vector ( const std::string &  name) const
inline

Find index of a named vector.

References vector_names.

Referenced by MeshWorker::VectorSelector::cache().

Here is the caller graph for this function:

template<typename OUT >
void AppFrame::FEVectors::list ( OUT &  out,
unsigned int  verbosity = 1 
) const
inline

List names of both stored scalars and vectors.

verbosity = 0 - nothing printed verbosity = 1 - names pronted verbosity > 1 - numbers, names, values, and L2-norms printed

References n_scalars(), n_vectors(), scalar_names, scalars, vector_names, and vectors.

Here is the call graph for this function:

void AppFrame::FEVectors::merge ( FEVectors other)
inline

Merge the data of another FEVectors to the end of this object.

References add_scalar(), add_vector(), is_constant, n_scalars(), n_vectors(), scalar_names, scalars, vector_names, and vectors.

Here is the call graph for this function:

void AppFrame::FEVectors::merge ( const FEVectors other)
inline

Merge the data of another FEVectors to the end of this object.

After this operation, all data in this object will be treated as const.

References add_scalar(), add_vector(), is_constant, n_scalars(), n_vectors(), scalar_names, scalars, vector_names, and vectors.

Here is the call graph for this function:

unsigned int AppFrame::FEVectors::n_scalars ( ) const
inline

Accessing and querying contents.

Number of stored scalars.

References scalars.

Referenced by list(), merge(), scalar(), and scalar_name().

Here is the caller graph for this function:

unsigned int AppFrame::FEVectors::n_vectors ( ) const
inline

Number of stored vectors.

References vectors.

Referenced by list(), merge(), vector(), and vector_name().

Here is the caller graph for this function:

double & AppFrame::FEVectors::scalar ( unsigned int  i)
inline

Access to a scalar stored.

References is_constant, n_scalars(), and scalars.

Here is the call graph for this function:

const double & AppFrame::FEVectors::scalar ( unsigned int  i) const
inline

Read-only access to a scalar stored.

References n_scalars(), and scalars.

Here is the call graph for this function:

const std::string & AppFrame::FEVectors::scalar_name ( unsigned int  i) const
inline

Name of a scalar.

References n_scalars(), and scalar_names.

Here is the call graph for this function:

FEVector & AppFrame::FEVectors::vector ( unsigned int  i)
inline

Access to a vector stored.

References is_constant, n_vectors(), and vectors.

Here is the call graph for this function:

const FEVector & AppFrame::FEVectors::vector ( unsigned int  i) const
inline

Read-only access to a vector stored.

References n_vectors(), and vectors.

Here is the call graph for this function:

const std::string & AppFrame::FEVectors::vector_name ( unsigned int  i) const
inline

Name of a vector.

References n_vectors(), and vector_names.

Referenced by MeshWorker::VectorSelector::print().

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

bool AppFrame::FEVectors::is_constant
private

True if the object is to be treated constant.

Referenced by add_scalar(), add_vector(), merge(), scalar(), and vector().

std::vector<std::string> AppFrame::FEVectors::scalar_names
private

The names of the scalars.

Referenced by add_scalar(), find_scalar(), list(), merge(), and scalar_name().

std::vector<double*> AppFrame::FEVectors::scalars
private

The scalars stored.

Referenced by add_scalar(), list(), merge(), n_scalars(), and scalar().

std::vector<std::string> AppFrame::FEVectors::vector_names
private

The names of the vectors.

Referenced by add_vector(), find_vector(), list(), merge(), and vector_name().

std::vector<FEVector*> AppFrame::FEVectors::vectors
private

The vectors stored.

Referenced by add_vector(), list(), merge(), n_vectors(), and vector().


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