19 const std::string & function_str,
20 const std::vector<std::string> & vars,
21 const std::vector<std::string> & vals,
24 _feproblem(feproblem),
25 _function_str(function_str),
32 _function_ptr = std::make_unique<libMesh::ParsedFunction<Real, RealGradient>>(
51 for (
unsigned int i = 0; i <
_vals_input.size(); ++i)
std::unique_ptr< libMesh::ParsedFunction< Real > > _function_ptr
Pointer to the libMesh::ParsedFunction object.
std::vector< unsigned int > _scalar_index
Stores _addr variable indices for each scalar variable value.
std::vector< ControlData< bool > * > _cd_bool_vals
Vector of pointers to bool control data values this parsed function is using.
std::vector< unsigned int > _cd_bool_index
Stores _addr variable indices for each ControlData<bool> value.
Main class for simulation (the driver of the simulation)
Real evaluate(Real t, const Point &p)
Perform the evaluation of the libMesh::ParsedFunction.
const std::vector< std::string > & _vars
List of variables supplied from the user.
const THREAD_ID _tid
The thread id passed from owning object.
std::vector< const Function * > _functions
Vector of Functions this parsed function is using.
virtual bool hasScalarVariable(const std::string &var_name) const override
std::vector< Real > _initial_vals
Storage for the initial values of _vars variables used by the libMesh::ParsedFunction object...
void updateControlDataValues()
Updates control data values for use in the libMesh::ParsedFunction.
virtual Function & getFunction(const std::string &name, const THREAD_ID tid=0)
std::vector< const VariableValue * > _scalar_vals
Vector of pointers to scalar variables values.
bool hasControlData(const std::string &name)
Query if control data with name 'name' exists.
std::vector< Real * > _addr
Pointers to the variables that store the values of _vars inside the libMesh::ParsedFunction object...
virtual MooseVariableScalar & getScalarVariable(const THREAD_ID tid, const std::string &var_name) override
const std::vector< std::string > & _vals_input
List of the values for the variables supplied by the user.
void updateFunctionValues(Real t, const Point &pt)
Updates function values for use in the libMesh::ParsedFunction.
std::vector< unsigned int > _cd_real_index
Stores _addr variable indices for each ControlData<Real> value.
const std::string & _function_str
Reference to the string containing the function to evaluate.
std::vector< unsigned int > _function_index
Stores _addr variable indices for each Function.
FEProblemBase & _feproblem
Reference to the FEProblemBase object.
OutputTools< Real >::VariableValue VariableValue
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static const std::string v
Simulation & _sim
Reference to the Simulation object.
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.
ControlData< T > * getControlData(const std::string &name)
Get control data of type T and name 'name', if it does not exist it will be created.
void update()
Updates scalar values for use in the libMesh::ParsedFunction.
void initialize()
Initialization method that prepares the _vars and _initial_vals for use by the libMesh::ParsedFunctio...
virtual bool hasFunction(const std::string &name, const THREAD_ID tid=0)
const VariableValue & sln() const
std::vector< ControlData< Real > * > _cd_real_vals
Vector of pointers to Real control data values this parsed function is using.