ParsedCompute

ParsedCompute object.

Overview

Evaluates a user-provided algebraic expression to compute the target buffer from named inputs and coordinates. Specify the expression via "expression" and list input buffers with "inputs". Enabling "extra_symbols" adds symbols like x, y, z.

Example Input File Syntax

[TensorComputes<<<{"href": "../../syntax/TensorComputes/index.html"}>>>]
  [Initialize<<<{"href": "../../syntax/TensorComputes/Initialize/index.html"}>>>]
    [diff]
      type = ParsedCompute<<<{"description": "ParsedCompute object.", "href": "ParsedCompute.html"}>>>
      buffer<<<{"description": "The buffer this compute is writing to"}>>> = diff
      inputs<<<{"description": "Buffer names used in the expression"}>>> = 'grad_sq c2'
      expression<<<{"description": "Parsed expression"}>>> = 'abs(grad_sq - c2)'
    []
  []
[]
(test/tests/gradient/gradient_square.i)

Input Parameters

  • bufferThe buffer this compute is writing to

    C++ Type:std::string

    Controllable:No

    Description:The buffer this compute is writing to

  • expressionParsed expression

    C++ Type:std::string

    Controllable:No

    Description:Parsed expression

Required Parameters

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

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

    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>

    Controllable:No

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

  • derivativesList of inputs to take the derivative w.r.t. (or none)

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

    Controllable:No

    Description:List of inputs to take the derivative w.r.t. (or none)

  • enable_fpoptimizerTrueUse algebraic optimizer

    Default:True

    C++ Type:bool

    Controllable:No

    Description:Use algebraic optimizer

  • expandNONEExpand the tensor to full size.

    Default:NONE

    C++ Type:MooseEnum

    Options:REAL, RECIPROCAL, NONE

    Controllable:No

    Description:Expand the tensor to full size.

  • extra_symbolsFalseProvide i (imaginary unit), kx,ky,kz (reciprocal space frequency), k2 (square of the k-vector), x,y,z (real space coordinates), time t, pi, and e.

    Default:False

    C++ Type:bool

    Controllable:No

    Description:Provide i (imaginary unit), kx,ky,kz (reciprocal space frequency), k2 (square of the k-vector), x,y,z (real space coordinates), time t, pi, and e.

  • inputsBuffer names used in the expression

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

    Controllable:No

    Description:Buffer names used in the expression

  • is_integerFalseTurn the function result into an integer tensor

    Default:False

    C++ Type:bool

    Controllable:No

    Description:Turn the function result into an integer tensor

Optional Parameters

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

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

    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

    Controllable:No

    Description:Set the enabled status of the MooseObject.

Advanced Parameters

Input Files