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
FuelCell::ApplicationCore::FEVectors Class Reference

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

#include <fe_vectors.h>

Inheritance diagram for FuelCell::ApplicationCore::FEVectors:
Inheritance graph
[legend]
Collaboration diagram for FuelCell::ApplicationCore::FEVectors:
Collaboration graph
[legend]

Public Member Functions

 FEVectors ()
 Constructor. More...
 
 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. More...
 
Adding members.
void add_scalar (double &s, const std::string &name)
 Add a new scalar to the end of the collection. More...
 
void add_vector (FEVector &v, const std::string &name)
 Add a new vector to the end of the collection. More...
 
void add_vector (const FEVector &v, const std::string &name)
 Add a new constant vector. More...
 
void merge (FEVectors &other)
 Merge the data of another FEVectors to the end of this object. More...
 
void merge (const FEVectors &other)
 Merge the data of another FEVectors to the end of this object. More...
 
Accessors
unsigned int n_scalars () const
 Number of stored scalars. More...
 
unsigned int n_vectors () const
 Number of stored vectors. More...
 
double & scalar (unsigned int i)
 Access to a scalar stored. More...
 
const double & scalar (unsigned int i) const
 Read-only access to a scalar stored. More...
 
FEVectorvector (unsigned int i)
 Access to a vector stored. More...
 
const FEVectorvector (unsigned int i) const
 Read-only access to a vector stored. More...
 
const std::string & scalar_name (unsigned int i) const
 Name of a scalar. More...
 
const std::string & vector_name (unsigned int i) const
 Name of a vector. More...
 
unsigned int find_scalar (const std::string &name) const
 Find index of a named scalar. More...
 
unsigned int find_vector (const std::string &name) const
 Find index of a named vector. More...
 
unsigned int count_vector (const std::string &name) const
 Counts the number of instance a vector by name. More...
 
template<typename OUT >
void list (OUT &out, unsigned int verbosity=1) const
 List names of both stored scalars and vectors. More...
 

Private Attributes

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

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

Constructor & Destructor Documentation

FuelCell::ApplicationCore::FEVectors::FEVectors ( )

Constructor.

Member Function Documentation

void FuelCell::ApplicationCore::FEVectors::add_scalar ( double &  s,
const std::string &  name 
)

Add a new scalar to the end of the collection.

void FuelCell::ApplicationCore::FEVectors::add_vector ( FEVector v,
const std::string &  name 
)

Add a new vector to the end of the collection.

void FuelCell::ApplicationCore::FEVectors::add_vector ( const FEVector v,
const std::string &  name 
)

Add a new constant vector.

unsigned int FuelCell::ApplicationCore::FEVectors::count_vector ( const std::string &  name) const

Counts the number of instance a vector by name.

FuelCell::ApplicationCore::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 FuelCell::ApplicationCore::FEVectors::find_scalar ( const std::string &  name) const

Find index of a named scalar.

unsigned int FuelCell::ApplicationCore::FEVectors::find_vector ( const std::string &  name) const

Find index of a named vector.

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

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

void FuelCell::ApplicationCore::FEVectors::merge ( FEVectors other)

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

void FuelCell::ApplicationCore::FEVectors::merge ( const FEVectors other)

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.

unsigned int FuelCell::ApplicationCore::FEVectors::n_scalars ( ) const

Number of stored scalars.

unsigned int FuelCell::ApplicationCore::FEVectors::n_vectors ( ) const

Number of stored vectors.

double& FuelCell::ApplicationCore::FEVectors::scalar ( unsigned int  i)

Access to a scalar stored.

const double& FuelCell::ApplicationCore::FEVectors::scalar ( unsigned int  i) const

Read-only access to a scalar stored.

const std::string& FuelCell::ApplicationCore::FEVectors::scalar_name ( unsigned int  i) const

Name of a scalar.

FEVector& FuelCell::ApplicationCore::FEVectors::vector ( unsigned int  i)

Access to a vector stored.

const FEVector& FuelCell::ApplicationCore::FEVectors::vector ( unsigned int  i) const

Read-only access to a vector stored.

const std::string& FuelCell::ApplicationCore::FEVectors::vector_name ( unsigned int  i) const

Name of a vector.

Member Data Documentation

bool FuelCell::ApplicationCore::FEVectors::is_constant
private

True if the object is to be treated constant.

std::vector<std::string> FuelCell::ApplicationCore::FEVectors::scalar_names
private

The names of the scalars.

std::vector<double*> FuelCell::ApplicationCore::FEVectors::scalars
private

The scalars stored.

std::vector<std::string> FuelCell::ApplicationCore::FEVectors::vector_names
private

The names of the vectors.

std::vector<FEVector*> FuelCell::ApplicationCore::FEVectors::vectors
private

The vectors stored.


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