OpenFCST: The open-source Fuel Cell Simulation Toolbox
|
The data type used in function calls of Application. More...
#include <fe_vectors.h>
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. | |
FEVector & | vector (unsigned int i) |
Access to a vector stored. | |
const FEVector & | vector (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. | |
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.
|
inline |
Standard constructor.
|
inline |
Add a new scalar to the end of the collection.
References is_constant, scalar_names, and scalars.
Referenced by merge().
|
inline |
Add a new vector to the end of the collection.
References is_constant, vector_names, and vectors.
Referenced by merge().
|
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.
|
inline |
Find index of a named scalar.
References scalar_names.
|
inline |
Find index of a named vector.
References vector_names.
Referenced by MeshWorker::VectorSelector::cache().
|
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.
|
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.
|
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.
|
inline |
Accessing and querying contents.
Number of stored scalars.
References scalars.
Referenced by list(), merge(), scalar(), and scalar_name().
|
inline |
Number of stored vectors.
References vectors.
Referenced by list(), merge(), vector(), and vector_name().
|
inline |
Access to a scalar stored.
References is_constant, n_scalars(), and scalars.
|
inline |
Read-only access to a scalar stored.
References n_scalars(), and scalars.
|
inline |
Name of a scalar.
References n_scalars(), and scalar_names.
|
inline |
Access to a vector stored.
References is_constant, n_vectors(), and vectors.
|
inline |
Read-only access to a vector stored.
References n_vectors(), and vectors.
|
inline |
Name of a vector.
References n_vectors(), and vector_names.
Referenced by MeshWorker::VectorSelector::print().
|
private |
True if the object is to be treated constant.
Referenced by add_scalar(), add_vector(), merge(), scalar(), and vector().
|
private |
The names of the scalars.
Referenced by add_scalar(), find_scalar(), list(), merge(), and scalar_name().
|
private |
The scalars stored.
Referenced by add_scalar(), list(), merge(), n_scalars(), and scalar().
|
private |
The names of the vectors.
Referenced by add_vector(), find_vector(), list(), merge(), and vector_name().
|
private |
The vectors stored.
Referenced by add_vector(), list(), merge(), n_vectors(), and vector().