18#include "libmesh/fparser_ad.hh"
22#define usingParsedMaterialHelperMembers(T) \
23 usingFunctionMaterialBaseMembers(T); \
24 usingFunctionParserUtilsMembers(T); \
25 using typename ParsedMaterialHelper<T>::VariableNameMappingMode; \
26 using typename ParsedMaterialHelper<T>::MatPropDescriptorList; \
27 using ParsedMaterialHelper<T>::functionParse; \
28 using ParsedMaterialHelper<T>::functionsPostParse; \
29 using ParsedMaterialHelper<T>::_func_F; \
30 using ParsedMaterialHelper<T>::_symbol_names; \
31 using ParsedMaterialHelper<T>::_mat_prop_descriptors; \
32 using ParsedMaterialHelper<T>::_tol; \
33 using ParsedMaterialHelper<T>::_postprocessor_values; \
34 using ParsedMaterialHelper<T>::_extra_symbols; \
35 using ParsedMaterialHelper<T>::_functors; \
36 using ParsedMaterialHelper<T>::_map_mode
52 const VariableNameMappingMode map_mode,
53 const std::optional<std::string> & function_param_name = {});
76 const std::vector<std::string> & constant_names,
77 const std::vector<std::string> & constant_expressions);
94 const std::vector<std::string> & constant_names,
95 const std::vector<std::string> & constant_expressions,
96 const std::vector<std::string> & mat_prop_names,
97 const std::vector<std::string> & tol_names,
98 const std::vector<Real> & tol_values);
115 const std::vector<std::string> & constant_names,
116 const std::vector<std::string> & constant_expressions,
117 const std::vector<std::string> & mat_prop_names,
118 const std::vector<PostprocessorName> & postprocessor_names,
119 const std::vector<std::string> & tol_names,
120 const std::vector<Real> & tol_values);
139 const std::vector<std::string> & constant_names,
140 const std::vector<std::string> & constant_expressions,
141 const std::vector<std::string> & mat_prop_names,
142 const std::vector<PostprocessorName> & postprocessor_names,
143 const std::vector<std::string> & tol_names,
144 const std::vector<Real> & tol_values,
145 const std::vector<MooseFunctorName> & functor_names,
146 const std::vector<std::string> & functor_symbols);
Real PostprocessorValue
various MOOSE typedefs
Material base class, central to all Materials that provide a Function as a material property value.
Material properties get fully described using this structure, including their dependent variables and...
std::shared_ptr< SymFunction > SymFunctionPtr
Shorthand for an smart pointer to an autodiff function parser object.
MaterialBases compute MaterialProperties.
const InputParameters & parameters() const
Get the parameters of the object.
Helper class to perform the parsing and optimization of the function expression.
virtual void initialSetup() override final
Gets called at the beginning of the simulation before this object is asked to do its job.
const VariableNameMappingMode _map_mode
Flag to indicate if MOOSE nonlinear variable names should be used as FParser variable names.
std::vector< const PostprocessorValue * > _postprocessor_values
List of coupled Postprocessors.
void initQpStatefulProperties() override
Initialize stateful properties at quadrature points.
void computeQpProperties() override
Users must override this method.
MatPropDescriptorList _mat_prop_descriptors
Material property descriptors (obtained by parsing _mat_prop_expressions)
const std::vector< ExtraSymbols > _extra_symbols
Extra symbols.
void parseError(const std::string &message) const
Helper for reporting a parse error with a much as context as possible.
void insertReservedNames(std::set< std::string > &reserved_names)
Populates the given set with names not to be used as user-defined symbol (e.g.
usingFunctionMaterialBaseMembers(is_ad)
usingFunctionParserUtilsMembers(is_ad)
virtual void functionsPostParse()
DerivativeMaterialPropertyNameInterface::SymbolName SymbolName
std::vector< const Moose::Functor< Real > * > _functors
Vector of pointers to functors.
const std::optional< std::string > _function_param_name
Optional parameter name that represents the function to associate errors with.
SymFunctionPtr _func_F
The undiffed free energy function parser object.
std::vector< MaterialBase * > _upstream_mat
Vector to hold list of materials that must be updated prior to evaluating current material (for compu...
const bool _error_on_missing_material_properties
This is true by default, but can be disabled to make non-existing properties default to zero.
static InputParameters validParams()
std::vector< Real > _tol
Tolerance values for all arguments (to protect from log(0)).
CreateMooseEnumClass(ExtraSymbols, x, y, z, t, dt)
CreateMooseEnumClass(VariableNameMappingMode, USE_MOOSE_NAMES, USE_PARAM_NAMES)
std::vector< MaterialName > _upstream_mat_names
Vector to hold list of material names that must be updated prior to evaluating current material (for ...
void functionParse(const std::string &function_expression)
This method sets up and parses the function string given by the user.
const InputParameters & _params
The underlying parameters.
std::vector< SymbolName > _symbol_names
Symbol names used in the expression (depends on the map_mode).
std::vector< FunctionMaterialPropertyDescriptor< is_ad > > MatPropDescriptorList
convenience typedef for the material property descriptors
MOOSE now contains C++17 code, so give a reasonable error message stating what the user can do to add...