COOLFluiD
Release kernel
COOLFluiD is a Collaborative Simulation Environment (CSE) focused on complex MultiPhysics simulations.
|
#include <AnalyticalFunction.hpp>
Public Member Functions | |
AnalyticalFunction () | |
Empty constructor. More... | |
AnalyticalFunction (const std::string &function, const std::string &vars, const std::string &separator=",") | |
Constructor. More... | |
AnalyticalFunction (const std::string &function, const std::vector< std::string > &vars) | |
Constructor. More... | |
~AnalyticalFunction () | |
Destructor. More... | |
void | set_variables (const std::string &vars, const std::string &separator=",") |
Define the parameters of the function. More... | |
void | set_variables (const std::vector< std::string > &vars) |
Define the parameters of the function. More... | |
void | parse (const std::string &function) |
void | parse (const std::string &function, const std::string &vars, const std::string &separator=",") |
void | parse (const std::string &function, const std::vector< std::string > &vars) |
void | parse_and_deduce_variables (const std::string &function, std::vector< std::string > &vars) |
bool | is_parsed () const |
Uint | nbvars () const |
const std::string & | function () const |
The analytical function that is parsed. More... | |
const std::vector< std::string > & | variables () const |
The variables. More... | |
template<typename var_t , typename ret_t > | |
void | evaluate (const var_t &var_values, ret_t &ret_value) const |
template<typename var_t > | |
Real | operator() (const var_t &var_values) const |
Protected Member Functions | |
void | clear () |
Clears the m_parser deallocating the memory. More... | |
Private Attributes | |
bool | m_is_parsed |
flag to indicate if the functions have been parsed More... | |
std::vector< std::string > | m_vars |
vector holding the names of the variables More... | |
std::string | m_function |
a vector of string to hold the functions More... | |
boost::shared_ptr< FunctionParser > | m_parser |
vector holding the parsers, one for each entry in the vector More... | |
This class represents an analytical function that defines the values for a vector field
Definition at line 28 of file AnalyticalFunction.hpp.
Empty constructor.
Definition at line 28 of file AnalyticalFunction.cpp.
AnalyticalFunction | ( | const std::string & | function, |
const std::string & | vars, | ||
const std::string & | separator = "," |
||
) |
Constructor.
Definition at line 35 of file AnalyticalFunction.cpp.
AnalyticalFunction | ( | const std::string & | function, |
const std::vector< std::string > & | vars | ||
) |
Constructor.
Definition at line 43 of file AnalyticalFunction.cpp.
~AnalyticalFunction | ( | ) |
Destructor.
Definition at line 53 of file AnalyticalFunction.cpp.
|
protected |
Clears the m_parser deallocating the memory.
Definition at line 60 of file AnalyticalFunction.cpp.
void evaluate | ( | const var_t & | var_values, |
ret_t & | ret_value | ||
) | const |
Evaluate the Analytical 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 116 of file AnalyticalFunction.hpp.
|
inline |
The analytical function that is parsed.
Definition at line 75 of file AnalyticalFunction.hpp.
|
inline |
Definition at line 67 of file AnalyticalFunction.hpp.
Uint nbvars | ( | ) | const |
Gets the number of variables
Definition at line 68 of file AnalyticalFunction.cpp.
Real operator() | ( | const var_t & | var_values | ) | const |
Evaluate the Analytical Function given the values of the variables. This function allows this class to work as a functor.
var_values | values of the variables to substitute in the function. |
Definition at line 128 of file AnalyticalFunction.hpp.
void parse | ( | const std::string & | function | ) |
Parse the strings to extract the functions for each line of the vector.
ParsingFailed | if there is an error while parsing |
Definition at line 99 of file AnalyticalFunction.cpp.
void parse | ( | const std::string & | function, |
const std::string & | vars, | ||
const std::string & | separator = "," |
||
) |
Parse the strings to extract the functions for each line of the vector.
ParsingFailed | if there is an error while parsing |
Definition at line 165 of file AnalyticalFunction.cpp.
void parse | ( | const std::string & | function, |
const std::vector< std::string > & | vars | ||
) |
Parse the strings to extract the functions for each line of the vector.
ParsingFailed | if there is an error while parsing |
Definition at line 157 of file AnalyticalFunction.cpp.
void parse_and_deduce_variables | ( | const std::string & | function, |
std::vector< std::string > & | vars | ||
) |
Parse a function and return the variables found in the expression
ParsingFailed | if there is an error while parsing |
Definition at line 127 of file AnalyticalFunction.cpp.
void set_variables | ( | const std::string & | vars, |
const std::string & | separator = "," |
||
) |
Define the parameters of the function.
Definition at line 76 of file AnalyticalFunction.cpp.
void set_variables | ( | const std::vector< std::string > & | vars | ) |
Define the parameters of the function.
Definition at line 91 of file AnalyticalFunction.cpp.
|
inline |
The variables.
Definition at line 78 of file AnalyticalFunction.hpp.
|
private |
a vector of string to hold the functions
Definition at line 106 of file AnalyticalFunction.hpp.
|
private |
flag to indicate if the functions have been parsed
Definition at line 100 of file AnalyticalFunction.hpp.
|
private |
vector holding the parsers, one for each entry in the vector
Definition at line 109 of file AnalyticalFunction.hpp.
|
private |
vector holding the names of the variables
Definition at line 103 of file AnalyticalFunction.hpp.
Send comments to: COOLFluiD Web Admin |