#include <FunctionParserUtils.h>
Public Types | |
typedef GenericSymFunction< is_ad > | SymFunction |
Shorthand for an autodiff function parser object. More... | |
typedef std::shared_ptr< SymFunction > | SymFunctionPtr |
Shorthand for an smart pointer to an autodiff function parser object. More... | |
Public Member Functions | |
FunctionParserUtils (const InputParameters ¶meters) | |
void | setParserFeatureFlags (SymFunctionPtr &) const |
apply input parameters to internal feature flags of the parser object More... | |
Static Public Member Functions | |
static InputParameters | validParams () |
Protected Types | |
enum | FailureMethod { FailureMethod::nan, FailureMethod::nan_warning, FailureMethod::error, FailureMethod::exception } |
Enum for failure method. More... | |
Protected Member Functions | |
GenericReal< is_ad > | evaluate (SymFunctionPtr &, const std::string &object_name="") |
Evaluate FParser object and check EvalError. More... | |
GenericReal< is_ad > | evaluate (SymFunctionPtr &, const std::vector< GenericReal< is_ad >> &, const std::string &object_name="") |
Evaluate FParser object and check EvalError. More... | |
void | addFParserConstants (SymFunctionPtr &parser, const std::vector< std::string > &constant_names, const std::vector< std::string > &constant_expressions) const |
add constants (which can be complex expressions) to the parser object More... | |
virtual void | functionsOptimize (SymFunctionPtr &parsed_function) |
run FPOptimizer on the parsed function More... | |
void | parsedFunctionSetup (SymFunctionPtr &function, const std::string &expression, const std::string &variables, const std::vector< std::string > &constant_names, const std::vector< std::string > &constant_expressions, const libMesh::Parallel::Communicator &comm) const |
Performs setup steps on a SymFunction. More... | |
template<> | |
void | functionsOptimize (SymFunctionPtr &parsed_function) |
template<> | |
void | functionsOptimize (SymFunctionPtr &parsed_function) |
Protected Attributes | |
enum FunctionParserUtils::FailureMethod | _evalerror_behavior |
const Real | _quiet_nan |
appropriate not a number value to return More... | |
std::vector< GenericReal< is_ad > > | _func_params |
Array to stage the parameters passed to the functions when calling Eval. More... | |
const Real | _epsilon |
fuzzy comparison tolerance More... | |
bool | _enable_jit |
feature flags More... | |
bool | _enable_ad_cache |
bool | _disable_fpoptimizer |
bool | _enable_auto_optimize |
Static Protected Attributes | |
static const char * | _eval_error_msg [] |
table of FParser eval error codes More... | |
Definition at line 54 of file FunctionParserUtils.h.
typedef GenericSymFunction<is_ad> FunctionParserUtils< is_ad >::SymFunction |
Shorthand for an autodiff function parser object.
Definition at line 62 of file FunctionParserUtils.h.
typedef std::shared_ptr<SymFunction> FunctionParserUtils< is_ad >::SymFunctionPtr |
Shorthand for an smart pointer to an autodiff function parser object.
Definition at line 65 of file FunctionParserUtils.h.
|
strongprotected |
Enum for failure method.
Enumerator | |
---|---|
nan | |
nan_warning | |
error | |
exception |
Definition at line 116 of file FunctionParserUtils.h.
FunctionParserUtils< is_ad >::FunctionParserUtils | ( | const InputParameters & | parameters | ) |
Definition at line 59 of file FunctionParserUtils.C.
|
protected |
add constants (which can be complex expressions) to the parser object
Definition at line 151 of file FunctionParserUtils.C.
|
protected |
Evaluate FParser object and check EvalError.
Definition at line 87 of file FunctionParserUtils.C.
Referenced by ParsedFunctorMaterialTempl< is_ad >::ParsedFunctorMaterialTempl().
|
protected |
Evaluate FParser object and check EvalError.
This version uses a supplied vector of function parameters, which is useful if an object uses more than one parsed function, which may have different function parameter values.
Definition at line 94 of file FunctionParserUtils.C.
|
protectedvirtual |
run FPOptimizer on the parsed function
Referenced by DerivativeParsedMaterialHelperTempl< is_ad >::functionsPostParse().
|
protected |
|
protected |
Definition at line 209 of file FunctionParserUtils.C.
|
protected |
Performs setup steps on a SymFunction.
function | reference to pointer to the function to set up |
expression | expression to parse |
variables | comma separated string holding all the variables of the expression |
constant_names | vector of names (symbols) of constants in the expression |
constant_expressions | vectors of expressions (=values) of constants in the expression |
comm | communicator used to stagger JIT file creations |
Definition at line 226 of file FunctionParserUtils.C.
void FunctionParserUtils< is_ad >::setParserFeatureFlags | ( | SymFunctionPtr & | parser | ) | const |
apply input parameters to internal feature flags of the parser object
Definition at line 79 of file FunctionParserUtils.C.
|
static |
Definition at line 18 of file FunctionParserUtils.C.
Referenced by ArrayParsedAux::validParams(), ParsedAux::validParams(), ParsedPostprocessor::validParams(), ParsedODEKernel::validParams(), ParsedVectorAux::validParams(), ParsedSubdomainGeneratorBase::validParams(), ParsedCurveGenerator::validParams(), ParsedFunctorMaterialTempl< is_ad >::validParams(), ParsedExtraElementIDGenerator::validParams(), ParsedGenerateNodeset::validParams(), ParsedConvergence::validParams(), SolutionUserObject::validParams(), ParsedNodeTransformGenerator::validParams(), CutMeshByLevelSetGeneratorBase::validParams(), ParsedGenerateSideset::validParams(), TransfiniteMeshGenerator::validParams(), ParsedDownSelectionPositions::validParams(), ParsedElementDeletionGenerator::validParams(), and ParsedMaterialHelper< is_ad >::validParams().
|
protected |
Definition at line 111 of file FunctionParserUtils.h.
|
protected |
Definition at line 110 of file FunctionParserUtils.h.
|
protected |
Definition at line 112 of file FunctionParserUtils.h.
|
protected |
feature flags
Definition at line 109 of file FunctionParserUtils.h.
Referenced by FunctionParserUtils< false >::FunctionParserUtils().
|
protected |
fuzzy comparison tolerance
Definition at line 128 of file FunctionParserUtils.h.
|
staticprotected |
table of FParser eval error codes
Definition at line 122 of file FunctionParserUtils.h.
|
protected |
|
protected |
Array to stage the parameters passed to the functions when calling Eval.
Definition at line 125 of file FunctionParserUtils.h.
Referenced by ParsedFunctorMaterialTempl< is_ad >::ParsedFunctorMaterialTempl().
|
protected |
appropriate not a number value to return
Definition at line 119 of file FunctionParserUtils.h.