COOLFluiD
Release kernel
COOLFluiD is a Collaborative Simulation Environment (CSE) focused on complex MultiPhysics simulations.
|
#include <VectorialFunction.hpp>
Inherited by ProtoEvaluatedFunction.
Public Types | |
typedef std::vector< Real > | VariablesT |
Variable storage. More... | |
Public Member Functions | |
VectorialFunction () | |
Empty constructor. More... | |
VectorialFunction (const std::string &functions, const std::string &vars) | |
Constructor. More... | |
~VectorialFunction () | |
Destructor. More... | |
template<typename var_t , typename ret_t > | |
void | evaluate (const var_t &var_values, ret_t &ret_value) const |
RealVector & | operator() (const VariablesT &var_values) |
RealVector & | operator() (const RealVector &var_values) |
bool | is_parsed () const |
void | functions (const std::vector< std::string > &functions) |
sets the function strings to be parsed More... | |
void | functions (const std::string &functions) |
sets the function strings to be parsed More... | |
void | variables (const std::vector< std::string > &vars) |
sets the variable strings to be parsed More... | |
void | variables (const std::string &vars) |
sets the variable strings to be parsed More... | |
void | parse () |
Uint | nbvars () const |
Uint | nbfuncs () const |
Protected Member Functions | |
void | clear () |
Clears the m_parsers deallocating the memory. More... | |
Private Attributes | |
bool | m_is_parsed |
flag to indicate if the functions have been parsed More... | |
std::string | m_vars |
vector holding the names of the variables More... | |
Uint | m_nbvars |
number of variables More... | |
std::vector< std::string > | m_functions |
a vector of string to hold the functions More... | |
std::vector< FunctionParser * > | m_parsers |
vector holding the parsers, one for each entry in the vector More... | |
RealVector | m_result |
storage of the result for using the class as functor More... | |
This class represents an analytical function that defines the values for a vector field
Definition at line 30 of file VectorialFunction.hpp.
typedef std::vector<Real> VariablesT |
Variable storage.
Definition at line 35 of file VectorialFunction.hpp.
Empty constructor.
Definition at line 28 of file VectorialFunction.cpp.
VectorialFunction | ( | const std::string & | functions, |
const std::string & | vars | ||
) |
Constructor.
Definition at line 38 of file VectorialFunction.cpp.
~VectorialFunction | ( | ) |
Destructor.
Definition at line 54 of file VectorialFunction.cpp.
|
protected |
Clears the m_parsers deallocating the memory.
Definition at line 61 of file VectorialFunction.cpp.
void evaluate | ( | const var_t & | var_values, |
ret_t & | ret_value | ||
) | const |
Evaluate the Vectorial Function given the values of the variables.
vars | values of the variables to substitute in the function. |
ret_value | the placeholder vector for the result |
Definition at line 133 of file VectorialFunction.hpp.
void functions | ( | const std::vector< std::string > & | functions | ) |
sets the function strings to be parsed
Definition at line 145 of file VectorialFunction.cpp.
void functions | ( | const std::string & | functions | ) |
sets the function strings to be parsed
Definition at line 124 of file VectorialFunction.cpp.
|
inline |
Definition at line 75 of file VectorialFunction.hpp.
Uint nbfuncs | ( | ) | const |
Gets the number of variables
Definition at line 79 of file VectorialFunction.cpp.
Uint nbvars | ( | ) | const |
Gets the number of variables
Definition at line 73 of file VectorialFunction.cpp.
RealVector & operator() | ( | const VariablesT & | var_values | ) |
Evaluate the Vectorial Function given the values of the variables and return it in the stored result. This function allows this class to work as a functor.
var_values | values of the variables to substitute in the function. |
Definition at line 182 of file VectorialFunction.cpp.
RealVector & operator() | ( | const RealVector & | var_values | ) |
Evaluate the Vectorial Function given the values of the variables and return it in the stored result. This function allows this class to work as a functor.
var_values | values of the variables to substitute in the function. |
Definition at line 199 of file VectorialFunction.cpp.
void parse | ( | ) |
Parse the strings to extract the functions for each line of the vector.
ParsingFailed | if there is an error while parsing |
Definition at line 153 of file VectorialFunction.cpp.
void variables | ( | const std::vector< std::string > & | vars | ) |
sets the variable strings to be parsed
Definition at line 87 of file VectorialFunction.cpp.
void variables | ( | const std::string & | vars | ) |
sets the variable strings to be parsed
Definition at line 103 of file VectorialFunction.cpp.
|
private |
a vector of string to hold the functions
Definition at line 120 of file VectorialFunction.hpp.
|
private |
flag to indicate if the functions have been parsed
Definition at line 111 of file VectorialFunction.hpp.
|
private |
number of variables
Definition at line 117 of file VectorialFunction.hpp.
|
private |
vector holding the parsers, one for each entry in the vector
Definition at line 123 of file VectorialFunction.hpp.
|
private |
storage of the result for using the class as functor
Definition at line 126 of file VectorialFunction.hpp.
|
private |
vector holding the names of the variables
Definition at line 114 of file VectorialFunction.hpp.
Send comments to: COOLFluiD Web Admin |