SolutionFunction

Function for reading a solution from file.

The solution is a variable in the file but the SolutionFunction makes it available as a function. The SolutionUserObject specified as the solution parameter is used to compute the variable values.

commentnote

The accuracy on the evaluation of this variable in various locations may be diminished by the solution file format. Exodus for example does not store higher order variables accurately.

Example input syntax

In this input file, we load in u_xda_func a reference solution for the problem, previously computed and stored in aux_nonlinear_solution_out_0001.xda, then compare it to the current solution u.

[Functions]
  [./u_xda_func]
    type = SolutionFunction
    solution = xda_u
  [../]
[]

[UserObjects]
  [./xda_u]
    type = SolutionUserObject
    system = nl0
    mesh = aux_nonlinear_solution_out_0001_mesh.xda
    es = aux_nonlinear_solution_out_0001.xda
    system_variables = u
    execute_on = initial
  [../]
[]

[Postprocessors]
  [./unorm]
    type = ElementL2Norm
    variable = u
  [../]
  [./uerror]
    type = ElementL2Error
    variable = u
    function = u_xda_func
  [../]
[]
(test/tests/auxkernels/solution_aux/thread_xda.i)

Input Parameters

  • solutionThe SolutionUserObject to extract data from.

    C++ Type:UserObjectName

    Controllable:No

    Description:The SolutionUserObject to extract data from.

Required Parameters

  • add_factor0Add this value (b) to the solution (x): ax+b, where a is the 'scale_factor'

    Default:0

    C++ Type:double

    Controllable:No

    Description:Add this value (b) to the solution (x): ax+b, where a is the 'scale_factor'

  • execute_onLINEARThe list of flag(s) indicating when this object should be executed, the available options include FORWARD, ADJOINT, HOMOGENEOUS_FORWARD, ADJOINT_TIMESTEP_BEGIN, ADJOINT_TIMESTEP_END, NONE, INITIAL, LINEAR, NONLINEAR, POSTCHECK, TIMESTEP_END, TIMESTEP_BEGIN, MULTIAPP_FIXED_POINT_END, MULTIAPP_FIXED_POINT_BEGIN, FINAL, CUSTOM.

    Default:LINEAR

    C++ Type:ExecFlagEnum

    Options:FORWARD, ADJOINT, HOMOGENEOUS_FORWARD, ADJOINT_TIMESTEP_BEGIN, ADJOINT_TIMESTEP_END, NONE, INITIAL, LINEAR, NONLINEAR, POSTCHECK, TIMESTEP_END, TIMESTEP_BEGIN, MULTIAPP_FIXED_POINT_END, MULTIAPP_FIXED_POINT_BEGIN, FINAL, CUSTOM

    Controllable:No

    Description:The list of flag(s) indicating when this object should be executed, the available options include FORWARD, ADJOINT, HOMOGENEOUS_FORWARD, ADJOINT_TIMESTEP_BEGIN, ADJOINT_TIMESTEP_END, NONE, INITIAL, LINEAR, NONLINEAR, POSTCHECK, TIMESTEP_END, TIMESTEP_BEGIN, MULTIAPP_FIXED_POINT_END, MULTIAPP_FIXED_POINT_BEGIN, FINAL, CUSTOM.

  • from_variableThe name of the variable in the file that is to be extracted

    C++ Type:std::string

    Controllable:No

    Description:The name of the variable in the file that is to be extracted

  • scale_factor1Scale factor (a) to be applied to the solution (x): ax+b, where b is the 'add_factor'

    Default:1

    C++ Type:double

    Controllable:No

    Description:Scale factor (a) to be applied to the solution (x): ax+b, where b is the 'add_factor'

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