MultiAppSamplerControl

Control for modifying the command line arguments of MultiApps.

Description

Depending on the type of stochastic analysis being performed, it may be necessary to pass command line arguments to the MultiApp objects being created. For example, if a the domain is required to be altered statistically in the x-direction the Mesh/xmax parameter in the sub-application must be altered. However, this value cannot be altered from within sub-application input file via a Control object because the xmax parameter is applied to the mesh when it is created. In this case, the MultiAppSamplerControl can be used to pass custom values to the arguments of a MultiApp that are generated from Sampler and Distribution objects.

Example Use

Consider a stochastic problem that is executing 3 simulations, but those simulations require the maximum x and y coordinates of a generated mesh be varied between 5 and 10.

First, the MultiApps block is defined to execute the desired simulations.

[Distributions]
  [uniform]
    type = Uniform
    lower_bound = 5
    upper_bound = 10
  []
[]
(contrib/moose/modules/stochastic_tools/test/tests/multiapps/commandline_control/parent_multiple.i)

Second, a Uniform distribution object must be created:

[Distributions]
  [uniform]
    type = Uniform
    lower_bound = 5
    upper_bound = 10
  []
[]
(contrib/moose/modules/stochastic_tools/test/tests/multiapps/commandline_control/parent_multiple.i)

A sampling scheme must be defined for capturing values from the uniform distribution. In this example, since there are two pieces of data to be controlled ("xmax" and "ymax") the uniform distribution is sampled twice. Since this sampled data will only be used during "PRE_MULTIAPP_SETUP" execution, so the "execute_on" parameter is setup to match.

[Samplers]
  [sample]
    type = MonteCarlo
    num_rows = 3
    distributions = 'uniform uniform'
    execute_on = 'PRE_MULTIAPP_SETUP'
  []
[]
(contrib/moose/modules/stochastic_tools/test/tests/multiapps/commandline_control/parent_multiple.i)

Finally, the MultiAppSamplerControl is used to apply the sampled data to the desired Mesh settings.

[Controls]
  [cmdline]
    type = MultiAppSamplerControl
    multi_app = sub
    sampler = sample
    param_names = 'Mesh/xmax Mesh/ymax'
  []
[]
(contrib/moose/modules/stochastic_tools/test/tests/multiapps/commandline_control/parent_multiple.i)

Vector Parameter

The vector parameter can be altered statistically with MultiAppSamplerControl. To illustrate its usage, we consider an input file listed below:

[Controls]
  [cmdline]
    type = MultiAppSamplerControl
    multi_app = sub
    sampler = sample
    param_names = 'Mesh/xmax[0] Materials/const/prop_values[1,(1.5),2,2] Mesh/ymax[3]'
  []
[]
(contrib/moose/modules/stochastic_tools/test/tests/multiapps/batch_commandline_control/parent_vector.i)

In this input file, the param_names includes a vector parameter with 4 entries called Materials/const/prop_values and two scalar parameters called Mesh/xmax and Mesh/ymax.

Several cases exist for modifying the vector parameter:

  1. All four entries will be altered: set param_names = Materials/const/prop_values[0,1,2,3]. The [0,1,2,3] is the global column index of the provided distributions which implies that each entry corresponds to a different distribution.

  2. The third and fourth entry will be altered with a same distribution: set param_names = Materials/const/prop_values[0,1,2,2]. The repeated index "2" means that their values are the same and will be sampled from a same distribution.

  3. The second entry will not be altered: set param_names = Materials/const/prop_values[0,(0.5),1,2]. In this case, the second entry will be set as 0.5 while the first, third and last entries will be altered statistically. In general, a constant value will be provided inside the parentheses bracket.

commentnote

If [] is used, it must be provided to every parameter. By default, if the [] is not provided it is assumed that values are scalar and captured in order.

Input Parameters

  • multi_appThe name of the MultiApp to control.

    C++ Type:MultiAppName

    Unit:(no unit assumed)

    Controllable:No

    Description:The name of the MultiApp to control.

  • param_namesThe names of the command line parameters to set via the sampled data.

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

    Unit:(no unit assumed)

    Controllable:No

    Description:The names of the command line parameters to set via the sampled data.

  • samplerThe Sampler object to utilize for altering the command line options of the MultiApp.

    C++ Type:SamplerName

    Unit:(no unit assumed)

    Controllable:No

    Description:The Sampler object to utilize for altering the command line options of the MultiApp.

Required Parameters

  • depends_onThe Controls that this control relies upon (i.e. must execute before this one)

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

    Unit:(no unit assumed)

    Controllable:No

    Description:The Controls that this control relies upon (i.e. must execute before this one)

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.

  • implicitTrueDetermines whether this object is calculated using an implicit or explicit form

    Default:True

    C++ Type:bool

    Unit:(no unit assumed)

    Controllable:No

    Description:Determines whether this object is calculated using an implicit or explicit form

Advanced Parameters

References

No citations exist within this document.