Stochastic Tools
The stochastic tools module is a toolbox designed for performing stochastic analysis for MOOSE-based applications. The following sections detail the various aspects of this module that can be used independently or in combination to meet the needs of the application developer.
Examples
Parameter Studies, Statistics, and Sensitivity Analysis:
Example 1: Monte Carlo Example
Example 2: Parameter Study
Example 4: SOBOL Sensitivity Analysis
Surrogate Models:
Example 5: Creating a Surrogate Model
Example 6: Training a Surrogate Model
Example 7: Evaluating a Surrogate Model
Example 8: Polynomial Chaos Surrogate
Example 9: Polynomial Regression Surrogate
Example 10: POD Reduced Basis Surrogate
Example 11: Comparison of surrogates using a time-dependent problem
Example 12: Gaussian Process Surrogate
Performance
The stochastic tools module is optimized in two ways for memory use. First, sub-applications can be executed in batches and all objects utilizing sample data do so using a distributed sample matrix. For further details refer to the following:
Linking MOOSE with external Machine Learning libraries
The stochastic tools module provides neural network-based surrogate modeling capabilities as well. However, to enable it one needs to compile MOOSE with the C++ APIs of pytorch. For this, follow the appropriate installation guide below:
Objects, Actions, and Syntax
The following is a complete list of all objects available in the stochastic tools module.
ControlLogic
- Stochastic Tools App
- MultiAppCommandLineControlControl for modifying the command line arguments of MultiApps.
- SamplerReceiverControl for receiving data from a Sampler via SamplerParameterTransfer.
Controls
- Stochastic Tools App
- MultiAppCommandLineControlControl for modifying the command line arguments of MultiApps.
- SamplerReceiverControl for receiving data from a Sampler via SamplerParameterTransfer.
Covariance
- Stochastic Tools App
- AddCovarianceActionAdds Covariance objects contained within the
[Trainers]
and[Surrogates]
input blocks. - ExponentialCovarianceExponential covariance function.
- MaternHalfIntCovarianceMatern half-integer covariance function.
- SquaredExponentialCovarianceSquared Exponential covariance function.
Distributions
- Stochastic Tools App
- JohnsonSBJohnson Special Bounded (SB) distribution.
- KernelDensity1DKernelDensity1D distribution
- LogisticLogistic distribution.
- LognormalLognormal distribution
- NormalNormal distribution
- TruncatedNormalTruncated normal distribution
- UniformContinuous uniform distribution.
- WeibullThree-parameter Weibull distribution.
MultiApps
- Stochastic Tools App
- PODFullSolveMultiAppCreates a full-solve type sub-application for each row of a Sampler matrix. On second call, this object creates residuals for a PODReducedBasisTrainer with given basis functions.
- SamplerFullSolveMultiAppCreates a full-solve type sub-application for each row of each Sampler matrix.
- SamplerTransientMultiAppCreates a sub-application for each row of each Sampler matrix.
Outputs
- Stochastic Tools App
- SurrogateTrainerOutputOutput for trained surrogate model data.
Reporters
- Stochastic Tools App
- AdaptiveMonteCarloDecisionGeneric reporter which decides whether or not to accept a proposed sample in Adaptive Monte Carlo type of algorithms.
- EvaluateSurrogateTool for sampling surrogate models.
- PolynomialChaosReporterTool for extracting data from PolynomialChaos surrogates and computing statistics.
- SobolReporterCompute SOBOL statistics values of a given VectorPostprocessor or Reporter objects and vectors.
- StatisticsReporterCompute statistical values of a given VectorPostprocessor objects and vectors.
- StochasticReporterStorage container for stochastic simulation results coming from Reporters.
Samplers
- Stochastic Tools App
- AdaptiveImportanceAdaptive Importance Sampler.
- CSVSamplerSampler that reads samples from CSV file.
- CartesianProductProvides complete Cartesian product for the supplied variables.
- CartesianProductSamplerProvides complete Cartesian product for the supplied variables.
- LatinHypercubeLatin Hypercube Sampler.
- MonteCarloMonte Carlo Sampler.
- MonteCarloSamplerMonte Carlo Sampler.
- NestedMonteCarloMonte Carlo sampler for nested loops of parameters.
- ParallelSubsetSimulationParallel Subset Simulation sampler.
- QuadratureQuadrature sampler for Polynomial Chaos.
- QuadratureSamplerQuadrature sampler for Polynomial Chaos.
- SobolSobol variance-based sensitivity analysis Sampler.
- SobolSamplerSobol variance-based sensitivity analysis Sampler.
StochasticTools
- Stochastic Tools App
- StochasticToolsActionAction for performing some common functions for running stochastic simulations.
Surrogates
- Stochastic Tools App
- AddSurrogateActionAdds SurrogateTrainer and SurrogateModel objects contained within the
[Trainers]
and[Surrogates]
input blocks. - GaussianProcessComputes and evaluates Gaussian Process surrogate model.
- LibtorchANNSurrogateSurrogate that evaluates a feedforward artificial neural net.
- NearestPointSurrogateSurrogate that evaluates the value from the nearest point from data in NearestPointTrainer
- PODReducedBasisSurrogateEvaluates POD-RB surrogate model with reduced operators computed from PODReducedBasisTrainer.
- PolynomialChaosComputes and evaluates polynomial chaos surrogate model.
- PolynomialRegressionSurrogateEvaluates polynomial regression model with coefficients computed from PolynomialRegressionTrainer.
Trainers
- Stochastic Tools App
- AddSurrogateActionAdds SurrogateTrainer and SurrogateModel objects contained within the
[Trainers]
and[Surrogates]
input blocks. - GaussianProcessTrainerProvides data preperation and training for a Gaussian Process surrogate model.
- LibtorchANNTrainerTrains a simple neural network using libtorch.
- NearestPointTrainerLoops over and saves sample values for NearestPointSurrogate.
- PODReducedBasisTrainerComputes the reduced subspace plus the reduced operators for POD-RB surrogate.
- PolynomialChaosTrainerComputes and evaluates polynomial chaos surrogate model.
- PolynomialRegressionTrainerComputes coefficients for polynomial regession model.
Transfers
- Stochastic Tools App
- PODResidualTransferTransfers residual vectors from the sub-application to a a container in the Trainer object.
- PODSamplerSolutionTransferTransfers solution vectors from the sub-applications to a a container in the Trainer object and back.
- SamplerParameterTransferCopies Sampler data to a SamplerReceiver object.
- SamplerPostprocessorTransferTransfers data from Postprocessors on the sub-application to a VectorPostprocessor on the master application.
- SamplerReporterTransferTransfers data from Reporters on the sub-application to a StochasticReporter on the main application.
- SamplerTransferCopies Sampler data to a SamplerReceiver object.
VectorPostprocessors
- Stochastic Tools App
- GaussianProcessDataTool for extracting hyperparameter data from gaussian process user object and storing in VectorPostprocessor vectors.
- SamplerDataTool for extracting Sampler object data and storing in VectorPostprocessor vectors.
- SobolStatisticsCompute SOBOL statistics values of a given VectorPostprocessor objects and vectors.
- StatisticsCompute statistical values of a given VectorPostprocessor objects and vectors.
- StochasticResultsStorage container for stochastic simulation results coming from a Postprocessor.