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
    value = alpha*alpha*pi*pi*sin(alpha*pi*x)
    vars = 'alpha'
    vals = '4'
  [../]

  [./u_func]
    type = ParsedGradFunction
    value = sin(alpha*pi*x)
    grad_x = alpha*pi*sin(alpha*pi*x)
    vars = 'alpha'
    vals = '4'
  [../]
[]
(../../../SoftwareDownloads/moose/test/tests/postprocessors/mms_slope/mms_slope_test.i)

Input Parameters

  • execute_onLINEARThe list of flag(s) indicating when this object should be executed, the available options include NONE, INITIAL, LINEAR, NONLINEAR, TIMESTEP_END, TIMESTEP_BEGIN, FINAL, CUSTOM, ALWAYS.

    Default:LINEAR

    C++ Type:ExecFlagEnum

    Options:NONE, INITIAL, LINEAR, NONLINEAR, TIMESTEP_END, TIMESTEP_BEGIN, FINAL, CUSTOM, ALWAYS

    Controllable:No

    Description:The list of flag(s) indicating when this object should be executed, the available options include NONE, INITIAL, LINEAR, NONLINEAR, TIMESTEP_END, TIMESTEP_BEGIN, FINAL, CUSTOM, ALWAYS.

  • grad_x0Partial with respect to x.

    Default:0

    C++ Type:std::string

    Controllable:No

    Description:Partial with respect to x.

  • grad_y0Partial with respect to y.

    Default:0

    C++ Type:std::string

    Controllable:No

    Description:Partial with respect to y.

  • grad_z0Partial with respect to z.

    Default:0

    C++ Type:std::string

    Controllable:No

    Description:Partial with respect to z.

  • valsConstant numeric values, postprocessor names, or function names for vars.

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

    Controllable:No

    Description:Constant numeric values, postprocessor names, or function names for vars.

  • value0User defined function.

    Default:0

    C++ Type:std::string

    Controllable:No

    Description:User defined function.

  • varsVariables (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>

    Controllable:No

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

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