A wrapper class for creating and evaluating parsed functions via the libMesh::ParsedFunction interface for fparser. More...
#include <THMParsedFunctionWrapper.h>
Public Member Functions | |
THMParsedFunctionWrapper (Simulation &sim, FEProblemBase &feproblem, const std::string &function_str, const std::vector< std::string > &vars, const std::vector< std::string > &vals, const THREAD_ID tid=0) | |
Class constructor. More... | |
Real | evaluate (Real t, const Point &p) |
Perform the evaluation of the libMesh::ParsedFunction. More... | |
const std::vector< ControlData< Real > * > | getRealControlData () |
Get list of Real-valued control data objects. More... | |
const std::vector< ControlData< bool > * > | getBoolControlData () |
Get list of boolean-valued control data objects. More... | |
Private Member Functions | |
void | initialize () |
Initialization method that prepares the _vars and _initial_vals for use by the libMesh::ParsedFunction object allocated in the constructor. More... | |
void | update () |
Updates scalar values for use in the libMesh::ParsedFunction. More... | |
void | updateFunctionValues (Real t, const Point &pt) |
Updates function values for use in the libMesh::ParsedFunction. More... | |
void | updateControlDataValues () |
Updates control data values for use in the libMesh::ParsedFunction. More... | |
Private Attributes | |
Simulation & | _sim |
Reference to the Simulation object. More... | |
FEProblemBase & | _feproblem |
Reference to the FEProblemBase object. More... | |
const std::string & | _function_str |
Reference to the string containing the function to evaluate. More... | |
const std::vector< std::string > & | _vars |
List of variables supplied from the user. More... | |
const std::vector< std::string > & | _vals_input |
List of the values for the variables supplied by the user. More... | |
std::vector< Real > | _initial_vals |
Storage for the initial values of _vars variables used by the libMesh::ParsedFunction object. More... | |
std::unique_ptr< libMesh::ParsedFunction< Real > > | _function_ptr |
Pointer to the libMesh::ParsedFunction object. More... | |
std::vector< unsigned int > | _cd_real_index |
Stores _addr variable indices for each ControlData<Real> value. More... | |
std::vector< ControlData< Real > * > | _cd_real_vals |
Vector of pointers to Real control data values this parsed function is using. More... | |
std::vector< unsigned int > | _cd_bool_index |
Stores _addr variable indices for each ControlData<bool> value. More... | |
std::vector< ControlData< bool > * > | _cd_bool_vals |
Vector of pointers to bool control data values this parsed function is using. More... | |
std::vector< unsigned int > | _scalar_index |
Stores _addr variable indices for each scalar variable value. More... | |
std::vector< const VariableValue * > | _scalar_vals |
Vector of pointers to scalar variables values. More... | |
std::vector< unsigned int > | _function_index |
Stores _addr variable indices for each Function. More... | |
std::vector< const Function * > | _functions |
Vector of Functions this parsed function is using. More... | |
std::vector< Real * > | _addr |
Pointers to the variables that store the values of _vars inside the libMesh::ParsedFunction object. More... | |
const THREAD_ID | _tid |
The thread id passed from owning object. More... | |
A wrapper class for creating and evaluating parsed functions via the libMesh::ParsedFunction interface for fparser.
It has the same capability as MooseParsedFunctionWrapper but adds ability to use control data values
Definition at line 28 of file THMParsedFunctionWrapper.h.
THMParsedFunctionWrapper::THMParsedFunctionWrapper | ( | Simulation & | sim, |
FEProblemBase & | feproblem, | ||
const std::string & | function_str, | ||
const std::vector< std::string > & | vars, | ||
const std::vector< std::string > & | vals, | ||
const THREAD_ID | tid = 0 |
||
) |
Class constructor.
sim | Reference to the Simulation object (provides access to ControlData) |
feproblem | Reference to the FEProblemBase object (provides access to Postprocessors) |
function_str | A string that contains the function to evaluate |
vars | A vector of variable names contained within the function |
vals | A vector of variable initial values, matching the variables defined in vars |
Definition at line 17 of file THMParsedFunctionWrapper.C.
Perform the evaluation of the libMesh::ParsedFunction.
Definition at line 40 of file THMParsedFunctionWrapper.C.
|
inline |
Get list of boolean-valued control data objects.
Definition at line 59 of file THMParsedFunctionWrapper.h.
|
inline |
Get list of Real-valued control data objects.
Definition at line 54 of file THMParsedFunctionWrapper.h.
|
private |
Initialization method that prepares the _vars and _initial_vals for use by the libMesh::ParsedFunction object allocated in the constructor.
Definition at line 49 of file THMParsedFunctionWrapper.C.
Referenced by THMParsedFunctionWrapper().
|
private |
Updates scalar values for use in the libMesh::ParsedFunction.
Definition at line 90 of file THMParsedFunctionWrapper.C.
Referenced by evaluate().
|
private |
Updates control data values for use in the libMesh::ParsedFunction.
Definition at line 104 of file THMParsedFunctionWrapper.C.
Referenced by evaluate().
Updates function values for use in the libMesh::ParsedFunction.
Definition at line 97 of file THMParsedFunctionWrapper.C.
Referenced by evaluate().
|
private |
Pointers to the variables that store the values of _vars inside the libMesh::ParsedFunction object.
Definition at line 108 of file THMParsedFunctionWrapper.h.
Referenced by THMParsedFunctionWrapper(), update(), updateControlDataValues(), and updateFunctionValues().
|
private |
Stores _addr variable indices for each ControlData<bool> value.
Definition at line 90 of file THMParsedFunctionWrapper.h.
Referenced by initialize(), and updateControlDataValues().
|
private |
Vector of pointers to bool control data values this parsed function is using.
Definition at line 93 of file THMParsedFunctionWrapper.h.
Referenced by getBoolControlData(), initialize(), and updateControlDataValues().
|
private |
Stores _addr variable indices for each ControlData<Real> value.
Definition at line 84 of file THMParsedFunctionWrapper.h.
Referenced by initialize(), and updateControlDataValues().
|
private |
Vector of pointers to Real control data values this parsed function is using.
Definition at line 87 of file THMParsedFunctionWrapper.h.
Referenced by getRealControlData(), initialize(), and updateControlDataValues().
|
private |
Reference to the FEProblemBase object.
Definition at line 66 of file THMParsedFunctionWrapper.h.
Referenced by initialize().
|
private |
Stores _addr variable indices for each Function.
Definition at line 102 of file THMParsedFunctionWrapper.h.
Referenced by initialize(), and updateFunctionValues().
|
private |
Pointer to the libMesh::ParsedFunction object.
Definition at line 81 of file THMParsedFunctionWrapper.h.
Referenced by evaluate(), and THMParsedFunctionWrapper().
|
private |
Reference to the string containing the function to evaluate.
Definition at line 69 of file THMParsedFunctionWrapper.h.
Referenced by THMParsedFunctionWrapper().
|
private |
Vector of Functions this parsed function is using.
Definition at line 105 of file THMParsedFunctionWrapper.h.
Referenced by initialize(), and updateFunctionValues().
|
private |
Storage for the initial values of _vars variables used by the libMesh::ParsedFunction object.
Definition at line 78 of file THMParsedFunctionWrapper.h.
Referenced by initialize(), and THMParsedFunctionWrapper().
|
private |
Stores _addr variable indices for each scalar variable value.
Definition at line 96 of file THMParsedFunctionWrapper.h.
Referenced by initialize(), and update().
|
private |
Vector of pointers to scalar variables values.
Definition at line 99 of file THMParsedFunctionWrapper.h.
Referenced by initialize(), and update().
|
private |
Reference to the Simulation object.
Definition at line 63 of file THMParsedFunctionWrapper.h.
Referenced by initialize().
|
private |
The thread id passed from owning object.
Definition at line 111 of file THMParsedFunctionWrapper.h.
Referenced by initialize().
|
private |
List of the values for the variables supplied by the user.
Definition at line 75 of file THMParsedFunctionWrapper.h.
Referenced by initialize().
|
private |
List of variables supplied from the user.
Definition at line 72 of file THMParsedFunctionWrapper.h.
Referenced by THMParsedFunctionWrapper().