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