- distributionsThe distribution names to be sampled, the number of distributions provided defines the number of columns per matrix.
C++ Type:std::vector<DistributionName>
Controllable:No
Description:The distribution names to be sampled, the number of distributions provided defines the number of columns per matrix.
- num_rowsThe size of the square matrix to generate.
C++ Type:unsigned long
Controllable:No
Description:The size of the square matrix to generate.
LatinHypercube
Latin Hypercube Sampler.
Overview
This sampler implements the Latin hypercube strategy presented in McKay et al. (1979) as:
If we wish to ensure also that each of the input variables has all portions of its distribution represented by input values, we can divide the range of each into strata of equal marginal probability , and sample once from each stratum. Let this sample be . These form the , component, , in . The components of the various 's are matched at random.
Example Input File Syntax
The following input file creates a Latin hypercube sample from two uniform distributions with 10 samples of each distribution.
[Distributions]
[a]
type = Uniform
lower_bound = 100
upper_bound = 200
[]
[b]
type = Uniform
lower_bound = 10
upper_bound = 20
[]
[]
[Samplers]
[sample]
type = LatinHypercube
distributions = 'a b'
num_rows = 10
seed = 1980
execute_on = 'INITIAL TIMESTEP_END'
[]
[]
(modules/stochastic_tools/test/tests/samplers/latin_hypercube/latin_hypercube.i)The graph in Figure 1 show the Latin hypercube sample generated from the input file snippet where the grid lines are defined with the associated probability based bins.
Input Parameters
- 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, PRE_MULTIAPP_SETUP
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.
- limit_get_global_samples429496729The maximum allowed number of items in the DenseMatrix returned by getGlobalSamples method.
Default:429496729
C++ Type:unsigned long
Controllable:No
Description:The maximum allowed number of items in the DenseMatrix returned by getGlobalSamples method.
- limit_get_local_samples429496729The maximum allowed number of items in the DenseMatrix returned by getLocalSamples method.
Default:429496729
C++ Type:unsigned long
Controllable:No
Description:The maximum allowed number of items in the DenseMatrix returned by getLocalSamples method.
- limit_get_next_local_row429496729The maximum allowed number of items in the std::vector returned by getNextLocalRow method.
Default:429496729
C++ Type:unsigned long
Controllable:No
Description:The maximum allowed number of items in the std::vector returned by getNextLocalRow method.
- max_procs_per_row4294967295This will ensure that the sampler is partitioned properly when 'MultiApp/*/max_procs_per_app' is specified. It is not recommended to use otherwise.
Default:4294967295
C++ Type:unsigned int
Controllable:No
Description:This will ensure that the sampler is partitioned properly when 'MultiApp/*/max_procs_per_app' is specified. It is not recommended to use otherwise.
- min_procs_per_row1This will ensure that the sampler is partitioned properly when 'MultiApp/*/min_procs_per_app' is specified. It is not recommended to use otherwise.
Default:1
C++ Type:unsigned int
Controllable:No
Description:This will ensure that the sampler is partitioned properly when 'MultiApp/*/min_procs_per_app' is specified. It is not recommended to use otherwise.
- seed0Random number generator initial seed
Default:0
C++ Type:unsigned int
Controllable:No
Description:Random number generator initial seed
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
- (modules/stochastic_tools/examples/surrogates/polynomial_regression/normal_surr.i)
- (modules/stochastic_tools/examples/surrogates/pod_rb/2d_multireg/trainer.i)
- (modules/stochastic_tools/test/tests/surrogates/pod_rb/errors/trainer_and_surr.i)
- (modules/stochastic_tools/examples/parameter_study/main.i)
- (modules/stochastic_tools/examples/sobol/main.i)
- (modules/stochastic_tools/examples/parameter_study/main_time.i)
- (modules/stochastic_tools/test/tests/surrogates/cross_validation/poly_reg_vec.i)
- (modules/combined/examples/stochastic/lhs_uniform.i)
- (modules/stochastic_tools/examples/surrogates/cross_validation/all_trainers_uniform_cv.i)
- (modules/stochastic_tools/examples/surrogates/combined/trans_diff_2d/trans_diff_main.i)
- (modules/stochastic_tools/examples/surrogates/combined/trans_diff_2d/trans_diff_surr.i)
- (modules/stochastic_tools/test/tests/surrogates/pod_rb/boundary/surr.i)
- (modules/stochastic_tools/test/tests/surrogates/pod_rb/internal/surr.i)
- (modules/stochastic_tools/examples/surrogates/pod_rb/2d_multireg/full_order.i)
- (modules/stochastic_tools/examples/parameter_study/nonlin_diff_react/nonlin_diff_react_parent_uniform.i)
- (modules/stochastic_tools/test/tests/surrogates/pod_rb/internal/trainer.i)
- (modules/stochastic_tools/examples/parameter_study/main_vector.i)
- (modules/stochastic_tools/examples/surrogates/pod_rb/2d_multireg/surr.i)
- (modules/stochastic_tools/test/tests/surrogates/pod_rb/errors/trainer.i)
- (modules/stochastic_tools/examples/surrogates/polynomial_regression/uniform_train.i)
- (modules/stochastic_tools/test/tests/surrogates/polynomial_regression/poly_reg_vec.i)
- (modules/stochastic_tools/examples/surrogates/polynomial_regression/uniform_surr.i)
- (modules/stochastic_tools/examples/parameter_study/nonlin_diff_react/nonlin_diff_react_parent_normal.i)
- (modules/stochastic_tools/test/tests/surrogates/nearest_point/np_vec.i)
- (modules/stochastic_tools/test/tests/surrogates/pod_rb/internal/trainer_and_surr.i)
- (modules/stochastic_tools/examples/surrogates/polynomial_regression/normal_train.i)
- (modules/stochastic_tools/test/tests/samplers/latin_hypercube/latin_hypercube.i)
- (modules/stochastic_tools/test/tests/surrogates/pod_rb/boundary/trainer.i)
References
- Michael D McKay, Richard J Beckman, and William J Conover.
Comparison of three methods for selecting values of input variables in the analysis of output from a computer code.
Technometrics, 21(2):239–245, 1979.[BibTeX]
@article{mckay1979comparison, author = "McKay, Michael D and Beckman, Richard J and Conover, William J", title = "Comparison of three methods for selecting values of input variables in the analysis of output from a computer code", journal = "Technometrics", volume = "21", number = "2", pages = "239--245", year = "1979", publisher = "Taylor \\& Francis" }
(modules/stochastic_tools/test/tests/samplers/latin_hypercube/latin_hypercube.i)
[StochasticTools]
[]
[Distributions]
[a]
type = Uniform
lower_bound = 100
upper_bound = 200
[]
[b]
type = Uniform
lower_bound = 10
upper_bound = 20
[]
[]
[Samplers]
[sample]
type = LatinHypercube
distributions = 'a b'
num_rows = 10
seed = 1980
execute_on = 'INITIAL TIMESTEP_END'
[]
[]
[VectorPostprocessors]
[data]
type = SamplerData
sampler = sample
sampler_method = get_global_samples
execute_on = 'INITIAL TIMESTEP_END'
[]
[]
[Outputs]
execute_on = 'INITIAL TIMESTEP_END'
csv = true
[]
(modules/stochastic_tools/examples/surrogates/polynomial_regression/normal_surr.i)
[StochasticTools]
[]
[Distributions]
[k_dist]
type = Normal
mean = 5
standard_deviation = 2
[]
[q_dist]
type = Normal
mean = 10000
standard_deviation = 500
[]
[L_dist]
type = Normal
mean = 0.03
standard_deviation = 0.01
[]
[Tinf_dist]
type = Normal
mean = 300
standard_deviation = 10
[]
[]
[Samplers]
[sample]
type = LatinHypercube
num_rows = 100000
distributions = 'k_dist q_dist L_dist Tinf_dist'
[]
[]
[Surrogates]
[pc_max]
type = PolynomialChaos
filename = 'normal_train_pc_out_pc_max.rd'
[]
[pr_max]
type = PolynomialRegressionSurrogate
filename = 'normal_train_pr_out_pr_max.rd'
[]
[]
[Reporters]
[pc_max_res]
type = EvaluateSurrogate
model = pc_max
sampler = sample
parallel_type = ROOT
[]
[pr_max_res]
type = EvaluateSurrogate
model = pr_max
sampler = sample
parallel_type = ROOT
[]
[pr_max_stats]
type = StatisticsReporter
reporters = 'pr_max_res/pr_max'
compute = 'mean stddev'
[]
[pc_max_stats]
type = PolynomialChaosReporter
pc_name = 'pc_max'
statistics = 'mean stddev'
[]
[]
[Outputs]
[out]
type = JSON
execute_on = timestep_end
[]
[]
(modules/stochastic_tools/examples/surrogates/pod_rb/2d_multireg/trainer.i)
[StochasticTools]
[]
[Distributions]
[D012_dist]
type = Uniform
lower_bound = 0.2
upper_bound = 0.8
[]
[D1_dist]
type = Uniform
lower_bound = 0.2
upper_bound = 0.8
[]
[D2_dist]
type = Uniform
lower_bound = 0.2
upper_bound = 0.8
[]
[D3_dist]
type = Uniform
lower_bound = 0.15
upper_bound = 0.6
[]
[absxs0_dist]
type = Uniform
lower_bound = 0.0425
upper_bound = 0.17
[]
[absxs1_dist]
type = Uniform
lower_bound = 0.065
upper_bound = 0.26
[]
[absxs2_dist]
type = Uniform
lower_bound = 0.04
upper_bound = 0.16
[]
[absxs3_dist]
type = Uniform
lower_bound = 0.005
upper_bound = 0.02
[]
[src_dist]
type = Uniform
lower_bound = 5
upper_bound = 20
[]
[]
[Samplers]
[sample]
type = LatinHypercube
distributions = 'D012_dist D012_dist D012_dist D3_dist
absxs0_dist absxs1_dist absxs2_dist absxs3_dist
src_dist src_dist src_dist'
num_rows = 100
execute_on = PRE_MULTIAPP_SETUP
max_procs_per_row = 1
[]
[]
[MultiApps]
[sub]
type = PODFullSolveMultiApp
input_files = sub.i
sampler = sample
trainer_name = 'pod_rb'
execute_on = 'timestep_begin final'
max_procs_per_app = 1
[]
[]
[Transfers]
[param]
type = SamplerParameterTransfer
to_multi_app = sub
sampler = sample
parameters = 'Materials/D0/prop_values
Materials/D1/prop_values
Materials/D2/prop_values
Materials/D3/prop_values
Materials/absxs0/prop_values
Materials/absxs1/prop_values
Materials/absxs2/prop_values
Materials/absxs3/prop_values
Kernels/src0/value
Kernels/src1/value
Kernels/src2/value'
execute_on = 'timestep_begin'
check_multiapp_execute_on = false
[]
[data]
type = PODSamplerSolutionTransfer
from_multi_app = sub
sampler = sample
trainer_name = 'pod_rb'
execute_on = 'timestep_begin'
check_multiapp_execute_on = false
[]
[mode]
type = PODSamplerSolutionTransfer
to_multi_app = sub
sampler = sample
trainer_name = 'pod_rb'
execute_on = 'final'
check_multiapp_execute_on = false
[]
[res]
type = PODResidualTransfer
from_multi_app = sub
sampler = sample
trainer_name = 'pod_rb'
execute_on = 'final'
check_multiapp_execute_on = false
[]
[]
[Trainers]
[pod_rb]
type = PODReducedBasisTrainer
var_names = 'psi'
error_res = '1e-9'
tag_names = 'diff0 diff1 diff2 diff3 abs0 abs1 abs2 abs3 src0 src1 src2'
tag_types = 'op op op op op op op op src src src'
execute_on = 'timestep_begin final'
[]
[]
[Outputs]
[out]
type = SurrogateTrainerOutput
trainers = 'pod_rb'
execute_on = FINAL
[]
[]
(modules/stochastic_tools/test/tests/surrogates/pod_rb/errors/trainer_and_surr.i)
[StochasticTools]
[]
[Distributions]
[k_dist]
type = Uniform
lower_bound = 2.5
upper_bound = 7.5
[]
[alpha_dist]
type = Uniform
lower_bound = 2.5
upper_bound = 7.5
[]
[S_dist]
type = Uniform
lower_bound = 2.5
upper_bound = 7.5
[]
[]
[Samplers]
[train_sample]
type = LatinHypercube
distributions = 'k_dist alpha_dist S_dist'
num_rows = 3
execute_on = PRE_MULTIAPP_SETUP
max_procs_per_row = 1
[]
[test_sample]
type = LatinHypercube
distributions = 'k_dist alpha_dist S_dist'
num_rows = 10
seed = 17
execute_on = PRE_MULTIAPP_SETUP
[]
[]
[MultiApps]
[sub]
type = PODFullSolveMultiApp
input_files = sub.i
sampler = train_sample
trainer_name = 'pod_rb'
execute_on = 'timestep_begin final'
max_procs_per_app = 1
[]
[]
[Transfers]
[quad]
type = SamplerParameterTransfer
to_multi_app = sub
sampler = train_sample
parameters = 'Materials/k/prop_values Materials/alpha/prop_values Kernels/source/value'
execute_on = 'timestep_begin'
check_multiapp_execute_on = false
[]
[data]
type = PODSamplerSolutionTransfer
from_multi_app = sub
sampler = train_sample
trainer_name = 'pod_rb'
execute_on = 'timestep_begin'
check_multiapp_execute_on = false
[]
[mode]
type = PODSamplerSolutionTransfer
to_multi_app = sub
sampler = train_sample
trainer_name = 'pod_rb'
execute_on = 'final'
check_multiapp_execute_on = false
[]
[res]
type = PODResidualTransfer
from_multi_app = sub
sampler = train_sample
trainer_name = "pod_rb"
execute_on = 'final'
check_multiapp_execute_on = false
[]
[]
[Trainers]
[pod_rb]
type = PODReducedBasisTrainer
var_names = 'u'
error_res = '1e-9'
tag_names = 'diff react bodyf'
tag_types = 'op op src'
execute_on = 'timestep_begin final'
[]
[]
[Surrogates]
[rbpod]
type = PODReducedBasisSurrogate
trainer = pod_rb
[]
[]
[VectorPostprocessors]
[res]
type = PODSurrogateTester
model = rbpod
sampler = test_sample
variable_name = "u"
to_compute = nodal_max
execute_on = 'final'
[]
[]
(modules/stochastic_tools/examples/parameter_study/main.i)
[StochasticTools]
[]
[Distributions]
[gamma]
type = Uniform
lower_bound = 0.5
upper_bound = 2.5
[]
[q_0]
type = Weibull
location = -110
scale = 20
shape = 1
[]
[T_0]
type = Normal
mean = 300
standard_deviation = 45
[]
[s]
type = Normal
mean = 100
standard_deviation = 25
[]
[]
[Samplers]
[hypercube]
type = LatinHypercube
num_rows = 5000
distributions = 'gamma q_0 T_0 s'
[]
[]
[MultiApps]
[runner]
type = SamplerFullSolveMultiApp
sampler = hypercube
input_files = 'diffusion.i'
mode = batch-restore
[]
[]
[Transfers]
[parameters]
type = SamplerParameterTransfer
to_multi_app = runner
sampler = hypercube
parameters = 'Materials/constant/prop_values Kernels/source/value BCs/right/value BCs/left/value'
[]
[results]
type = SamplerReporterTransfer
from_multi_app = runner
sampler = hypercube
stochastic_reporter = results
from_reporter = 'T_avg/value q_left/value'
[]
[]
[Reporters]
[results]
type = StochasticReporter
[]
[stats]
type = StatisticsReporter
reporters = 'results/results:T_avg:value results/results:q_left:value'
compute = 'mean stddev'
ci_method = 'percentile'
ci_levels = '0.05 0.95'
[]
[]
[Outputs]
execute_on = 'FINAL'
[out]
type = JSON
[]
[]
(modules/stochastic_tools/examples/sobol/main.i)
[StochasticTools]
[]
[Distributions]
[gamma]
type = Uniform
lower_bound = 0.5
upper_bound = 2.5
[]
[q_0]
type = Weibull
location = -110
scale = 20
shape = 1
[]
[T_0]
type = Normal
mean = 300
standard_deviation = 45
[]
[s]
type = Normal
mean = 100
standard_deviation = 25
[]
[]
[Samplers]
[hypercube_a]
type = LatinHypercube
num_rows = 10000
distributions = 'gamma q_0 T_0 s'
seed = 2011
[]
[hypercube_b]
type = LatinHypercube
num_rows = 10000
distributions = 'gamma q_0 T_0 s'
seed = 2013
[]
[sobol]
type = Sobol
sampler_a = hypercube_a
sampler_b = hypercube_b
[]
[]
[MultiApps]
[runner]
type = SamplerFullSolveMultiApp
sampler = sobol
input_files = 'diffusion.i'
mode = batch-restore
[]
[]
[Transfers]
[parameters]
type = SamplerParameterTransfer
to_multi_app = runner
sampler = sobol
parameters = 'Materials/constant/prop_values Kernels/source/value BCs/right/value BCs/left/value'
[]
[results]
type = SamplerReporterTransfer
from_multi_app = runner
sampler = sobol
stochastic_reporter = results
from_reporter = 'T_avg/value q_left/value'
[]
[]
[Reporters]
[results]
type = StochasticReporter
outputs = none
[]
[stats]
type = StatisticsReporter
reporters = 'results/results:T_avg:value results/results:q_left:value'
compute = 'mean'
ci_method = 'percentile'
ci_levels = '0.05 0.95'
[]
[sobol]
type = SobolReporter
sampler = sobol
reporters = 'results/results:T_avg:value results/results:q_left:value'
ci_levels = '0.05 0.95'
[]
[]
[Outputs]
execute_on = 'FINAL'
[out]
type = JSON
[]
[]
(modules/stochastic_tools/examples/parameter_study/main_time.i)
[StochasticTools]
[]
[Distributions]
[gamma]
type = Uniform
lower_bound = 0.5
upper_bound = 2.5
[]
[q_0]
type = Weibull
location = -110
scale = 20
shape = 1
[]
[T_0]
type = Normal
mean = 300
standard_deviation = 45
[]
[s]
type = Normal
mean = 100
standard_deviation = 25
[]
[]
[Samplers]
[hypercube]
type = LatinHypercube
num_rows = 5000
distributions = 'gamma q_0 T_0 s'
[]
[]
[MultiApps]
[runner]
type = SamplerTransientMultiApp
sampler = hypercube
input_files = 'diffusion_time.i'
mode = batch-restore
[]
[]
[Transfers]
[parameters]
type = SamplerParameterTransfer
to_multi_app = runner
sampler = hypercube
parameters = 'Materials/constant/prop_values Kernels/source/value BCs/right/value BCs/left/value'
[]
[results]
type = SamplerReporterTransfer
from_multi_app = runner
sampler = hypercube
stochastic_reporter = results
from_reporter = 'T_avg/value q_left/value T_vec/T'
[]
[x_transfer]
type = MultiAppReporterTransfer
from_multi_app = runner
subapp_index = 0
from_reporters = T_vec/x
to_reporters = const/x
[]
[]
[Reporters]
[results]
type = StochasticReporter
outputs = none
[]
[stats]
type = StatisticsReporter
reporters = 'results/results:T_avg:value results/results:q_left:value results/results:T_vec:T'
compute = 'mean stddev'
ci_method = 'percentile'
ci_levels = '0.05 0.95'
[]
[const]
type = ConstantReporter
real_vector_names = 'x'
real_vector_values = '0'
[]
[]
[Executioner]
type = Transient
num_steps = 4
dt = 0.25
[]
[Outputs]
execute_on = timestep_end
[out]
type = JSON
[]
[]
(modules/stochastic_tools/test/tests/surrogates/cross_validation/poly_reg_vec.i)
[StochasticTools]
[]
[Distributions]
[k_dist]
type = Normal
mean = 5
standard_deviation = 2
[]
[L_dist]
type = Normal
mean = 0.03
standard_deviation = 0.01
[]
[]
[Samplers]
[sample]
type = LatinHypercube
num_rows = 10
distributions = 'k_dist L_dist'
execute_on = PRE_MULTIAPP_SETUP
[]
[]
[GlobalParams]
sampler = sample
[]
[MultiApps]
[sub]
type = SamplerFullSolveMultiApp
input_files = sub_vector.i
mode = batch-reset
execute_on = initial
[]
[]
[Controls]
[cmdline]
type = MultiAppSamplerControl
multi_app = sub
param_names = 'Materials/conductivity/prop_values L'
[]
[]
[Transfers]
[data]
type = SamplerReporterTransfer
from_multi_app = sub
stochastic_reporter = results
from_reporter = 'T_vec/T T_vec/x'
[]
[]
[Reporters]
[results]
type = StochasticReporter
outputs = none
[]
[cv_scores]
type = CrossValidationScores
models = pr_surrogate
execute_on = FINAL
[]
[]
[Trainers]
[pr_trainer]
type = PolynomialRegressionTrainer
regression_type = "ols"
sampler = sample
response = results/data:T_vec:T
response_type = vector_real
execute_on = timestep_end
max_degree = 1
cv_type = "k_fold"
cv_splits = 2
cv_n_trials = 3
cv_surrogate = pr_surrogate
cv_seed = 1
[]
[]
[Surrogates]
[pr_surrogate]
type = PolynomialRegressionSurrogate
trainer = pr_trainer
[]
[]
[Outputs]
[out]
type = JSON
execute_on = FINAL
[]
[]
(modules/combined/examples/stochastic/lhs_uniform.i)
[StochasticTools]
[]
[Distributions]
[cond_inner]
type = Uniform
lower_bound = 20
upper_bound = 30
[]
[cond_outer]
type = Uniform
lower_bound = 90
upper_bound = 110
[]
[heat_source]
type = Uniform
lower_bound = 9000
upper_bound = 11000
[]
[alpha_inner]
type = Uniform
lower_bound = 1e-6
upper_bound = 3e-6
[]
[alpha_outer]
type = Uniform
lower_bound = 5e-7
upper_bound = 1.5e-6
[]
[ymod_inner]
type = Uniform
lower_bound = 2e5
upper_bound = 2.2e5
[]
[ymod_outer]
type = Uniform
lower_bound = 3e5
upper_bound = 3.2e5
[]
[prat_inner]
type = Uniform
lower_bound = 0.29
upper_bound = 0.31
[]
[prat_outer]
type = Uniform
lower_bound = 0.19
upper_bound = 0.21
[]
[]
[Samplers]
[sample]
type = LatinHypercube
num_rows = 100000
distributions = 'cond_inner cond_outer heat_source alpha_inner alpha_outer ymod_inner ymod_outer prat_inner prat_outer'
execute_on = INITIAL
[]
[]
[MultiApps]
[sub]
type = SamplerFullSolveMultiApp
input_files = graphite_ring_thermomechanics.i
sampler = sample
mode = batch-reset
[]
[]
[Transfers]
[sub]
type = SamplerParameterTransfer
to_multi_app = sub
sampler = sample
parameters = 'Materials/cond_inner/prop_values Materials/cond_outer/prop_values
Postprocessors/heat_source/scale_factor
Materials/thermal_strain_inner/thermal_expansion_coeff Materials/thermal_strain_outer/thermal_expansion_coeff
Materials/elasticity_tensor_inner/youngs_modulus Materials/elasticity_tensor_outer/youngs_modulus
Materials/elasticity_tensor_inner/poissons_ratio Materials/elasticity_tensor_outer/poissons_ratio'
check_multiapp_execute_on = false
[]
[data]
type = SamplerReporterTransfer
from_multi_app = sub
sampler = sample
stochastic_reporter = storage
from_reporter = 'temp_center_inner/value temp_center_outer/value temp_end_inner/value temp_end_outer/value
dispx_center_inner/value dispx_center_outer/value dispx_end_inner/value dispx_end_outer/value
dispz_inner/value dispz_outer/value'
[]
[]
[Reporters]
[storage]
type = StochasticReporter
parallel_type = ROOT
[]
[stats]
type = StatisticsReporter
reporters = 'storage/data:temp_center_inner:value storage/data:temp_center_outer:value storage/data:temp_end_inner:value storage/data:temp_end_outer:value
storage/data:dispx_center_inner:value storage/data:dispx_center_outer:value storage/data:dispx_end_inner:value storage/data:dispx_end_outer:value
storage/data:dispz_inner:value storage/data:dispz_outer:value'
compute = 'mean stddev'
ci_method = 'percentile'
ci_levels = '0.05 0.95'
[]
[]
[Outputs]
[out]
type = JSON
[]
execute_on = TIMESTEP_END
[]
(modules/stochastic_tools/examples/surrogates/cross_validation/all_trainers_uniform_cv.i)
[StochasticTools]
[]
[GlobalParams]
sampler = cv_sampler
response = results/response_data:max:value
cv_type = "k_fold"
cv_splits = 5
cv_n_trials = 100
[]
[Distributions]
[k_dist]
type = Uniform
lower_bound = 1
upper_bound = 10
[]
[q_dist]
type = Uniform
lower_bound = 9000
upper_bound = 11000
[]
[L_dist]
type = Uniform
lower_bound = 0.01
upper_bound = 0.05
[]
[Tinf_dist]
type = Uniform
lower_bound = 290
upper_bound = 310
[]
[]
[Samplers]
[cv_sampler]
type = LatinHypercube
distributions = 'k_dist q_dist L_dist Tinf_dist'
num_rows = 1000
execute_on = PRE_MULTIAPP_SETUP
[]
[]
[MultiApps]
[cv_sub]
type = SamplerFullSolveMultiApp
input_files = all_sub.i
mode = batch-reset
[]
[]
[Controls]
[pr_cmdline]
type = MultiAppSamplerControl
multi_app = cv_sub
param_names = 'Materials/conductivity/prop_values Kernels/source/value Mesh/xmax BCs/right/value'
[]
[]
[Transfers]
[response_data]
type = SamplerReporterTransfer
from_multi_app = cv_sub
stochastic_reporter = results
from_reporter = 'max/value'
[]
[]
[Reporters]
[results]
type = StochasticReporter
outputs = none
[]
[cv_scores]
type = CrossValidationScores
models = 'pr_surr pc_surr np_surr gp_surr ann_surr'
execute_on = FINAL
[]
[]
[Trainers]
[pr_max]
type = PolynomialRegressionTrainer
regression_type = "ols"
max_degree = 3
cv_surrogate = "pr_surr"
execute_on = timestep_end
[]
[pc_max]
type = PolynomialChaosTrainer
order = 3
distributions = "k_dist q_dist L_dist Tinf_dist"
cv_surrogate = "pc_surr"
execute_on = timestep_end
[]
[np_max]
type = NearestPointTrainer
cv_surrogate = "np_surr"
execute_on = timestep_end
[]
[gp_max]
type = GaussianProcessTrainer
covariance_function = 'rbf'
standardize_params = 'true'
standardize_data = 'true'
cv_surrogate = "gp_surr"
execute_on = timestep_end
[]
[ann_max]
type = LibtorchANNTrainer
num_epochs = 100
num_batches = 5
num_neurons_per_layer = '64'
learning_rate = 1e-2
rel_loss_tol = 1e-4
filename = mynet.pt
read_from_file = false
print_epoch_loss = 0
activation_function = 'relu'
cv_surrogate = "ann_surr"
standardize_input = false
standardize_output = false
[]
[]
[Covariance]
[rbf]
type = SquaredExponentialCovariance
noise_variance = 3.79e-6
signal_variance = 1 #Use a signal variance of 1 in the kernel
length_factor = '5.34471 1.41191 5.90721 2.83723' #Select a length factor for each parameter
[]
[]
[Surrogates]
[pr_surr]
type = PolynomialRegressionSurrogate
trainer = pr_max
[]
[pc_surr]
type = PolynomialChaos
trainer = pc_max
[]
[np_surr]
type = NearestPointSurrogate
trainer = np_max
[]
[gp_surr]
type = GaussianProcess
trainer = gp_max
[]
[ann_surr]
type = LibtorchANNSurrogate
trainer = ann_max
[]
[]
[Outputs]
[out]
type = JSON
execute_on = FINAL
[]
[]
(modules/stochastic_tools/examples/surrogates/combined/trans_diff_2d/trans_diff_main.i)
[StochasticTools]
[]
[Distributions]
[C_dist]
type = Uniform
lower_bound = 0.01
upper_bound = 0.02
[]
[f_dist]
type = Uniform
lower_bound = 15
upper_bound = 25
[]
[init_dist]
type = Uniform
lower_bound = 270
upper_bound = 330
[]
[]
[Samplers]
[hypercube]
type = LatinHypercube
num_rows = 2000
distributions = 'C_dist f_dist init_dist'
execute_on = PRE_MULTIAPP_SETUP
[]
[]
[MultiApps]
[runner]
type = SamplerFullSolveMultiApp
sampler = hypercube
input_files = 'trans_diff_sub.i'
[]
[]
[Controls]
[cmdline]
type = MultiAppSamplerControl
multi_app = runner
sampler = hypercube
param_names = 'Materials/diff_coeff/constant_expressions Functions/src_func/vals Variables/T/initial_condition'
[]
[]
[Transfers]
[results]
type = SamplerPostprocessorTransfer
from_multi_app = runner
sampler = hypercube
to_vector_postprocessor = results
from_postprocessor = 'time_max time_min'
[]
[]
[VectorPostprocessors]
[results]
type = StochasticResults
[]
[]
[Reporters]
[stats]
type = StatisticsReporter
vectorpostprocessors = results
compute = 'mean stddev'
ci_method = 'percentile'
ci_levels = '0.05'
[]
[]
[Outputs]
csv = true
[]
(modules/stochastic_tools/examples/surrogates/combined/trans_diff_2d/trans_diff_surr.i)
[StochasticTools]
[]
[Distributions]
[C_dist]
type = Uniform
lower_bound = 0.01
upper_bound = 0.02
[]
[f_dist]
type = Uniform
lower_bound = 15
upper_bound = 25
[]
[init_dist]
type = Uniform
lower_bound = 270
upper_bound = 330
[]
[]
[Samplers]
[sample]
type = LatinHypercube
num_rows = 100000
distributions = 'C_dist f_dist init_dist'
execute_on = PRE_MULTIAPP_SETUP
[]
[]
[Surrogates]
[pc_min]
type = PolynomialChaos
filename = 'trans_diff_trainer_out_pc_min.rd'
[]
[pc_max]
type = PolynomialChaos
filename = 'trans_diff_trainer_out_pc_max.rd'
[]
[pr_min]
type = PolynomialRegressionSurrogate
filename = 'trans_diff_trainer_out_pr_min.rd'
[]
[pr_max]
type = PolynomialRegressionSurrogate
filename = 'trans_diff_trainer_out_pr_max.rd'
[]
[np_min]
type = NearestPointSurrogate
filename = 'trans_diff_trainer_out_np_min.rd'
[]
[np_max]
type = NearestPointSurrogate
filename = 'trans_diff_trainer_out_np_max.rd'
[]
[]
# Computing statistics
[Reporters]
[eval_surr]
type = EvaluateSurrogate
model = 'pc_max pc_min pr_max pr_min np_max np_min'
sampler = sample
parallel_type = ROOT
[]
[eval_surr_stats]
type = StatisticsReporter
reporters = 'eval_surr/pc_max eval_surr/pc_min eval_surr/pr_max eval_surr/pr_min eval_surr/np_max eval_surr/np_min'
compute = 'mean stddev'
ci_method = 'percentile'
ci_levels = '0.05 0.95'
[]
[]
[Outputs]
[out]
type = JSON
[]
[]
(modules/stochastic_tools/test/tests/surrogates/pod_rb/boundary/surr.i)
[StochasticTools]
[]
[Distributions]
[k_dist]
type = Uniform
lower_bound = 2.5
upper_bound = 7.5
[]
[alpha_dist]
type = Uniform
lower_bound = 2.5
upper_bound = 7.5
[]
[S_dist]
type = Uniform
lower_bound = 2.5
upper_bound = 7.5
[]
[Dir_dist]
type = Uniform
lower_bound = 0
upper_bound = 1
[]
[]
[Samplers]
[sample]
type = LatinHypercube
distributions = 'k_dist alpha_dist S_dist Dir_dist'
num_rows = 10
execute_on = PRE_MULTIAPP_SETUP
seed = 17
[]
[]
[Surrogates]
[rbpod]
type = PODReducedBasisSurrogate
filename = 'trainer_out_pod_rb.rd'
[]
[]
[VectorPostprocessors]
[res]
type = PODSurrogateTester
model = rbpod
sampler = sample
variable_name = "u"
to_compute = nodal_max
[]
[]
[Outputs]
csv = true
[]
(modules/stochastic_tools/test/tests/surrogates/pod_rb/internal/surr.i)
[StochasticTools]
[]
[Distributions]
[k_dist]
type = Uniform
lower_bound = 2.5
upper_bound = 7.5
[]
[alpha_dist]
type = Uniform
lower_bound = 2.5
upper_bound = 7.5
[]
[S_dist]
type = Uniform
lower_bound = 2.5
upper_bound = 7.5
[]
[]
[Samplers]
[sample]
type = LatinHypercube
distributions = 'k_dist alpha_dist S_dist'
num_rows = 10
execute_on = PRE_MULTIAPP_SETUP
seed = 17
[]
[]
[Surrogates]
[rbpod]
type = PODReducedBasisSurrogate
filename = 'trainer_out_pod_rb.rd'
[]
[]
[VectorPostprocessors]
[res]
type = PODSurrogateTester
model = rbpod
sampler = sample
variable_name = "u"
to_compute = nodal_max
[]
[]
[Outputs]
csv = true
[]
(modules/stochastic_tools/examples/surrogates/pod_rb/2d_multireg/full_order.i)
[StochasticTools]
[]
[Distributions]
[D012_dist]
type = Uniform
lower_bound = 0.2
upper_bound = 0.8
[]
[D3_dist]
type = Uniform
lower_bound = 0.15
upper_bound = 0.6
[]
[absxs0_dist]
type = Uniform
lower_bound = 0.0425
upper_bound = 0.17
[]
[absxs1_dist]
type = Uniform
lower_bound = 0.065
upper_bound = 0.26
[]
[absxs2_dist]
type = Uniform
lower_bound = 0.04
upper_bound = 0.16
[]
[absxs3_dist]
type = Uniform
lower_bound = 0.005
upper_bound = 0.02
[]
[src_dist]
type = Uniform
lower_bound = 5
upper_bound = 20
[]
[]
[Samplers]
[sample]
type = LatinHypercube
distributions = 'D012_dist D012_dist D012_dist D3_dist
absxs0_dist absxs1_dist absxs2_dist absxs3_dist
src_dist src_dist src_dist'
num_rows = 1000
execute_on = PRE_MULTIAPP_SETUP
[]
[]
[MultiApps]
[runner]
type = SamplerFullSolveMultiApp
input_files = sub.i
sampler = sample
execute_on = 'timestep_begin'
[]
[]
[Transfers]
[quad]
type = SamplerParameterTransfer
to_multi_app = runner
sampler = sample
parameters = 'Materials/D0/prop_values
Materials/D1/prop_values
Materials/D2/prop_values
Materials/D3/prop_values
Materials/absxs0/prop_values
Materials/absxs1/prop_values
Materials/absxs2/prop_values
Materials/absxs3/prop_values
Kernels/src0/value
Kernels/src1/value
Kernels/src2/value'
execute_on = 'timestep_begin'
[]
[results]
type = SamplerPostprocessorTransfer
from_multi_app = runner
sampler = sample
to_vector_postprocessor = results
from_postprocessor = 'nodal_l2'
[]
[]
[VectorPostprocessors]
[results]
type = StochasticResults
[]
[]
[Outputs]
csv = true
[]
(modules/stochastic_tools/examples/parameter_study/nonlin_diff_react/nonlin_diff_react_parent_uniform.i)
[StochasticTools]
[]
[Distributions]
[mu1]
type = Uniform
lower_bound = 0.21
upper_bound = 0.39
[]
[mu2]
type = Uniform
lower_bound = 6.3
upper_bound = 11.7
[]
[]
[Samplers]
[hypercube]
type = LatinHypercube
num_rows = 5000
distributions = 'mu1 mu2'
[]
[]
[MultiApps]
[runner]
type = SamplerFullSolveMultiApp
sampler = hypercube
input_files = 'nonlin_diff_react_sub.i'
mode = batch-restore
[]
[]
[Transfers]
[parameters]
type = SamplerParameterTransfer
to_multi_app = runner
sampler = hypercube
parameters = 'Kernels/nonlin_function/mu1 Kernels/nonlin_function/mu2'
[]
[results]
type = SamplerPostprocessorTransfer
from_multi_app = runner
sampler = hypercube
to_vector_postprocessor = results
from_postprocessor = 'max min average'
[]
[]
[VectorPostprocessors]
[results]
type = StochasticResults
[]
[]
[Reporters]
[stats]
type = StatisticsReporter
vectorpostprocessors = results
compute = 'mean'
ci_method = 'percentile'
ci_levels = '0.05'
[]
[]
[Outputs]
csv = true
execute_on = 'FINAL'
[]
(modules/stochastic_tools/test/tests/surrogates/pod_rb/internal/trainer.i)
[StochasticTools]
[]
[Distributions]
[k_dist]
type = Uniform
lower_bound = 2.5
upper_bound = 7.5
[]
[alpha_dist]
type = Uniform
lower_bound = 2.5
upper_bound = 7.5
[]
[S_dist]
type = Uniform
lower_bound = 2.5
upper_bound = 7.5
[]
[]
[Samplers]
[sample]
type = LatinHypercube
distributions = 'k_dist alpha_dist S_dist'
num_rows = 3
execute_on = PRE_MULTIAPP_SETUP
max_procs_per_row = 1
[]
[]
[MultiApps]
[sub]
type = PODFullSolveMultiApp
input_files = sub.i
sampler = sample
trainer_name = 'pod_rb'
execute_on = 'timestep_begin final'
max_procs_per_app = 1
[]
[]
[Transfers]
[param]
type = SamplerParameterTransfer
to_multi_app = sub
sampler = sample
parameters = 'Materials/k/prop_values Materials/alpha/prop_values Kernels/source/value'
execute_on = 'timestep_begin'
check_multiapp_execute_on = false
[]
[snapshots]
type = PODSamplerSolutionTransfer
from_multi_app = sub
sampler = sample
trainer_name = 'pod_rb'
execute_on = 'timestep_begin'
check_multiapp_execute_on = false
[]
[pod_modes]
type = PODSamplerSolutionTransfer
to_multi_app = sub
sampler = sample
trainer_name = 'pod_rb'
execute_on = 'final'
check_multiapp_execute_on = false
[]
[res]
type = PODResidualTransfer
from_multi_app = sub
sampler = sample
trainer_name = "pod_rb"
execute_on = 'final'
check_multiapp_execute_on = false
[]
[]
[Trainers]
[pod_rb]
type = PODReducedBasisTrainer
var_names = 'u'
error_res = '1e-9'
tag_names = 'diff react bodyf'
tag_types = 'op op src'
execute_on = 'timestep_begin final'
[]
[]
[Outputs]
[out]
type = SurrogateTrainerOutput
trainers = 'pod_rb'
execute_on = FINAL
[]
[]
(modules/stochastic_tools/examples/parameter_study/main_vector.i)
[StochasticTools]
[]
[Distributions]
[gamma]
type = Uniform
lower_bound = 0.5
upper_bound = 2.5
[]
[q_0]
type = Weibull
location = -110
scale = 20
shape = 1
[]
[T_0]
type = Normal
mean = 300
standard_deviation = 45
[]
[s]
type = Normal
mean = 100
standard_deviation = 25
[]
[]
[Samplers]
[hypercube]
type = LatinHypercube
num_rows = 5000
distributions = 'gamma q_0 T_0 s'
[]
[]
[MultiApps]
[runner]
type = SamplerFullSolveMultiApp
sampler = hypercube
input_files = 'diffusion_vector.i'
mode = batch-restore
[]
[]
[Transfers]
[parameters]
type = SamplerParameterTransfer
to_multi_app = runner
sampler = hypercube
parameters = 'Materials/constant/prop_values Kernels/source/value BCs/right/value BCs/left/value'
[]
[results]
type = SamplerReporterTransfer
from_multi_app = runner
sampler = hypercube
stochastic_reporter = results
from_reporter = 'acc/T_avg:value acc/q_left:value'
[]
[]
[Reporters]
[results]
type = StochasticReporter
outputs = none
[]
[stats]
type = StatisticsReporter
reporters = 'results/results:acc:T_avg:value results/results:acc:q_left:value'
compute = 'mean stddev'
ci_method = 'percentile'
ci_levels = '0.05 0.95'
[]
[]
[Outputs]
execute_on = 'FINAL'
[out]
type = JSON
[]
[]
(modules/stochastic_tools/examples/surrogates/pod_rb/2d_multireg/surr.i)
[StochasticTools]
[]
[Distributions]
[D012_dist]
type = Uniform
lower_bound = 0.2
upper_bound = 0.8
[]
[D1_dist]
type = Uniform
lower_bound = 0.2
upper_bound = 0.8
[]
[D2_dist]
type = Uniform
lower_bound = 0.2
upper_bound = 0.8
[]
[D3_dist]
type = Uniform
lower_bound = 0.15
upper_bound = 0.6
[]
[absxs0_dist]
type = Uniform
lower_bound = 0.0425
upper_bound = 0.17
[]
[absxs1_dist]
type = Uniform
lower_bound = 0.065
upper_bound = 0.26
[]
[absxs2_dist]
type = Uniform
lower_bound = 0.04
upper_bound = 0.16
[]
[absxs3_dist]
type = Uniform
lower_bound = 0.005
upper_bound = 0.02
[]
[src_dist]
type = Uniform
lower_bound = 5
upper_bound = 20
[]
[]
[Samplers]
[sample]
type = LatinHypercube
distributions = 'D012_dist D012_dist D012_dist D3_dist
absxs0_dist absxs1_dist absxs2_dist absxs3_dist
src_dist src_dist src_dist'
num_rows = 1000
execute_on = PRE_MULTIAPP_SETUP
[]
[]
[Surrogates]
[rbpod]
type = PODReducedBasisSurrogate
filename = 'trainer_out_pod_rb.rd'
change_rank = 'psi'
new_ranks = '40'
[]
[]
[VectorPostprocessors]
[res]
type = PODSurrogateTester
model = rbpod
sampler = sample
variable_name = 'psi'
to_compute = nodal_l2
[]
[]
[Outputs]
csv = true
[]
(modules/stochastic_tools/test/tests/surrogates/pod_rb/errors/trainer.i)
[StochasticTools]
[]
[Distributions]
[k_dist]
type = Uniform
lower_bound = 2.5
upper_bound = 7.5
[]
[alpha_dist]
type = Uniform
lower_bound = 2.5
upper_bound = 7.5
[]
[S_dist]
type = Uniform
lower_bound = 2.5
upper_bound = 7.5
[]
[]
[Samplers]
[sample]
type = LatinHypercube
distributions = 'k_dist alpha_dist S_dist'
num_rows = 3
execute_on = PRE_MULTIAPP_SETUP
max_procs_per_row = 1
[]
[]
[MultiApps]
[sub]
type = PODFullSolveMultiApp
input_files = sub.i
sampler = sample
trainer_name = 'pod_rb'
execute_on = 'timestep_begin final'
max_procs_per_app = 1
[]
[]
[Transfers]
[param]
type = SamplerParameterTransfer
to_multi_app = sub
sampler = sample
parameters = 'Materials/k/prop_values Materials/alpha/prop_values Kernels/source/value'
execute_on = 'timestep_begin'
check_multiapp_execute_on = false
[]
[snapshot]
type = PODSamplerSolutionTransfer
from_multi_app = sub
sampler = sample
trainer_name = 'pod_rb'
execute_on = 'timestep_begin'
check_multiapp_execute_on = false
[]
[mode]
type = PODSamplerSolutionTransfer
to_multi_app = sub
sampler = sample
trainer_name = 'pod_rb'
execute_on = 'final'
check_multiapp_execute_on = false
[]
[res]
type = PODResidualTransfer
from_multi_app = sub
sampler = sample
trainer_name = "pod_rb"
execute_on = 'final'
check_multiapp_execute_on = false
[]
[]
[Trainers]
[pod_rb]
type = PODReducedBasisTrainer
var_names = 'u'
error_res = '1e-9'
tag_names = 'diff react bodyf'
tag_types = 'op op src'
execute_on = 'timestep_begin final'
[]
[]
[Outputs]
[out]
type = SurrogateTrainerOutput
trainers = 'pod_rb'
execute_on = FINAL
[]
[]
(modules/stochastic_tools/examples/surrogates/polynomial_regression/uniform_train.i)
[StochasticTools]
[]
[Distributions]
[k_dist]
type = Uniform
lower_bound = 1
upper_bound = 10
[]
[q_dist]
type = Uniform
lower_bound = 9000
upper_bound = 11000
[]
[L_dist]
type = Uniform
lower_bound = 0.01
upper_bound = 0.05
[]
[Tinf_dist]
type = Uniform
lower_bound = 290
upper_bound = 310
[]
[]
[Samplers]
[pc_sampler]
type = Quadrature
order = 8
distributions = 'k_dist q_dist L_dist Tinf_dist'
execute_on = PRE_MULTIAPP_SETUP
[]
[pr_sampler]
type = LatinHypercube
distributions = 'k_dist q_dist L_dist Tinf_dist'
num_rows = 6560
execute_on = PRE_MULTIAPP_SETUP
[]
[]
[MultiApps]
[pc_sub]
type = SamplerFullSolveMultiApp
input_files = sub.i
sampler = pc_sampler
[]
[pr_sub]
type = SamplerFullSolveMultiApp
input_files = sub.i
sampler = pr_sampler
[]
[]
[Controls]
[pc_cmdline]
type = MultiAppSamplerControl
multi_app = pc_sub
sampler = pc_sampler
param_names = 'Materials/conductivity/prop_values Kernels/source/value Mesh/xmax BCs/right/value'
[]
[pr_cmdline]
type = MultiAppSamplerControl
multi_app = pr_sub
sampler = pr_sampler
param_names = 'Materials/conductivity/prop_values Kernels/source/value Mesh/xmax BCs/right/value'
[]
[]
[Transfers]
[pc_data]
type = SamplerReporterTransfer
from_multi_app = pc_sub
sampler = pc_sampler
stochastic_reporter = results
from_reporter = 'max/value'
[]
[pr_data]
type = SamplerReporterTransfer
from_multi_app = pr_sub
sampler = pr_sampler
stochastic_reporter = results
from_reporter = 'max/value'
[]
[]
[Reporters]
[results]
type = StochasticReporter
[]
[]
[Trainers]
[pc_max]
type = PolynomialChaosTrainer
execute_on = timestep_end
order = 8
distributions = 'k_dist q_dist L_dist Tinf_dist'
sampler = pc_sampler
response = results/pc_data:max:value
[]
[pr_max]
type = PolynomialRegressionTrainer
regression_type = "ols"
execute_on = timestep_end
max_degree = 4
sampler = pr_sampler
response = results/pr_data:max:value
[]
[]
[Outputs]
[pc_out]
type = SurrogateTrainerOutput
trainers = 'pc_max'
execute_on = FINAL
[]
[pr_out]
type = SurrogateTrainerOutput
trainers = 'pr_max'
execute_on = FINAL
[]
[]
(modules/stochastic_tools/test/tests/surrogates/polynomial_regression/poly_reg_vec.i)
[StochasticTools]
[]
[Distributions]
[k_dist]
type = Normal
mean = 5
standard_deviation = 2
[]
[L_dist]
type = Normal
mean = 0.03
standard_deviation = 0.01
[]
[]
[Samplers]
[sample]
type = LatinHypercube
num_rows = 10
distributions = 'k_dist L_dist'
execute_on = PRE_MULTIAPP_SETUP
min_procs_per_row = 2
[]
[]
[GlobalParams]
sampler = sample
[]
[MultiApps]
[sub]
type = SamplerFullSolveMultiApp
input_files = sub_vector.i
mode = batch-reset
execute_on = initial
min_procs_per_app = 2
[]
[]
[Controls]
[cmdline]
type = MultiAppSamplerControl
multi_app = sub
param_names = 'Materials/conductivity/prop_values L'
[]
[]
[Transfers]
[data]
type = SamplerReporterTransfer
from_multi_app = sub
stochastic_reporter = results
from_reporter = 'T_vec/T T_vec/x'
[]
[]
[Reporters]
[results]
type = StochasticReporter
outputs = none
[]
[eval]
type = EvaluateSurrogate
model = pr_surrogate
response_type = vector_real
parallel_type = ROOT
execute_on = timestep_end
[]
[]
[Trainers]
[pr]
type = PolynomialRegressionTrainer
regression_type = ols
max_degree = 2
response = results/data:T_vec:T
response_type = vector_real
execute_on = initial
[]
[]
[Surrogates]
[pr_surrogate]
type = PolynomialRegressionSurrogate
trainer = pr
[]
[]
[Outputs]
[out]
type = JSON
execute_on = timestep_end
[]
[]
(modules/stochastic_tools/examples/surrogates/polynomial_regression/uniform_surr.i)
[StochasticTools]
[]
[Distributions]
[k_dist]
type = Uniform
lower_bound = 1
upper_bound = 10
[]
[q_dist]
type = Uniform
lower_bound = 9000
upper_bound = 11000
[]
[L_dist]
type = Uniform
lower_bound = 0.01
upper_bound = 0.05
[]
[Tinf_dist]
type = Uniform
lower_bound = 290
upper_bound = 310
[]
[]
[Samplers]
[sample]
type = LatinHypercube
num_rows = 100000
distributions = 'k_dist q_dist L_dist Tinf_dist'
[]
[]
[Surrogates]
[pc_max]
type = PolynomialChaos
filename = 'uniform_train_pc_out_pc_max.rd'
[]
[pr_max]
type = PolynomialRegressionSurrogate
filename = 'uniform_train_pr_out_pr_max.rd'
[]
[]
# Computing statistics
[Reporters]
[pc_max_res]
type = EvaluateSurrogate
model = pc_max
sampler = sample
parallel_type = ROOT
[]
[pr_max_res]
type = EvaluateSurrogate
model = pr_max
sampler = sample
parallel_type = ROOT
[]
[pr_max_stats]
type = StatisticsReporter
reporters = 'pr_max_res/pr_max'
compute = 'mean stddev'
[]
[pc_max_stats]
type = PolynomialChaosReporter
pc_name = 'pc_max'
statistics = 'mean stddev'
[]
[]
[Outputs]
[out]
type = JSON
execute_on = timestep_end
[]
[]
(modules/stochastic_tools/examples/parameter_study/nonlin_diff_react/nonlin_diff_react_parent_normal.i)
[StochasticTools]
[]
[Distributions]
[mu1]
type = Normal
mean = 0.3
standard_deviation = 0.045
[]
[mu2]
type = Normal
mean = 9
standard_deviation = 1.35
[]
[]
[Samplers]
[hypercube]
type = LatinHypercube
num_rows = 5000
distributions = 'mu1 mu2'
[]
[]
[MultiApps]
[runner]
type = SamplerFullSolveMultiApp
sampler = hypercube
input_files = 'nonlin_diff_react_sub.i'
mode = batch-restore
[]
[]
[Transfers]
[parameters]
type = SamplerParameterTransfer
to_multi_app = runner
sampler = hypercube
parameters = 'Kernels/nonlin_function/mu1 Kernels/nonlin_function/mu2'
[]
[results]
type = SamplerPostprocessorTransfer
from_multi_app = runner
sampler = hypercube
to_vector_postprocessor = results
from_postprocessor = 'max min average'
[]
[]
[VectorPostprocessors]
[results]
type = StochasticResults
[]
[]
[Reporters]
[stats]
type = StatisticsReporter
vectorpostprocessors = results
compute = 'mean'
ci_method = 'percentile'
ci_levels = '0.05'
[]
[]
[Outputs]
csv = true
execute_on = 'FINAL'
[]
(modules/stochastic_tools/test/tests/surrogates/nearest_point/np_vec.i)
[StochasticTools]
[]
[Distributions]
[k_dist]
type = Normal
mean = 5
standard_deviation = 2
[]
[L_dist]
type = Normal
mean = 0.03
standard_deviation = 0.01
[]
[]
[Samplers]
[sample]
type = LatinHypercube
num_rows = 10
distributions = 'k_dist L_dist'
execute_on = PRE_MULTIAPP_SETUP
[]
[]
[GlobalParams]
sampler = sample
[]
[MultiApps]
[sub]
type = SamplerFullSolveMultiApp
input_files = sub_vector.i
mode = batch-reset
execute_on = initial
[]
[]
[Controls]
[cmdline]
type = MultiAppSamplerControl
multi_app = sub
param_names = 'Materials/conductivity/prop_values L'
[]
[]
[Transfers]
[data]
type = SamplerReporterTransfer
from_multi_app = sub
stochastic_reporter = results
from_reporter = 'T_vec/T T_vec/x'
[]
[]
[Reporters]
[results]
type = StochasticReporter
outputs = none
[]
[eval]
type = EvaluateSurrogate
model = np_surrogate
response_type = vector_real
parallel_type = ROOT
execute_on = timestep_end
[]
[]
[Trainers]
[np]
type = NearestPointTrainer
response = results/data:T_vec:T
response_type = vector_real
execute_on = initial
[]
[]
[Surrogates]
[np_surrogate]
type = NearestPointSurrogate
trainer = np
[]
[]
[Outputs]
[out]
type = JSON
execute_on = timestep_end
[]
[]
(modules/stochastic_tools/test/tests/surrogates/pod_rb/internal/trainer_and_surr.i)
[StochasticTools]
[]
[Distributions]
[k_dist]
type = Uniform
lower_bound = 2.5
upper_bound = 7.5
[]
[alpha_dist]
type = Uniform
lower_bound = 2.5
upper_bound = 7.5
[]
[S_dist]
type = Uniform
lower_bound = 2.5
upper_bound = 7.5
[]
[]
[Samplers]
[train_sample]
type = LatinHypercube
distributions = 'k_dist alpha_dist S_dist'
num_rows = 3
execute_on = PRE_MULTIAPP_SETUP
max_procs_per_row = 1
[]
[test_sample]
type = LatinHypercube
distributions = 'k_dist alpha_dist S_dist'
num_rows = 10
seed = 17
execute_on = PRE_MULTIAPP_SETUP
[]
[]
[MultiApps]
[sub]
type = PODFullSolveMultiApp
input_files = sub.i
sampler = train_sample
trainer_name = 'pod_rb'
execute_on = 'timestep_begin final'
max_procs_per_app = 1
[]
[]
[Transfers]
[quad]
type = SamplerParameterTransfer
to_multi_app = sub
sampler = train_sample
parameters = 'Materials/k/prop_values Materials/alpha/prop_values Kernels/source/value'
execute_on = 'timestep_begin'
check_multiapp_execute_on = false
[]
[data]
type = PODSamplerSolutionTransfer
from_multi_app = sub
sampler = train_sample
trainer_name = 'pod_rb'
execute_on = 'timestep_begin'
check_multiapp_execute_on = false
[]
[mode]
type = PODSamplerSolutionTransfer
to_multi_app = sub
sampler = train_sample
trainer_name = 'pod_rb'
execute_on = 'final'
check_multiapp_execute_on = false
[]
[res]
type = PODResidualTransfer
from_multi_app = sub
sampler = train_sample
trainer_name = "pod_rb"
execute_on = 'final'
check_multiapp_execute_on = false
[]
[]
[Trainers]
[pod_rb]
type = PODReducedBasisTrainer
var_names = 'u'
error_res = '1e-9'
tag_names = 'diff react bodyf'
tag_types = 'op op src'
execute_on = 'timestep_begin final'
[]
[]
[Surrogates]
[rbpod]
type = PODReducedBasisSurrogate
trainer = pod_rb
[]
[]
[VectorPostprocessors]
[res]
type = PODSurrogateTester
model = rbpod
sampler = test_sample
variable_name = "u"
to_compute = nodal_max
execute_on = 'final'
[]
[]
[Outputs]
execute_on = 'final'
csv = true
[]
(modules/stochastic_tools/examples/surrogates/polynomial_regression/normal_train.i)
[StochasticTools]
[]
[Distributions]
[k_dist]
type = Normal
mean = 5
standard_deviation = 2
[]
[q_dist]
type = Normal
mean = 10000
standard_deviation = 500
[]
[L_dist]
type = Normal
mean = 0.03
standard_deviation = 0.01
[]
[Tinf_dist]
type = Normal
mean = 300
standard_deviation = 10
[]
[]
[Samplers]
[pc_sampler]
type = Quadrature
order = 8
distributions = 'k_dist q_dist L_dist Tinf_dist'
execute_on = PRE_MULTIAPP_SETUP
[]
[pr_sampler]
type = LatinHypercube
distributions = 'k_dist q_dist L_dist Tinf_dist'
num_rows = 6560
execute_on = PRE_MULTIAPP_SETUP
[]
[]
[MultiApps]
[pc_sub]
type = SamplerFullSolveMultiApp
input_files = sub.i
sampler = pc_sampler
[]
[pr_sub]
type = SamplerFullSolveMultiApp
input_files = sub.i
sampler = pr_sampler
[]
[]
[Controls]
[pc_cmdline]
type = MultiAppSamplerControl
multi_app = pc_sub
sampler = pc_sampler
param_names = 'Materials/conductivity/prop_values Kernels/source/value Mesh/xmax BCs/right/value'
[]
[pr_cmdline]
type = MultiAppSamplerControl
multi_app = pr_sub
sampler = pr_sampler
param_names = 'Materials/conductivity/prop_values Kernels/source/value Mesh/xmax BCs/right/value'
[]
[]
[Transfers]
[pc_data]
type = SamplerReporterTransfer
from_multi_app = pc_sub
sampler = pc_sampler
stochastic_reporter = results
from_reporter = 'max/value'
[]
[pr_data]
type = SamplerReporterTransfer
from_multi_app = pr_sub
sampler = pr_sampler
stochastic_reporter = results
from_reporter = 'max/value'
[]
[]
[Reporters]
[results]
type = StochasticReporter
[]
[]
[Trainers]
[pc_max]
type = PolynomialChaosTrainer
execute_on = timestep_end
order = 8
distributions = 'k_dist q_dist L_dist Tinf_dist'
sampler = pc_sampler
response = results/pc_data:max:value
[]
[pr_max]
type = PolynomialRegressionTrainer
execute_on = timestep_end
regression_type = "ols"
max_degree = 4
sampler = pr_sampler
response = results/pr_data:max:value
[]
[]
[Outputs]
[pc_out]
type = SurrogateTrainerOutput
trainers = 'pc_max'
execute_on = FINAL
[]
[pr_out]
type = SurrogateTrainerOutput
trainers = 'pr_max'
execute_on = FINAL
[]
[]
(modules/stochastic_tools/test/tests/samplers/latin_hypercube/latin_hypercube.i)
[StochasticTools]
[]
[Distributions]
[a]
type = Uniform
lower_bound = 100
upper_bound = 200
[]
[b]
type = Uniform
lower_bound = 10
upper_bound = 20
[]
[]
[Samplers]
[sample]
type = LatinHypercube
distributions = 'a b'
num_rows = 10
seed = 1980
execute_on = 'INITIAL TIMESTEP_END'
[]
[]
[VectorPostprocessors]
[data]
type = SamplerData
sampler = sample
sampler_method = get_global_samples
execute_on = 'INITIAL TIMESTEP_END'
[]
[]
[Outputs]
execute_on = 'INITIAL TIMESTEP_END'
csv = true
[]
(modules/stochastic_tools/test/tests/surrogates/pod_rb/boundary/trainer.i)
[StochasticTools]
[]
[Distributions]
[k_dist]
type = Uniform
lower_bound = 2.5
upper_bound = 7.5
[]
[alpha_dist]
type = Uniform
lower_bound = 2.5
upper_bound = 7.5
[]
[S_dist]
type = Uniform
lower_bound = 2.5
upper_bound = 7.5
[]
[Dir_dist]
type = Uniform
lower_bound = 0
upper_bound = 1
[]
[]
[Samplers]
[sample]
type = LatinHypercube
distributions = 'k_dist alpha_dist S_dist Dir_dist'
num_rows = 5
execute_on = PRE_MULTIAPP_SETUP
max_procs_per_row = 1
[]
[]
[MultiApps]
[sub]
type = PODFullSolveMultiApp
input_files = sub.i
sampler = sample
trainer_name = 'pod_rb'
execute_on = 'timestep_begin final'
max_procs_per_app = 1
[]
[]
[Transfers]
[param]
type = SamplerParameterTransfer
to_multi_app = sub
sampler = sample
parameters = 'Materials/k/prop_values Materials/alpha/prop_values Kernels/source/value BCs/left/value'
execute_on = 'timestep_begin'
check_multiapp_execute_on = false
[]
[data]
type = PODSamplerSolutionTransfer
from_multi_app = sub
sampler = sample
trainer_name = 'pod_rb'
execute_on = 'timestep_begin'
check_multiapp_execute_on = false
[]
[mode]
type = PODSamplerSolutionTransfer
to_multi_app = sub
sampler = sample
trainer_name = 'pod_rb'
execute_on = 'final'
check_multiapp_execute_on = false
[]
[res]
type = PODResidualTransfer
from_multi_app = sub
sampler = sample
trainer_name = "pod_rb"
execute_on = 'final'
check_multiapp_execute_on = false
[]
[]
[Trainers]
[pod_rb]
type = PODReducedBasisTrainer
var_names = 'u'
error_res = '1e-9'
tag_names = 'diff react bodyf dir_src dir_imp'
tag_types = 'op op src src_dir op_dir'
execute_on = 'timestep_begin final'
[]
[]
[Outputs]
[out]
type = SurrogateTrainerOutput
trainers = 'pod_rb'
execute_on = FINAL
[]
[]