ParsedAux

Sets a field variable value to the evaluation of a parsed expression.

The parsed expression may contain:

  • variables (coupled_variables parameter)

  • real-valued material properties ("material_properties" parameter)

  • automatic differentiation (AD) real-valued material properties ("ad_material_properties" parameter)

  • functors (functor_names or functor_symbols parameter)

  • coordinates in space and time (use_xyzt parameter)

  • constants (constant_names for their name in the expression and constant_expressions for their values)

Example syntax

In this example, the ParsedAux is being used to compute the multiplication of the simulation variable, u, by 2.

[AuxKernels]
  [two_u]
    type = ParsedAux
    variable = two_u
    coupled_variables = 'u'
    expression = '2*u'
  []
[]
(moose/test/tests/outputs/png/wedge.i)

Input Parameters

  • expressionParsed function expression to compute

    C++ Type:FunctionExpression

    Unit:(no unit assumed)

    Controllable:No

    Description:Parsed function expression to compute

  • variableThe name of the variable that this object applies to

    C++ Type:AuxVariableName

    Unit:(no unit assumed)

    Controllable:No

    Description:The name of the variable that this object applies to

Required Parameters

  • ad_material_propertiesAD material properties (ADReal-valued) in the expression

    C++ Type:std::vector<MaterialPropertyName>

    Unit:(no unit assumed)

    Controllable:No

    Description:AD material properties (ADReal-valued) in the expression

  • blockThe list of blocks (ids or names) that this object will be applied

    C++ Type:std::vector<SubdomainName>

    Unit:(no unit assumed)

    Controllable:No

    Description:The list of blocks (ids or names) that this object will be applied

  • boundaryThe list of boundaries (ids or names) from the mesh where this object applies

    C++ Type:std::vector<BoundaryName>

    Unit:(no unit assumed)

    Controllable:No

    Description:The list of boundaries (ids or names) from the mesh where this object applies

  • check_boundary_restrictedTrueWhether to check for multiple element sides on the boundary in the case of a boundary restricted, element aux variable. Setting this to false will allow contribution to a single element's elemental value(s) from multiple boundary sides on the same element (example: when the restricted boundary exists on two or more sides of an element, such as at a corner of a mesh

    Default:True

    C++ Type:bool

    Unit:(no unit assumed)

    Controllable:No

    Description:Whether to check for multiple element sides on the boundary in the case of a boundary restricted, element aux variable. Setting this to false will allow contribution to a single element's elemental value(s) from multiple boundary sides on the same element (example: when the restricted boundary exists on two or more sides of an element, such as at a corner of a mesh

  • constant_expressionsVector of values for the constants in constant_names (can be an FParser expression)

    C++ Type:std::vector<std::string>

    Unit:(no unit assumed)

    Controllable:No

    Description:Vector of values for the constants in constant_names (can be an FParser expression)

  • constant_namesVector of constants used in the parsed function (use this for kB etc.)

    C++ Type:std::vector<std::string>

    Unit:(no unit assumed)

    Controllable:No

    Description:Vector of constants used in the parsed function (use this for kB etc.)

  • coupled_variablesVector of coupled variable names

    C++ Type:std::vector<VariableName>

    Unit:(no unit assumed)

    Controllable:No

    Description:Vector of coupled variable names

  • epsilon1e-12Fuzzy comparison tolerance

    Default:1e-12

    C++ Type:double

    Unit:(no unit assumed)

    Controllable:No

    Description:Fuzzy comparison tolerance

  • execute_onLINEAR TIMESTEP_ENDThe list of flag(s) indicating when this object should be executed. For a description of each flag, see https://mooseframework.inl.gov/source/interfaces/SetupInterface.html.

    Default:LINEAR TIMESTEP_END

    C++ Type:ExecFlagEnum

    Unit:(no unit assumed)

    Options:NONE, INITIAL, LINEAR, NONLINEAR_CONVERGENCE, NONLINEAR, POSTCHECK, TIMESTEP_END, TIMESTEP_BEGIN, MULTIAPP_FIXED_POINT_END, MULTIAPP_FIXED_POINT_BEGIN, FINAL, CUSTOM, PRE_DISPLACE

    Controllable:No

    Description:The list of flag(s) indicating when this object should be executed. For a description of each flag, see https://mooseframework.inl.gov/source/interfaces/SetupInterface.html.

  • functor_namesFunctors to use in the parsed expression

    C++ Type:std::vector<MooseFunctorName>

    Unit:(no unit assumed)

    Controllable:No

    Description:Functors to use in the parsed expression

  • functor_symbolsSymbolic name to use for each functor in 'functor_names' in the parsed expression. If not provided, then the actual functor names will be used in the parsed expression.

    C++ Type:std::vector<std::string>

    Unit:(no unit assumed)

    Controllable:No

    Description:Symbolic name to use for each functor in 'functor_names' in the parsed expression. If not provided, then the actual functor names will be used in the parsed expression.

  • material_propertiesMaterial properties (Real-valued) in the expression

    C++ Type:std::vector<MaterialPropertyName>

    Unit:(no unit assumed)

    Controllable:No

    Description:Material properties (Real-valued) in the expression

  • prop_getter_suffixAn optional suffix parameter that can be appended to any attempt to retrieve/get material properties. The suffix will be prepended with a '_' character.

    C++ Type:MaterialPropertyName

    Unit:(no unit assumed)

    Controllable:No

    Description:An optional suffix parameter that can be appended to any attempt to retrieve/get material properties. The suffix will be prepended with a '_' character.

  • use_interpolated_stateFalseFor the old and older state use projected material properties interpolated at the quadrature points. To set up projection use the ProjectedStatefulMaterialStorageAction.

    Default:False

    C++ Type:bool

    Unit:(no unit assumed)

    Controllable:No

    Description:For the old and older state use projected material properties interpolated at the quadrature points. To set up projection use the ProjectedStatefulMaterialStorageAction.

  • use_xyztFalseMake coordinate (x,y,z) and time (t) variables available in the function expression.

    Default:False

    C++ Type:bool

    Unit:(no unit assumed)

    Controllable:No

    Description:Make coordinate (x,y,z) and time (t) variables available in the function expression.

Optional Parameters

  • control_tagsAdds user-defined labels for accessing object parameters via control logic.

    C++ Type:std::vector<std::string>

    Unit:(no unit assumed)

    Controllable:No

    Description:Adds user-defined labels for accessing object parameters via control logic.

  • enableTrueSet the enabled status of the MooseObject.

    Default:True

    C++ Type:bool

    Unit:(no unit assumed)

    Controllable:Yes

    Description:Set the enabled status of the MooseObject.

  • seed0The seed for the master random number generator

    Default:0

    C++ Type:unsigned int

    Unit:(no unit assumed)

    Controllable:No

    Description:The seed for the master random number generator

  • use_displaced_meshFalseWhether or not this object should use the displaced mesh for computation. Note that in the case this is true but no displacements are provided in the Mesh block the undisplaced mesh will still be used.

    Default:False

    C++ Type:bool

    Unit:(no unit assumed)

    Controllable:No

    Description:Whether or not this object should use the displaced mesh for computation. Note that in the case this is true but no displacements are provided in the Mesh block the undisplaced mesh will still be used.

Advanced Parameters

  • disable_fpoptimizerFalseDisable the function parser algebraic optimizer

    Default:False

    C++ Type:bool

    Unit:(no unit assumed)

    Controllable:No

    Description:Disable the function parser algebraic optimizer

  • enable_ad_cacheTrueEnable caching of function derivatives for faster startup time

    Default:True

    C++ Type:bool

    Unit:(no unit assumed)

    Controllable:No

    Description:Enable caching of function derivatives for faster startup time

  • enable_auto_optimizeTrueEnable automatic immediate optimization of derivatives

    Default:True

    C++ Type:bool

    Unit:(no unit assumed)

    Controllable:No

    Description:Enable automatic immediate optimization of derivatives

  • enable_jitTrueEnable just-in-time compilation of function expressions for faster evaluation

    Default:True

    C++ Type:bool

    Unit:(no unit assumed)

    Controllable:No

    Description:Enable just-in-time compilation of function expressions for faster evaluation

  • evalerror_behaviornanWhat to do if evaluation error occurs. Options are to pass a nan, pass a nan with a warning, throw a error, or throw an exception

    Default:nan

    C++ Type:MooseEnum

    Unit:(no unit assumed)

    Options:nan, nan_warning, error, exception

    Controllable:No

    Description:What to do if evaluation error occurs. Options are to pass a nan, pass a nan with a warning, throw a error, or throw an exception

Parsed Expression Advanced Parameters