OpenFCST: The open-source Fuel Cell Simulation Toolbox
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Private Attributes | List of all members
FuelCellShop::SolutionVariable Struct Reference

This structure is used to store values for a particular solution variables, at all quadrature points in the cell. More...

#include <fcst_variables.h>

Public Member Functions

Initialization
 SolutionVariable ()
 Default Constructor.
 
 SolutionVariable (const std::vector< double > *data_in, const VariableNames &name_in)
 Constructor for setting up the pointer to solution variable values and name of the solution variable.
 
 SolutionVariable (const double &value, const unsigned int &length, const VariableNames &name_in)
 Constructor to initialize the solution variable values, taking a default value and size of the vector as an input argument.
 
 SolutionVariable (const std::vector< double > &data_in, const VariableNames &name_in)
 Constructor to initialize the solution variable values, taking values as an input vector argument.
 
Accessors
const double & operator[] (const unsigned int &i) const
 Operator to access the value at a particular quadrature point in the cell.
 
bool is_initialized () const
 Function to determine whether the structure is initialized or not.
 
unsigned int size () const
 Function to the length of the internal data element.
 
VariableNames get_variablename () const
 Function to get the VariableNames enumeration corresponding to this struct.
 

Private Attributes

std::vector< double > default_data
 Default data member.
 
const std::vector< double > * data
 Pointer storing the solution variable values at all quadrature points in the cell.
 
VariableNames name
 VariableNames enumeration
 
bool initialized
 Boolean member determining initialized or not.
 

Detailed Description

This structure is used to store values for a particular solution variables, at all quadrature points in the cell.

It is best utilized while setting previous Newton iteration values from application to the layer classes etc. It is recommended that those classes which require certain old solution values to compute effective properties etc. should contain this structure as their data member. This structure has four constructors. Default constructor doesn't set any value. It also sets the boolean member initialized to false. This can be checked by using is_initialized member function and is helpful to determine whether any values are stored or not inside the object. The other constructor takes std::vector<double>* corresponding to the solution variable values and enumeration VariableNames representing the name of the solution variable. The VariableNames of the solution variable can be accessed by get_variablename() method. In order to access value at a particular quadrature point, operator [ ] is provided. Other two constructors are useful in the case when we set some default values for a particular variable (which is not being solved in the current application).

Sample Usage:

// Inside the application, let's pass temperature vector from old solution to the layer class.
// Old solution is accessed from AppFrame::DoFApplication<dim>::CellInfo cell_info object.
SolutionVariable temperature_old( &cell_info.values[last_iter][temp_index], VariableNames::temperature_of_REV );
layer.set_solution( temperature_old );
// Let us compute the temperature in Celsius at first quadrature point in the layer/kinetics etc. class:
SolutionVariable temperature_cell;
// Inside the layer/kinetics etc. class, temperature values are set into the temperature_cell structure using the set_solution method from the application.
if (temperature_cell.is_initialized() && (temperature_cell.get_variablename() == VariableNames::temperature_of_REV)
{
double temp_celsius = temperature_cell[0] - 273.15;
}
Author
Philip Wardlaw
Madhur Bhaiya
Marc Secanell

Constructor & Destructor Documentation

FuelCellShop::SolutionVariable::SolutionVariable ( )
inline

Default Constructor.

FuelCellShop::SolutionVariable::SolutionVariable ( const std::vector< double > *  data_in,
const VariableNames name_in 
)
inline

Constructor for setting up the pointer to solution variable values and name of the solution variable.

FuelCellShop::SolutionVariable::SolutionVariable ( const double &  value,
const unsigned int &  length,
const VariableNames name_in 
)
inline

Constructor to initialize the solution variable values, taking a default value and size of the vector as an input argument.

Note
This constructor is recommended when the solution variable values are not being solved for in the application, while it is a required variable to compute certain properties. Then, it can be used to set some default values.
FuelCellShop::SolutionVariable::SolutionVariable ( const std::vector< double > &  data_in,
const VariableNames name_in 
)
inline

Constructor to initialize the solution variable values, taking values as an input vector argument.

Note
This constructor is recommended when the solution variable values are not being solved for in the application, while it is a required variable to compute certain properties. Then, it can be used to set some default values.

Member Function Documentation

VariableNames FuelCellShop::SolutionVariable::get_variablename ( ) const
inline
bool FuelCellShop::SolutionVariable::is_initialized ( ) const
inline
const double& FuelCellShop::SolutionVariable::operator[] ( const unsigned int &  i) const
inline

Operator to access the value at a particular quadrature point in the cell.

Note
Solution values vector should be initialized before using this operator. Also, the input index should not be out of range.
unsigned int FuelCellShop::SolutionVariable::size ( ) const
inline

Function to the length of the internal data element.

Member Data Documentation

const std::vector<double>* FuelCellShop::SolutionVariable::data
private

Pointer storing the solution variable values at all quadrature points in the cell.

std::vector<double> FuelCellShop::SolutionVariable::default_data
private

Default data member.

bool FuelCellShop::SolutionVariable::initialized
private

Boolean member determining initialized or not.

VariableNames FuelCellShop::SolutionVariable::name
private

VariableNames enumeration


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