ParsedPostprocessor

Computes a parsed expression with post-processors

The "expression" to parse may only include other postprocessors, the time variable and constants from the input file.

commentnote

Derivatives and integrals are not natively supported by the parsing operation, unless the postprocessors in the parsed expression are already the derivatives / integrals of interest.

Example Input File Syntax

In this test input file, we compute various quantities using ParsedPostprocessors. First, we look at the ratio of two postprocessors:

[Postprocessors]
  [parsed]
    type = ParsedPostprocessor
    expression = 'L2_norm / L1_norm'
    pp_names = 'L2_norm L1_norm'
  []
[]
(moose/test/tests/postprocessors/parsed_postprocessor/parsed_pp.i)

Then we add a time dependence to the postprocessor result:

[Postprocessors]
  [parsed_with_t]
    type = ParsedPostprocessor
    expression = 'L2_norm + L1_norm + t'
    pp_names = 'L2_norm L1_norm'
    use_t = true
  []
[]
(moose/test/tests/postprocessors/parsed_postprocessor/parsed_pp.i)

And finally we introduce constants from the input file in the parsed expression:

[Postprocessors]
  [parsed_with_constants]
    type = ParsedPostprocessor
    expression = 'L2_norm + 3*L1_norm + mu'
    pp_names = 'L2_norm L1_norm'
    constant_names = 'mu'
    constant_expressions = '4'
  []
[]
(moose/test/tests/postprocessors/parsed_postprocessor/parsed_pp.i)

Input Parameters

  • expressionfunction expression

    C++ Type:FunctionExpression

    Unit:(no unit assumed)

    Controllable:No

    Description:function expression

Required Parameters

  • 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.)

  • epsilon1e-12Fuzzy comparison tolerance

    Default:1e-12

    C++ Type:double

    Unit:(no unit assumed)

    Controllable:No

    Description:Fuzzy comparison tolerance

  • execute_onTIMESTEP_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: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, TRANSFER

    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.

  • pp_namesPost-processors arguments

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

    Unit:(no unit assumed)

    Controllable:No

    Description:Post-processors arguments

  • 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_tFalseMake time (t) variables available in the function expression.

    Default:False

    C++ Type:bool

    Unit:(no unit assumed)

    Controllable:No

    Description:Make time (t) variables available in the function expression.

Optional Parameters

  • allow_duplicate_execution_on_initialFalseIn the case where this UserObject is depended upon by an initial condition, allow it to be executed twice during the initial setup (once before the IC and again after mesh adaptivity (if applicable).

    Default:False

    C++ Type:bool

    Unit:(no unit assumed)

    Controllable:No

    Description:In the case where this UserObject is depended upon by an initial condition, allow it to be executed twice during the initial setup (once before the IC and again after mesh adaptivity (if applicable).

  • 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.

  • execution_order_group0Execution order groups are executed in increasing order (e.g., the lowest number is executed first). Note that negative group numbers may be used to execute groups before the default (0) group. Please refer to the user object documentation for ordering of user object execution within a group.

    Default:0

    C++ Type:int

    Unit:(no unit assumed)

    Controllable:No

    Description:Execution order groups are executed in increasing order (e.g., the lowest number is executed first). Note that negative group numbers may be used to execute groups before the default (0) group. Please refer to the user object documentation for ordering of user object execution within a group.

  • force_postauxFalseForces the UserObject to be executed in POSTAUX

    Default:False

    C++ Type:bool

    Unit:(no unit assumed)

    Controllable:No

    Description:Forces the UserObject to be executed in POSTAUX

  • force_preauxFalseForces the UserObject to be executed in PREAUX

    Default:False

    C++ Type:bool

    Unit:(no unit assumed)

    Controllable:No

    Description:Forces the UserObject to be executed in PREAUX

  • force_preicFalseForces the UserObject to be executed in PREIC during initial setup

    Default:False

    C++ Type:bool

    Unit:(no unit assumed)

    Controllable:No

    Description:Forces the UserObject to be executed in PREIC during initial setup

  • outputsVector of output names where you would like to restrict the output of variables(s) associated with this object

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

    Unit:(no unit assumed)

    Controllable:No

    Description:Vector of output names where you would like to restrict the output of variables(s) associated with this object

  • 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