PostprocessorSpatialUserObject

The PostprocessorSpatialUserObject stores a postprocessor value inside a user object such that it gains a spatial position and can be used via spatialValue() API. This can be useful in a multi-app setup when we need to transfer postprocessor values from sub apps and have them live at a position where the sub-app exists.

Example of a Multi-App Setup

[Mesh]
  type = GeneratedMesh
  dim = 2
  nx = 4
  ny = 4
[]

[Functions]
  [./ic_fn]
    type = ParsedFunction
    value = 'x * y'
  [../]
[]

[Variables]
  [./u]
    family = LAGRANGE
    order = FIRST
  [../]
[]

[ICs]
  [./u_ic]
    type = FunctionIC
    variable = u
    function = ic_fn
  [../]

  [./a_ic]
    type = ConstantIC
    variable = a
    value = 1
  [../]
[]

[AuxVariables]
  [./a]
  [../]
[]

[Kernels]
  [./td]
    type = TimeDerivative
    variable = u
  [../]
  [./rhs]
    type = BodyForce
    variable = u
    function = 1
  [../]
[]

[MultiApps]
  [./sub]
    type = TransientMultiApp
    app_type = MooseTestApp
    input_files = 'sub.i'
    positions = '
      0.25 0.25 0
      0.75 0.75 0'
    execute_on = 'initial timestep_end'
  [../]
[]

[Transfers]
  [./master_to_sub]
    type = MultiAppNearestNodeTransfer
    direction = to_multiapp
    multi_app = sub
    source_variable = u
    variable = a
  [../]

  [./sub_to_master]
    type = MultiAppUserObjectTransfer
    direction = from_multiapp
    multi_app = sub
    user_object = fn_uo
    variable = a
  [../]
[]

[Executioner]
  type = Transient
  dt = 0.1
  num_steps = 10
[]

[Outputs]
  exodus = true
[]
(test/tests/userobjects/postprocessor_spatial_user_object/master.i)
[Mesh]
  type = GeneratedMesh
  dim = 1
  xmin = -0.01
  xmax = 0.01
[]

[Functions]
  [./fn]
    type = ParsedFunction
    value = 'if(a < 0.8625, 1, 0)'
    vars = 'a'
    vals = 'a_avg'
  [../]
[]

[Variables]
  [./u]
    family = MONOMIAL
    order = CONSTANT
  [../]
[]

[AuxVariables]
  [./a]
    family = MONOMIAL
    order = CONSTANT
  [../]
[]

[Kernels]
  [./td]
    type = TimeDerivative
    variable = u
  [../]
  [./rhs]
    type = BodyForce
    variable = u
    function = 1
  [../]
[]

[Postprocessors]
  [./fn_pps]
    type = FunctionValuePostprocessor
    function = fn
    execute_on = 'initial timestep_end'
  [../]

  [./a_avg]
    type = ElementAverageValue
    variable = a
  [../]
[]

[UserObjects]
  [./fn_uo]
    type = PostprocessorSpatialUserObject
    postprocessor = fn_pps
  [../]
[]

[Executioner]
  type = Transient
  dt = 0.1
[]
(test/tests/userobjects/postprocessor_spatial_user_object/sub.i)

Input Parameters

  • postprocessorThe name of the postprocessor

    C++ Type:PostprocessorName

    Options:

    Description:The name of the postprocessor

Required Parameters

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

    Default:TIMESTEP_END

    C++ Type:ExecFlagEnum

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

    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.

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

    Options:

    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>

    Options:

    Description:Adds user-defined labels for accessing object parameters via control logic.

  • enableTrueSet the enabled status of the MooseObject.

    Default:True

    C++ Type:bool

    Options:

    Description:Set the enabled status of the MooseObject.

  • force_preauxFalseForces the GeneralUserObject to be executed in PREAUX

    Default:False

    C++ Type:bool

    Options:

    Description:Forces the GeneralUserObject to be executed in PREAUX

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

    Default:False

    C++ Type:bool

    Options:

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

  • 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

    Options:

    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

Input Files