- default_valueValue to replace in data when sample is not evaluated.
C++ Type:double
Unit:(no unit assumed)
Controllable:No
Description:Value to replace in data when sample is not evaluated.
- functionfunction expression that should evaluate to 0 if sample should NOT be evaluated.
C++ Type:FunctionExpression
Unit:(no unit assumed)
Controllable:No
Description:function expression that should evaluate to 0 if sample should NOT be evaluated.
- samplerThe sampler used to produce data.
C++ Type:SamplerName
Controllable:No
Description:The sampler used to produce data.
ConditionalSampleReporter
Evaluates parsed function to determine if sample needs to be evaluated, otherwise data is set to a default value.
Description
This object is a type of StochasticReporter, so it can be used in to transfer reporters into using SamplerReporterTransfer. This object is mainly meant for demonstration for eventual active learning algorithms, but could prove useful. Basically, it enables a inputted function to determine if a multiapp solve is "possible" based on sampler values. The parsed function inputted with the parameter "function" should evaluate to 0 or false
if multiapp run is not possible/necessary. The variables within the function should be associated with a sampler column, which is defined by the pair of parameters "sampler_vars" and "sampler_var_indices". If the inputted function evaluates to 0 or false
, the quantity being transferred to this object using SamplerReporterTransfer with be replaced with "default_value".
Example Input Syntax
An example usage of this reporter is to ensure that the sampler values are positive. For demonstration, the following makes sure that the sampler value is greater-than or equal to the current simulation time. If it isn't, the multiapp is not run and the transferred quantity is replaced with a value of 1.0
.
[MultiApps<<<{"href": "../../syntax/MultiApps/index.html"}>>>]
[runner]
type = SamplerFullSolveMultiApp<<<{"description": "Creates a full-solve type sub-application for each row of each Sampler matrix.", "href": "../multiapps/SamplerFullSolveMultiApp.html"}>>>
sampler<<<{"description": "The Sampler object to utilize for creating MultiApps."}>>> = cart
input_files<<<{"description": "The input file for each App. If this parameter only contains one input file it will be used for all of the Apps. When using 'positions_from_file' it is also admissable to provide one input_file per file."}>>> = 'sub.i'
mode<<<{"description": "The operation mode, 'normal' creates one sub-application for each row in the Sampler and 'batch-reset' and 'batch-restore' creates N sub-applications, where N is the minimum of 'num_rows' in the Sampler and floor(number of processes / min_procs_per_app). To run the rows in the Sampler, 'batch-reset' will destroy and re-create sub-apps as needed, whereas the 'batch-restore' will backup and restore sub-apps to the initial state prior to execution, without destruction."}>>> = batch-reset
should_run_reporter<<<{"description": "Vector reporter value determining whether a certain multiapp should be run with this multiapp. This only works in batch-reset or batch-restore mode."}>>> = conditional/need_sample
[]
[]
[Transfers<<<{"href": "../../syntax/Transfers/index.html"}>>>]
[data]
type = SamplerReporterTransfer<<<{"description": "Transfers data from Reporters on the sub-application to a StochasticReporter on the main application.", "href": "../transfers/SamplerReporterTransfer.html"}>>>
from_multi_app<<<{"description": "The name of the MultiApp to receive data from"}>>> = runner
sampler<<<{"description": "A the Sampler object that Transfer is associated.."}>>> = cart
from_reporter<<<{"description": "The name(s) of the Reporter(s) on the sub-app to transfer from."}>>> = 'average/value'
stochastic_reporter<<<{"description": "The name of the StochasticReporter object to transfer values to."}>>> = conditional
[]
[]
[Reporters<<<{"href": "../../syntax/Reporters/index.html"}>>>]
[conditional]
type = ConditionalSampleReporter<<<{"description": "Evaluates parsed function to determine if sample needs to be evaluated, otherwise data is set to a default value.", "href": "ConditionalSampleReporter.html"}>>>
sampler<<<{"description": "The sampler used to produce data."}>>> = cart
default_value<<<{"description": "Value to replace in data when sample is not evaluated."}>>> = 999
function<<<{"description": "function expression that should evaluate to 0 if sample should NOT be evaluated."}>>> = 'val1 * val2 >= t'
sampler_vars<<<{"description": "Vector of variables defined by sampler values."}>>> = 'val1 val2'
sampler_var_indices<<<{"description": "Vector of indices defining the sampler column index associated with the variables in 'sampler_vars'."}>>> = '0 1'
parallel_type<<<{"description": "This parameter will determine how the stochastic data is gathered. It is common for outputting purposes that this parameter be set to ROOT, otherwise, many files will be produced showing the values on each processor. However, if there are lot of samples, gathering on root may be memory restrictive."}>>> = ROOT
execute_on<<<{"description": "The list of flag(s) indicating when this object should be executed. For a description of each flag, see https://mooseframework.inl.gov/source/interfaces/SetupInterface.html."}>>> = 'initial timestep_begin'
[]
[]
(moose/modules/stochastic_tools/test/tests/multiapps/conditional_run/conditional_main.i)Input Parameters
- epsilon0Fuzzy comparison tolerance
Default:0
C++ Type:double
Unit:(no unit assumed)
Controllable:No
Description:Fuzzy comparison tolerance
- parallel_typeDISTRIBUTEDThis parameter will determine how the stochastic data is gathered. It is common for outputting purposes that this parameter be set to ROOT, otherwise, many files will be produced showing the values on each processor. However, if there are lot of samples, gathering on root may be memory restrictive.
Default:DISTRIBUTED
C++ Type:MooseEnum
Controllable:No
Description:This parameter will determine how the stochastic data is gathered. It is common for outputting purposes that this parameter be set to ROOT, otherwise, many files will be produced showing the values on each processor. However, if there are lot of samples, gathering on root may be memory restrictive.
- sampler_var_indicesVector of indices defining the sampler column index associated with the variables in 'sampler_vars'.
C++ Type:std::vector<unsigned int>
Controllable:No
Description:Vector of indices defining the sampler column index associated with the variables in 'sampler_vars'.
- sampler_varsVector of variables defined by sampler values.
C++ Type:std::vector<std::string>
Controllable:No
Description:Vector of variables defined by sampler values.
- use_timeTrueMake time (t) variable available in the function expression.
Default:True
C++ Type:bool
Controllable:No
Description:Make time (t) variable available in the function expression.
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
Controllable:No
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).
- execute_onTIMESTEP_ENDThe list of flag(s) indicating when this object should be executed. For a description of each flag, see https://mooseframework.inl.gov/source/interfaces/SetupInterface.html.
Default:TIMESTEP_END
C++ Type:ExecFlagEnum
Controllable:No
Description:The list of flag(s) indicating when this object should be executed. For a description of each flag, see https://mooseframework.inl.gov/source/interfaces/SetupInterface.html.
- execution_order_group0Execution order groups are executed in increasing order (e.g., the lowest number is executed first). Note that negative group numbers may be used to execute groups before the default (0) group. Please refer to the user object documentation for ordering of user object execution within a group.
Default:0
C++ Type:int
Controllable:No
Description:Execution order groups are executed in increasing order (e.g., the lowest number is executed first). Note that negative group numbers may be used to execute groups before the default (0) group. Please refer to the user object documentation for ordering of user object execution within a group.
- force_postauxFalseForces the UserObject to be executed in POSTAUX
Default:False
C++ Type:bool
Controllable:No
Description:Forces the UserObject to be executed in POSTAUX
- force_preauxFalseForces the UserObject to be executed in PREAUX
Default:False
C++ Type:bool
Controllable:No
Description:Forces the UserObject to be executed in PREAUX
- force_preicFalseForces the UserObject to be executed in PREIC during initial setup
Default:False
C++ Type:bool
Controllable:No
Description:Forces the UserObject to be executed in PREIC during initial setup
Execution Scheduling 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:Yes
Description:Set the enabled status of the MooseObject.
- outputsVector of output names where you would like to restrict the output of variables(s) associated with this object
C++ Type:std::vector<OutputName>
Controllable:No
Description:Vector of output names where you would like to restrict the output of variables(s) associated with this object
- 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
Controllable:No
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
- disable_fpoptimizerFalseDisable the function parser algebraic optimizer
Default:False
C++ Type:bool
Controllable:No
Description:Disable the function parser algebraic optimizer
- enable_ad_cacheTrueEnable caching of function derivatives for faster startup time
Default:True
C++ Type:bool
Controllable:No
Description:Enable caching of function derivatives for faster startup time
- enable_auto_optimizeTrueEnable automatic immediate optimization of derivatives
Default:True
C++ Type:bool
Controllable:No
Description:Enable automatic immediate optimization of derivatives
- enable_jitTrueEnable just-in-time compilation of function expressions for faster evaluation
Default:True
C++ Type:bool
Controllable:No
Description:Enable just-in-time compilation of function expressions for faster evaluation
- evalerror_behaviornanWhat to do if evaluation error occurs. Options are to pass a nan, pass a nan with a warning, throw a error, or throw an exception
Default:nan
C++ Type:MooseEnum
Controllable:No
Description:What to do if evaluation error occurs. Options are to pass a nan, pass a nan with a warning, throw a error, or throw an exception
Parsed Expression Advanced Parameters
- prop_getter_suffixAn optional suffix parameter that can be appended to any attempt to retrieve/get material properties. The suffix will be prepended with a '_' character.
C++ Type:MaterialPropertyName
Unit:(no unit assumed)
Controllable:No
Description:An optional suffix parameter that can be appended to any attempt to retrieve/get material properties. The suffix will be prepended with a '_' character.
- use_interpolated_stateFalseFor the old and older state use projected material properties interpolated at the quadrature points. To set up projection use the ProjectedStatefulMaterialStorageAction.
Default:False
C++ Type:bool
Controllable:No
Description:For the old and older state use projected material properties interpolated at the quadrature points. To set up projection use the ProjectedStatefulMaterialStorageAction.