Stochastic Tools System Design Description

This template follows INL template TEM-140, "IT System Design Description."

commentnote

This document serves as an addendum to Framework System Design Description and captures information for Software Design Description (SDD) specific to the Stochastic Tools application.

Introduction

Frameworks are a software development construct aiming to simplify the creation of specific classes of applications through abstraction of low-level details. The main object of creating a framework is to provide an interface to application developers that saves time and provides advanced capabilities not attainable otherwise. The MOOSE, mission is just that: provide a framework for engineers and scientists to build state-of-the-art, computationally scalable finite element based simulation tools.

MOOSE was conceived with one major objective: to be as easy and straightforward to use by scientists and engineers as possible. MOOSE is meant to be approachable by non-computational scientists who have systems of partial differential equations (PDEs) they need to solve. Every single aspect of MOOSE was driven by this singular principle from the build system to the API to the software development cycle. At every turn, decisions were made to enable this class of users to be successful with the framework. The pursuit of this goal has led to many of the unique features of MOOSE:

  • A streamlined build system

  • An API aimed at extensible

  • Straightforward APIs providing sensible default information

  • Integrated, automatic, and rigorous testing

  • Rapid, continuous integration development cycle

  • Codified, rigorous path for contributing

  • Applications are modular and composable

Each of these characteristics is meant to build trust in the framework by those attempting to use it. For instance, the build system is the first thing potential framework users come into contact with when they download a new software framework. Onerous dependency issues, complicated, hard to follow instructions or build failure can all result in a user passing on the platform. Ultimately, the decision to utilize a framework comes down to whether or not you trust the code in the framework and those developing it to be able to support your desired use-case. No matter the technical capabilities of a framework, without trust users will look elsewhere. This is especially true of those not trained in software development or computational science.

Developing trust in a framework goes beyond utilizing "best practices" for the code developed, it is equally important that the framework itself is built upon tools that are trusted. For this reason, MOOSE relies on a well-established code base of libMesh and PETSc. The libMesh library provides foundational capability for the finite element method and provides interfaces to leading-edge numerical solution packages such as PETSc.

With these principles in mind, an open source, massively parallel, finite element, multiphysics framework has been conceived. MOOSE is an on-going project started in 2008 aimed toward a common platform for creation of new multiphysics tools. This document provides design details pertinent to application developers as well as framework developers.

Use Cases

The MOOSE Framework is targeted at two main groups of actors: Developers and Users. Developers are the main use case. These are typically students and professionals trained in science and engineering fields with some level of experience with coding but typically very little formal software development training. The other user group is Users. Those who intend to use an application built upon the framework without writing any computer code themselves. Instead they may modify or create input files for driving a simulation, run the application, and analyze the results. All interactions through MOOSE are primarily through the command-line interface and through a customizable block-based input file.

System Purpose

The Software Design Description provided here is description of each object in the system. The pluggable architecture of the framework makes MOOSE and MOOSE-based applications straightforward to develop as each piece of end-user (developer) code that goes into the system follows a well-defined interface for the underlying systems that those object plug into. These descriptions are provided through developer-supplied "markdown" files that are required for all new objects that are developed as part of the framework, modules and derivative applications. More information about the design documentation can be found in Documenting MOOSE.

System Scope

The purpose of this software is to provide several libraries that can be used to build an application based upon the framework. Additionally, several utilities are provided for assisting developers and users in end-to-end FEM analysis. A brief overview of the major components are listed here:

ComponentDescription
framework libraryThe base system from which all MOOSE-based applications are created
module librariesOptional "physics" libraries that may be used in an application to provide capability
build systemThe system responsible for creating applications for a series of libraries and applications
test harnessThe extendable testing system for finding, scheduling, running, and reporting regression tests
"peacock"The graphical user interface (GUI) for building input files, executing applications, and displaying results
MooseDocsThe extendable markdown system for MOOSE providing common documentation and requirements enforcement
"stork"The script and templates for generating a new MOOSE-based application ready for building and testing
examplesA set of complete applications demonstrating the use of MOOSE's pluggable systems
tutorialsStep by step guides to building up an application using MOOSE's pluggable systems
unitAn application for unit testing individual classes or methods of C++ code

Dependencies and Limitations

The MOOSE platform has several dependencies on other software packages and has scope that is constantly evolving based upon funding, resources, priorities, and lab direction. However, the software is open-source and many features and even bugs can be offloaded to developers with appropriate levels of knowledge and direction from the main design team. The primary list of software dependencies is listed below. This list is not meant to be exhaustive. Individual operating systems may require specific packages to be installed prior to using MOOSE, which can be found on the Install MOOSE pages.

Software DependencyDescription
libMeshFinite Element Library and I/O routines
PETScSolver Package
hypreMultigrid Preconditioner
MPIA distributed parallel processing library (MPICH)

Figure 1: A diagram of the MOOSE code platform.

References

  1. ISO/IEC/IEEE 24765:2010(E). Systems and software engineering—Vocabulary. first edition, December 15 2010.[BibTeX]
  2. ASME NQA-1. ASME NQA-1-2008 with the NQA-1a-2009 addenda: Quality Assurance Requirements for Nuclear Facility Applications. first edition, August 31 2009.[BibTeX]

Definitions and Acronyms

This section defines, or provides the definition of, all terms and acronyms required to properly understand this specification.

Definitions

- Pull (Merge) Request: A proposed change to the software (e.g. usually a code change, but may also include documentation, requirements, design, and/or testing). - Baseline: A specification or product (e.g., project plan, maintenance and operations (M&O) plan, requirements, or design) that has been formally reviewed and agreed upon, that thereafter serves as the basis for use and further development, and that can be changed only by using an approved change control process (NQA-1, 2009). - Validation: Confirmation, through the provision of objective evidence (e.g., acceptance test), that the requirements for a specific intended use or application have been fulfilled (24765:2010(E), 2010). - Verification: (1) The process of: evaluating a system or component to determine whether the products of a given development phase satisfy the conditions imposed at the start of that phase. (2) Formal proof of program correctness (e.g., requirements, design, implementation reviews, system tests) (24765:2010(E), 2010).

Acronyms

AcronymDescription
APIApplication Programming Interface
DOE-NEDepartment of Energy, Nuclear Energy
FEfinite element
FEMFinite Element Method
GUIgraphical user interface
HITHierarchical Input Text
HPCHigh Performance Computing
I/OInput/Output
INLIdaho National Laboratory
MOOSEMultiphysics Object Oriented Simulation Environment
MPIMessage Passing Interface
PDEspartial differential equations
SDDSoftware Design Description

Design Stakeholders and Concerns

Design Stakeholders

Stakeholders for MOOSE include several of the funding sources including Department of Energy, Nuclear Energy (DOE-NE) and the INL. However, Since MOOSE is an open-source project, several universities, companies, and foreign governments have an interest in the development and maintenance of the MOOSE project.

Stakeholder Design Concerns

Concerns from many of the stakeholders are similar. These concerns include correctness, stability, and performance. The mitigation plan for each of these can be addressed. For correctness, MOOSE development requires either regression or unit testing for all new code added to the repository. The project contains several comparisons against analytical solutions where possible and also other verification methods such as MMS. For stability, MOOSE maintains multiple branches to incorporate several layers of testing both internally and for dependent applications. Finally, performance tests are also performed as part of the the normal testing suite to monitor code change impacts to performance.

System Design

The MOOSE framework itself is composed of a wide range of pluggable systems. Each system is generally composed of a single or small set of C++ objects intended to be specialized by a Developer to solve a specific problem. To accomplish this design goal, MOOSE uses several modern object-oriented design patterns. The primary overarching pattern is the "Factory Pattern". Users needing to extend MOOSE may inherit from one of MOOSE's systems to providing an implementation meeting his or her needs. The design of each of these systems is documented on the mooseframework.org wiki in the Tutorial section. Additionally, up-to-date documentation extracted from the source is maintained on the the mooseframework.org documentation site after every successful merge to MOOSE's stable branch. After these objects are created, the can be registered with the framework and used immediately in a MOOSE input file.

System Structure

The MOOSE framework architecture consists of a core and several pluggable systems. The core of MOOSE consists of a number of key objects responsible for setting up and managing the user-defined objects of a finite element simulation. This core set of objects has limited extendability and exist for every simulation configuration that the framework is capable of running.

Adaptivity

Adaptivity/Indicators

Adaptivity/Markers

AuxKernels

AuxKernels/MatVecRealGradAuxKernel

AuxKernels/MaterialVectorAuxKernel

AuxKernels/MaterialVectorGradAuxKernel

AuxScalarKernels

AuxVariables

AuxVariables/MultiAuxVariables

BCs

BCs/CavityPressure

BCs/CoupledPressure

BCs/InclinedNoDisplacementBC

BCs/Periodic

BCs/Pressure

Bounds

Closures

Components

Constraints

Contact

ControlLogic

Controls

CoupledHeatTransfers

Covariance

DGKernels

Dampers

Debug

Debug/MaterialDerivativeTest

DeprecatedBlock

DiracKernels

Distributions

DomainIntegral

Executioner

Executioner/Adaptivity

Executioner/Predictor

Executioner/Quadrature

Executioner/TimeIntegrator

Executioner/TimeStepper

Executors

FVBCs

FVInterfaceKernels

FVKernels

FluidPropertiesInterrogator

Functions

GeochemicalModelInterrogator

GlobalParams

GrayDiffuseRadiation

HeatStructureMaterials

ICs

ICs/PolycrystalICs

ICs/PolycrystalICs/BicrystalBoundingBoxIC

ICs/PolycrystalICs/BicrystalCircleGrainIC

ICs/PolycrystalICs/PolycrystalColoringIC

ICs/PolycrystalICs/PolycrystalRandomIC

ICs/PolycrystalICs/PolycrystalVoronoiVoidIC

ICs/PolycrystalICs/Tricrystal2CircleGrainsIC

InterfaceKernels

Kernels

Kernels/CHPFCRFFSplitKernel

Kernels/DynamicTensorMechanics

Kernels/HHPFCRFFSplitKernel

Kernels/PFCRFFKernel

Kernels/PolycrystalElasticDrivingForce

Kernels/PolycrystalKernel

Kernels/PolycrystalStoredEnergy

Kernels/PoroMechanics

Kernels/RigidBodyMultiKernel

Kernels/TensorMechanics

Materials

Mesh

Mesh/Partitioner

Modules

Modules/CompressibleNavierStokes

Modules/FluidProperties

Modules/HeatConduction

Modules/HeatConduction/ThermalContact

Modules/HeatConduction/ThermalContact/BC

Modules/IncompressibleNavierStokes

Modules/NavierStokesFV

Modules/Peridynamics

Modules/Peridynamics/Mechanics

Modules/Peridynamics/Mechanics/GeneralizedPlaneStrain
Modules/Peridynamics/Mechanics/Master

Modules/PhaseField

Modules/PhaseField/Conserved

Modules/PhaseField/DisplacementGradients

Modules/PhaseField/EulerAngles2RGB

Modules/PhaseField/GrainGrowth

Modules/PhaseField/GrandPotential

Modules/PhaseField/Nonconserved

Modules/PorousFlow

Modules/PorousFlow/BCs

Modules/TensorMechanics

Modules/TensorMechanics/CohesiveZoneMaster

Modules/TensorMechanics/DynamicMaster

Modules/TensorMechanics/GeneralizedPlaneStrain

Modules/TensorMechanics/GlobalStrain

Modules/TensorMechanics/LineElementMaster

Modules/TensorMechanics/Master

Modules/TensorMechanics/MaterialVectorBodyForce

MortarGapHeatTransfer

MultiApps

NodalKernels

NodalNormals

Outputs

PorousFlowBasicTHM

PorousFlowFullySaturated

PorousFlowUnsaturated

Postprocessors

Preconditioning

Problem

RayBCs

RayKernels

ReactionNetwork

ReactionNetwork/AqueousEquilibriumReactions

ReactionNetwork/SolidKineticReactions

Reporters

Samplers

ScalarKernels

SpatialReactionSolver

StochasticTools

Surrogates

ThermalContact

TimeDependentReactionSolver

TimeIndependentReactionSolver

Trainers

Transfers

UserObjects

Variables

Variables/CHPFCRFFSplitVariables

Variables/HHPFCRFFSplitVariables

Variables/PFCRFFVariables

Variables/PolycrystalVariables

VectorPostprocessors

XFEM

The MooseApp is the top-level object used to hold all of the other objects in a simulation. In a normal simulation a single MooseApp object is created and "run()". This object uses it's Factory objects to build user defined objects which are stored in a series of Warehouse objects and executed. The Finite Element data is stored in the Systems and Assembly object while the domain information (the Mesh) is stored in the Mesh object. A series of threaded loops are used to run parallel calculations on the objects created and stored within the warehouses.

MOOSE's pluggable systems are documented on the mooseframework.org wiki. Each of these systems has set of defined polymorphic interfaces and are designed to accomplish a specific task within the simulation. The design of these systems is fluid and is managed through agile methods and ticket request system on the Github.org website.

Data Design and Control

At a high level, the system is designed to process Hierarchical Input Text (HIT) input files to construct several objects that will constitute an finite element (FE) simulation. Some of the objects in the simulation may in turn load other file-based resources to complete the simulation. Examples include meshes or data files. The system will then assemble systems of equations and solve them using the libraries of the Code Platform. The system can then output the solution in one or more supported output formats commonly used for visualization.

Human-Machine Interface Design

MOOSE is a command-line driven program. All interaction with MOOSE and MOOSE-based codes is ultimately done through the command line. This is typical for High Performance Computing (HPC) applications that use the Message Passing Interface (MPI) interface for running on super computing clusters. Optional GUIs may be used to assist in creating input files and launching executables on the command line.

System Design Interface

All external system interaction is performed either through file Input/Output (I/O) or through local Application Programming Interface (API) calls. Neither the framework, nor the modules are designed to interact with any external system directly through remote procedure calls. Any code to code coupling performed using the framework are done directly through API calls either in a static binary or after loading shared libraries.

Security Structure

The framework does not require any elevated privileges to operate and does not run any stateful services, daemons or other network programs. Distributed runs rely on the MPI library.

Requirements Cross-Reference

  • stochastic_tools: RandomIC
  • 3.2.1The system shall generate parallel agnostic random initial conditions using a distribution function.

    Specification(s): generate

    Design: RandomIC

    Issue(s): #5567#11901#9710

    Collection(s): FUNCTIONAL

    Type(s): CSVDiff

  • 3.2.2The system shall generate an error the random initial condition is used with both a distribution and min or max value defined.

    Specification(s): test_err_distribution_and_min_max

    Design: RandomIC

    Issue(s): #5567#11901#9710

    Collection(s): FAILURE_ANALYSISFUNCTIONAL

    Type(s): RunException

  • stochastic_tools: SobolReporter
  • 3.4.6The system shall support the ability to compute first, second, and total-effect Sobol sensitivity indices with a reporter.

    Specification(s): sobol

    Design: SobolReporter

    Issue(s): #15558

    Collection(s): FUNCTIONAL

    Type(s): JSONDiff

  • 3.4.7The system shall support the ability to compute Sobol sensitivity indices for vector-type data.

    Specification(s): sobol_vec

    Design: SobolReporter

    Issue(s): #15558

    Collection(s): FUNCTIONAL

    Type(s): JSONDiff

  • stochastic_tools: Sampler
  • 3.5.9The system shall support the creation of data sampled from distribution during the initial setup of a simulation.

    Specification(s): initial

    Design: Sampler

    Issue(s): #8065

    Collection(s): FUNCTIONAL

    Type(s): CSVDiff

  • stochastic_tools: LatinHypercube
  • 3.5.10The system shall support the ability to sample data using the Latin Hypercube method that can operate
    1. using global matrix,
    2. a local matrix,
    3. or row-by-row.

    Specification(s): modes/global, modes/local, modes/row

    Design: LatinHypercube

    Issue(s): #14830

    Collection(s): FUNCTIONAL

    Type(s): CSVDiff

  • 3.5.11The system shall support the ability to sample data using the Latin Hypercube method with more processors than rows that can operate
    1. using global matrix,
    2. a local matrix,
    3. or row-by-row.

    Specification(s): more_procs/global, more_procs/local, more_procs/row

    Design: LatinHypercube

    Issue(s): #14830

    Collection(s): FUNCTIONAL

    Type(s): CSVDiff

  • 3.5.12The system shall include a utility that visually displays results of plotting Latin Hypercube test.

    Specification(s): visualize

    Design: LatinHypercube

    Issue(s): #14830

    Collection(s): FUNCTIONAL

    Type(s): CheckFiles

  • stochastic_tools: Sobol
  • 3.5.16The system shall include a SOBOL method for sampling distribution data:
    1. with the re-sampling matrix and
    2. without the re-sampling matrix.

    Specification(s): sobol/resample, sobol/no_resample

    Design: Sobol

    Issue(s): #8065

    Collection(s): FUNCTIONAL

    Type(s): CSVDiff

  • 3.5.17The system shall error if the SOBOL sampling method is setup with input sampling matrices
    1. with differing number of rows;
    2. with differing number of columns; and
    3. if the matrices are the same.

    Specification(s): errors/row_mismatch, errors/col_mismatch, errors/same_matrix

    Design: Sobol

    Issue(s): #8065

    Collection(s): FAILURE_ANALYSISFUNCTIONAL

    Type(s): RunException

  • 3.7.22The system shall support the creation of a sub-application for each row sampled data generated from a Sobol scheme.

    Specification(s): sobol

    Design: SobolSamplerParameterTransfer

    Issue(s): #8863

    Collection(s): FUNCTIONAL

    Type(s): CSVDiff

  • stochastic_tools: SamplerParameterTransfer
  • 3.7.1The system shall include the ability to modify parameters for sub-applications using values from a distribution
    1. on a single processor,
    2. on multiple processors,
    3. and on more processors than samples.

    Specification(s): normal/n1, normal/n2, normal/n3

    Design: SamplerParameterTransfer

    Issue(s): #8863

    Collection(s): FUNCTIONAL

    Type(s): CSVDiff

  • 3.7.2The system shall include the ability to modify parameters for sub-applications executed in batches using values from a distribution
    1. on a single processor,
    2. on multiple processors, and
    3. on multiple processors using in-memory sub-application restore.

    Specification(s): batch/n1, batch/n2, batch/n2_restore

    Design: SamplerParameterTransfer

    Issue(s): #8863

    Collection(s): FUNCTIONAL

    Type(s): CSVDiff

  • 3.7.3The system shall include the ability to transfer stochastic results for two sub apps.

    Specification(s): batch_two_subapps

    Design: SamplerParameterTransfer

    Issue(s): #17079

    Collection(s): FUNCTIONAL

    Type(s): CSVDiff

  • 3.7.4The 'StochasticToolsTransfer object shall error if the 'execute_on' parameter is defined when the corresponding MultiApp object is running in batch mode.

    Specification(s): StochasticToolsTransfer_execute_on_error

    Design: SamplerParameterTransfer

    Issue(s): #8863

    Collection(s): FAILURE_ANALYSISFUNCTIONAL

    Type(s): RunException

  • 3.7.5The 'StochasticToolsTransfer' object shall error if the 'execute_on' parameter does not match the corresponding MultiApp object is running in normal mode.

    Specification(s): StochasticToolsTransfer_execute_on_check

    Design: SamplerParameterTransfer

    Issue(s): #8863

    Collection(s): FAILURE_ANALYSISFUNCTIONAL

    Type(s): RunException

  • 3.7.6The system shall report a reasonable error if parameters for a trasnfer between multiapps are provided to stochastics transfer, which do not support this currently

    Specification(s): direction_error

    Design: SamplerParameterTransfer

    Issue(s): #8863

    Collection(s): FAILURE_ANALYSISFUNCTIONAL

    Type(s): RunException

  • 3.7.7The system shall support the creation of a sub-application for each row of the stochastic data.

    Specification(s): monte_carlo

    Design: MonteCarloSamplerParameterTransfer

    Issue(s): #8863

    Collection(s): FUNCTIONAL

    Type(s): CSVDiff

  • 3.7.14The system shall produce an error if neither a 'SamplerTransientMultiApp' nor SamplerFullSolveMultiApp is provided in SamplerParameterTransfer.

    Specification(s): multiapp_type

    Design: SamplerParameterTransfer

    Issue(s): #11363

    Collection(s): FAILURE_ANALYSISFUNCTIONAL

    Type(s): RunException

  • 3.7.17The system shall produce an error if supplied vector of real values is not sized correctly within the SamplerParameterTransfer object.

    Specification(s): num_parameters_wrong

    Design: SamplerParameterTransfer

    Issue(s): #11363

    Collection(s): FAILURE_ANALYSISFUNCTIONAL

    Type(s): RunException

  • 3.7.18The system shall produce an error if sampling method differs between the sub-application and the associated sub-application data transfer.

    Specification(s): sampler_mismatch

    Design: SamplerParameterTransfer

    Issue(s): #11363

    Collection(s): FAILURE_ANALYSISFUNCTIONAL

    Type(s): RunException

  • 3.7.19The system shall be capable of transferring scalar data to sub-applications for each row of the stochastic data
    1. using a Monte Carlo and
    2. Sobol sampling scheme.

    Specification(s): transfer/monte_carlo, transfer/sobol

    Design: SamplerParameterTransfer

    Issue(s): #8065

    Collection(s): FUNCTIONAL

    Type(s): CSVDiff

  • 3.7.20The system shall be capable of transferring vector data to sub-applications for each row of the stochastic data.

    Specification(s): monte_carlo

    Design: SamplerParameterTransfer

    Issue(s): #8065

    Collection(s): FUNCTIONAL

    Type(s): CSVDiff

  • 3.7.21The system shall error if the transferred vector to a sub-application
    1. is not sized correctly for stochastic data,
    2. is not sized uniformily across sub-applications,
    3. if the vector parameter does not exist, and
    4. if the sub-application does not consume all of the supplied data.

    Specification(s): errors/not_enough_data, errors/size_mismatch, errors/invalid_name, errors/extra_data

    Design: SamplerParameterTransfer

    Issue(s): #8065

    Collection(s): FAILURE_ANALYSISFUNCTIONAL

    Type(s): RunException

  • 3.7.22The system shall support the creation of a sub-application for each row sampled data generated from a Sobol scheme.

    Specification(s): sobol

    Design: SobolSamplerParameterTransfer

    Issue(s): #8863

    Collection(s): FUNCTIONAL

    Type(s): CSVDiff

  • stochastic_tools: StochasticResults
  • 3.7.8The system shall produce an error if neither a 'SamplerTransientMultiApp' nor SamplerFullSolveMultiApp is provided in SamplerPostprocessorTransfer.

    Specification(s): wrong_multi_app

    Design: StochasticResults

    Issue(s): #9419

    Collection(s): FAILURE_ANALYSISFUNCTIONAL

    Type(s): RunException

  • 3.7.9The system shall produce an error if the 'result' object in 'SamplerPostprocessorTransfer' is not a 'StochasticResults object'.

    Specification(s): require_stochastic_results

    Design: StochasticResults

    Issue(s): #9419

    Collection(s): FAILURE_ANALYSISFUNCTIONAL

    Type(s): RunException

  • 3.8.9The system shall support the collection of stochastic data from multiple sub-applications.

    Specification(s): multiple

    Design: StochasticResults

    Issue(s): #14414

    Collection(s): FUNCTIONAL

    Type(s): CSVDiff

  • 3.8.17The system shall support the collection of stochastic data that is
    1. replicated on all processors and
    2. distributed across many.

    Specification(s): parallel_type/replicated, parallel_type/distributed

    Design: StochasticResults

    Issue(s): #14410

    Collection(s): FUNCTIONAL

    Type(s): CSVDiff

  • 3.8.18The system shall support the labeling of collection of stochastic data
    1. with custom prefix and
    2. without a prefix.

    Specification(s): prefix/custom, prefix/none

    Design: StochasticResults

    Issue(s): #14410

    Collection(s): FUNCTIONAL

    Type(s): CSVDiff

  • 3.8.19The system shall support the collection of stochastic data that
    1. can be appended into a single data set or
    2. or contain a single file per timestep.

    Specification(s): data/complete, data/time

    Design: StochasticResults

    Issue(s): #14412

    Collection(s): FUNCTIONAL

    Type(s): CSVDiff

  • stochastic_tools: SobolStatistics
  • 3.8.13The system shall support the ability to compute first, second, and total-effect Sobol sensitivity indices.

    Specification(s): sobol

    Design: SobolStatistics

    Issue(s): #14784

    Collection(s): FUNCTIONAL

    Type(s): CSVDiff

  • 3.8.14The system shall support the ability to compute confidence intervals on Sobol sensitivity indices.

    Specification(s): sobol_bootstrap

    Design: SobolStatistics

    Issue(s): #14784

    Collection(s): FUNCTIONAL

    Type(s): CSVDiff