ParsedGradFunction

Defines a function and its gradient using input file parameters.

The ParsedGradFunction is similar to the ParsedFunction, differing only in that it also defines the gradient of the function. Inputs for defining each component of the gradient follow the same rules as outlined in ParsedFunction.

Example input syntax

In this input, the ParsedGradFunction is used for using the Method of Manufactured Solutions. This method verifies the convergence of the finite element method to known analytical solutions of a simple problem. u_func is used in the PostProcessors block to compute the H1 error, or the error on both the solution and its gradient, between u and this known solution.

[Functions]
  active = 'forcing_func u_func'

  [forcing_func]
    type = ParsedFunction
    expression = alpha*alpha*pi*pi*sin(alpha*pi*x)
    symbol_names = 'alpha'
    symbol_values = '4'
  []

  [u_func]
    type = ParsedGradFunction
    expression = sin(alpha*pi*x)
    grad_x = alpha*pi*sin(alpha*pi*x)
    symbol_names = 'alpha'
    symbol_values = '4'
  []
[]
(moose/test/tests/postprocessors/mms_slope/mms_slope_test.i)

Input Parameters

  • expressionUser defined function.

    C++ Type:std::string

    Unit:(no unit assumed)

    Controllable:No

    Description:User defined function.

  • grad_x0Partial derivative with respect to x.

    Default:0

    C++ Type:std::string

    Unit:(no unit assumed)

    Controllable:No

    Description:Partial derivative with respect to x.

  • grad_y0Partial derivative with respect to y.

    Default:0

    C++ Type:std::string

    Unit:(no unit assumed)

    Controllable:No

    Description:Partial derivative with respect to y.

  • grad_z0Partial derivative with respect to z.

    Default:0

    C++ Type:std::string

    Unit:(no unit assumed)

    Controllable:No

    Description:Partial derivative with respect to z.

  • symbol_namesSymbols (excluding t,x,y,z) that are bound to the values provided by the corresponding items in the vals vector.

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

    Unit:(no unit assumed)

    Controllable:No

    Description:Symbols (excluding t,x,y,z) that are bound to the values provided by the corresponding items in the vals vector.

  • symbol_valuesConstant numeric values, postprocessor names, function names, and scalar variables corresponding to the symbols in symbol_names.

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

    Unit:(no unit assumed)

    Controllable:No

    Description:Constant numeric values, postprocessor names, function names, and scalar variables corresponding to the symbols in symbol_names.

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:No

    Description:Set the enabled status of the MooseObject.

Advanced Parameters