Optimization System Requirements Specification
This template follows INL template TEM-135, "IT System Requirements Specification".
This document serves as an addendum to Framework System Requirements Specification and captures information for SRS specific to the Optimization module.
Introduction
System Purpose
The purpose of the MOOSE Optimization module is to control model parameters such that they minimize a defined objective. An example would be to search for material property values so that the solution matches experimental results. As such, the purpose of this module is not to provide physical model capabilities, which is typically the responsibility of other MOOSE modules and dependent applications.
System Scope
The MOOSE Optimization module utilizes several MOOSE systems to perform optimization on physics models. The design relies on a customized Executioner to drive the optimization algorithm. This Executioner calls a specific type of Reporter known as a OptimizationReporter, which defines the parameter space, objective, gradient, and Hessian functions necessary for the optimization methods. Along with calling this Reporter, the Executioner calls MultiApps and Transfers that are responsible for passing parameters to the physics model, running the model, and gathering the necessary data to compute the objective, gradient, and Hessian. Typically, one sub-application defines the underlying physics for the objective computation, another defines an adjoint version of the model for the gradient computation, and another defines a homogeneous version of the model for the matrix-free Hessian computation. All data from these applications is gathered in the OptimizationReporter, which is then sent to the optimization Executioner. The resulting output is the value of the optimized parameters and the solution of physics model with these parameters. The scope of the Optimization module includes, but is not limited to:
Inverse optimization
Shape optimization
Topology optimization
System Overview
System Context
The Optimization module is command-line driven. Like MOOSE, this is typical for a high-performance software that is designed to run across several nodes of a cluster system. As such, all usage of the software is through any standard terminal program generally available on all supported operating systems. Similarly, for the purpose of interacting through the software, there is only a single user, "the user", which interacts with the software through the command-line. The Optimization module does not maintain any back-end database or interact with any system daemons. It is an executable, which may be launched from the command line and writes out various result files as it runs.
Figure 1: Usage of the Optimization module and other MOOSE-based applications.
System Functions
Since the Optimization module is a command-line driven application, all functionality provided in the software is operated through the use of standard UNIX command line flags and the extendable MOOSE input file. The Optimization module is completely extendable so individual design pages should be consulted for specific behaviors of each user-defined object.
User Characteristics
Like MOOSE, there are three kinds of users working on the Optimization module:
Optimization module Developers: These are the core developers of the Optimization module. They are responsible for following and enforcing the software development standards of the module, as well as designing, implementing, and maintaining the software.
Developers: A scientist or engineer that uses the Optimization module alongside MOOSE to build their own application. This user will typically have a background in modeling or simulation techniques (and perhaps numerical analysis) but may only have a limited skillset when it comes to code development using the C++ language. This is the primary focus group of the module. In many cases, these developers will be encouraged to contribute module-appropriate code back to the Optimization module, or to MOOSE itself.
Analysts: These are users that will run the code and perform analysis on the simulations they perform. These users may interact with developers of the system requesting new features and reporting bugs found and will typically make heavy use of the input file format.
Assumptions and Dependencies
The Optimization module is developed using MOOSE and can itself be based on various MOOSE modules, as such the SRS for the Optimization module is dependent upon the files listed at the beginning of this document. Any further assumptions or dependencies are outlined in the remainder of this section.
The Optimization module is designed with the fewest possible constraints on hardware and software. For more context on this point, the Optimization module SRS defers to the framework Assumptions and Dependencies. Any physics-based or mathematics-based assumptions in code simulations and code objects are highlighted in their respective documentation pages.
References
Definitions and Acronyms
This section defines, or provides the definition of, all terms and acronyms required to properly understand this specification.
Definitions
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
Acronym | Description |
---|---|
INL | Idaho National Laboratory |
LGPL | GNU Lesser General Public License |
MOOSE | Multiphysics Object Oriented Simulation Environment |
NQA-1 | Nuclear Quality Assurance Level 1 |
POSIX | Portable Operating System Interface |
SRS | Software Requirement Specification |
System Requirements
In general, the following is required for MOOSE-based development:
A POSIX compliant Unix-like operating system. This includes any modern Linux-based operating system (e.g., Ubuntu, Fedora, Rocky, etc.), or a Macintosh machine running either of the last two MacOS releases.
Hardware | Information |
---|---|
CPU Architecture | x86_64, ARM (Apple Silicon) |
Memory | 8 GB (16 GBs for debug compilation) |
Disk Space | 30GB |
Libraries | Version / Information |
---|---|
GCC | 8.5.0 - 12.2.1 |
LLVM/Clang | 10.0.1 - 16.0.6 |
Intel (ICC/ICX) | Not supported at this time |
Python | 3.7 - 3.11 |
Python Packages | packaging pyaml jinja2 |
Functional Requirements
- optimization: Dirackernels
- 11.1.1The system shall support point sources with locations, times, and values given by a vector values with
- forward time stepping;
- reverse time stepping;
- optimization: Executioners
- 11.2.1The system shall be able to debug a optimization solve by
- using finite-difference to compute the gradient;
- testing hand-coded gradient;
- 11.2.2The system shall minimize a constrained quadratic objective function from a test object using the TAO ALMM solver.
- 11.2.3The system shall minimize an inequality constrained quadratic objective function from a test object.
- 11.2.4The system shall be able to minimize a constrained shape optimization problem using the ALMM algorithm.
- 11.2.5The system shall by able to solve the adjoint version of steady-state problems that
- are self-adjoint,
- have non-homogeneous boundary conditions,
- have multiple coupled variables,
- use array variables, and
- have non-linear material properties.
- 11.2.6The system shall be able to solve the adjoint version of transient problems that
- are self-adjoint,
- have multiple coupled variables,
- have non-linear steady-state material properties, and
- have non-uniform time stepping.
- optimization: Functions
- 11.3.1The system shall be able to compute an auxiliary variable based on data from reporter values with
- x-coordinate data;
- x- and y-coordinate data;
- x-, y-, and z-coordinate data;
- time, x-, y-, and z-coordinate data;
- 11.3.2The system shall report an error if
- the size of value vector is wrong;
- x-coordinate data is wrong size;
- y-coordinate data is wrong size;
- z-coordinate data is wrong size;
- time data is wrong size;
- 11.3.3The system shall be able to evaluate a mesh-based interpolation function by
- creating first-order mesh and
- evaluating the first-order parameter values;
- creating second-order mesh and
- evaluating the second-order parameter values;
- creating piece-wise constant mesh and
- evaluating the piece-wise constant parameter values;
- evaluating transient parameter values;
- 11.3.4The system shall support parsed function expressions with parameter values by
- computing parameter gradient;
- erroring if vector is incorrect size;
- optimization: Misc
- 11.4.1The system shall throw out a warning when scalings are assigned to adjoint variable to remind users that no scaling will be performed for adjoint system.
- optimization: Optimizationreporter
- 11.5.1The system shall be able to scale linear and constant functions involved in two separate Neumann boundary conditions both applied to the same sideset using two parsed functions and the scale of the linear and constant functions are both being parameterized using
- a matrix-free Hessian approach or
- automatic adjoint evaluation.
- 11.5.2The system shall be able to invert for the value of a material property in two separate regions using
- a gradient evaluated in a separate multiapp with parameter initial conditons 1.5x higher than the true solution;
- a gradient evaluated in a separate multiapp using Tikhonov regularization and parameter initial conditons 3x higher than the true solution; or
- a gradient evaluated with an automatically computed adjoint.
- 11.5.3The system shall be able to optimize the magnitude of a source for a
- linear diffusion problem;
- diffusion problem with nonlinear coefficient;
- 11.5.4The system shall be able to minimize an objective function that is reporter transfer using TAO and output parameters used for each evaulation.
- 11.5.5The system shall be able to invert for point loads using the general optimization reporter with
- the measurement data defined on the forward_and_adjoint app;
- the measurement data defined on the main app and transferred to theforward_and_adjoint app while maintaining the correct preconditioning on the adjoint system;
- the measurment data defined on the separate subapps;
- the measurment data defined on the separate subapps and using regularization;
- 11.5.6The system shall be able to perform gradient based material parameter inversion for a single material property.
- 11.5.7The system shall be able to perform inverse optimization on a source that is represented by a mesh by
- creating the source mesh;
- performing the inverse optimization with a piece-wise source;
- performing the inverse optimization with a linearly varying source;
- performing the inverse optimization with a quadratically varying source;
- performing the inverse optimization with bounds;
- performing the inverse optimization with an automatically computed adjoint;
- creating a mesh with initial conditions;
- performing the inverse optimization with exact solution initial conditions that will make it converge in a single step;
- 11.5.8The system shall throw an error when performing inverse optimization on mesh-based parameters if there is a mismatch between the number of parameters and the number of
- meshes;
- finite-element families;
- finite-element orders;
- initial conditions;
- 11.5.9The system shall throw an error when performing inverse optimization on mesh-based parameters if the parameter function spaces do not match the space defined in the
- forward problem;
- adjoint problem;
- 11.5.10The system shall be able perform inverse source optimization on a problem with nonlinear material properties using automatically computed adjoint.
- 11.5.11The system shall correctly read in parameter data defined in the input file
- measurement data from the input file;
- with lower bounds, upper bounds and initial conditions provided for every parameter and measurement data from a CSV file;
- with lower bounds, upper bounds and initial conditions constant for each group and measurement data from a CSV file;
- with lower bounds, upper bounds and initial conditions are a mix of constant per group and every parameter in a group and measurement data from a CSV file;
- and error if parameters are provided but do not include a parameter for every group;
- and error if an incorrect number of parameters are provided for a group;
- 11.5.12The system shall be able to read variable weights and use them to scale the misfit.
- 11.5.13The system shall correctly read in one parameter group defined on the mesh
- by first creating the parameter mesh containing the data;
- with initial conditions, upper and lower bounds defined on the mesh for all timesteps;
- with initial conditions, upper and lower bounds defined in input file;
- with initial conditions and lower bound read from input file and upper bound read from the last timestep in the mesh.
- 11.5.14The system shall correctly read in two groups of parameter data defined on the mesh
- for initial conditions, upper and lower bounds defined on the mesh for all timesteps;
- for initial conditions, upper and lower bounds defined in input file;
- for initial conditions and lower bound read from input file and upper bound read from the last timestep in the mesh;
- for the first group being first order Lagrange and second group being second order Lagrange nodal variables.
- 11.5.15The system shall throw an error when parameter data is incorrectly defined
- by having input and mesh parameters for the same bound;
- by having a parameter not on the exodus mesh;
- by using nodal and elemental exodus variables to define parameter data in the same parameter group;
- by not having the same number of optimization timesteps and timesteps for reading parameter data from the mesh;
- by specifying a timestep for reading parameter data from the exodus file but not parameter data is being read from the mesh because it is all specified in the input file;
- by specifying a timestep that is bigger than the timestpes on the exodus the exodus mesh.
- 11.5.16The system shall be able to invert for point loads using
- Hessian-based optimization,
- ill-posed Hessian-based optimization with Tikhonov regularization,
- gradient-based optimization,
- ill-posed gradient-based optimization with Tikhonov regularization,
- gradient-based optimization with an automatically computed adjoint that uses the same preconditioner as the forward solve, or
- gradient-based optimization with an automatically computed adjoint, with Tikhonov regularization, and initial conditions do not affect the converged regularized solution, or
- print finite difference gradient information to the screen when using the automatically formed adjoint.
- optimization: Outputs
- 11.6.1The system shall be able to perform gradient based material parameter inversion for a single material property and output the iteration-wise exodus output for the adjoint problem.
- 11.6.2The system shall be able to invert for point loads using gradient-based optimization with an automatically computed adjoint and output the exodus output per iteration for the combined forward and adjoint problem variables.
- optimization: Reporter
- 11.7.1The system shall create synthetic transient data in a consumable format.
- optimization: Reporters
- 11.8.1The system shall be able to find an optimal value to a linear combination of parallel forward problems run using the sampler system.
- 11.8.2The system shall be able to row sum a vector of vectors into a single vector, perform a dot product between two vectors and sum all of the entries of a single vector.
- 11.8.3The system shall throw a reasonable error when reducing a vectors of vectors into a single vector and the input vectors contained in the vector of vectors do not have the same size.
- 11.8.4The system shall throw a reasonable error when the vectors being combined into a single vector using arithmetic operations are not the same size.
- optimization: Simp
- 11.9.1The system shall be able to run a diffusion problem through the density update machinery with filtered fake sensitivities to optimize the material distribution applying a bisection algorithm.
- 11.9.2The system shall be able to run a diffusion problem through the density update machinery with filtered fake sensitivities to optimize the material distribution applying a bisection algorithm to a block restricted system.
- 11.9.3The system shall be able to run a diffusion problem through the density update for multiple materials, volume constraint, and cost constraint machinery with filtered fake sensitivities to optimize the material distribution applying a bisection algorithm.
- 11.9.4The system shall be able to run a diffusion problem through the density update for multiple materials, volume constraint, and cost constraint machinery with filtered fake sensitivities to optimize the material distribution applying a bisection algorithm to a block restricted system.
- optimization: Userobjects
- 11.10.1The system shall be able to load a time-dependent solution from an exodus file while reversing the timesteps by
- producing the exodus file;
- loading on to the same mesh;
- loading on to a coarser mesh;
- interpolating different time steps;
- erroring if file is not exodus;
- optimization: Vectorpostprocessors
- 11.11.1The system shall be able to compute the inner product of adjoint strain and derivative of stress with respect to the material property value.
- 11.11.2The system shall be able to compute the inner product of two RankTwoTensor material properties and match the result from the batch material implementation.
- 11.11.3The system shall be able to compute the inner product between two variables weighted by the derivative of a function with respect to the vector it depends on.
- 11.11.4The system shall be able to compute the inner product of a variable and a nearest node optimization volumetric source function.
Usability Requirements
No requirements of this type exist for this application, beyond those of its dependencies.Performance Requirements
No requirements of this type exist for this application, beyond those of its dependencies.System Interfaces
No requirements of this type exist for this application, beyond those of its dependencies.System Operations
Human System Integration Requirements
The Optimization module is command line driven and conforms to all standard terminal behaviors. Specific human system interaction accommodations shall be a function of the end-user's terminal. MOOSE (and therefore the Optimization module) does support optional coloring within the terminal's ability to display color, which may be disabled.
Maintainability
The latest working version (defined as the version that passes all tests in the current regression test suite) shall be publicly available at all times through the repository host provider.
Flaws identified in the system shall be reported and tracked in a ticket or issue based system. The technical lead will determine the severity and priority of all reported issues and assign resources at their discretion to resolve identified issues.
The software maintainers will entertain all proposed changes to the system in a timely manner (within two business days).
The core software in its entirety will be made available under the terms of a designated software license. These license terms are outlined in the LICENSE file alongside the Optimization module source code. As a MOOSE physics module, the license for the Optimization module is identical to that of the framework - that is, the LGPL version 2.1 license.
Reliability
The regression test suite will cover at least 86% of all lines of code within the Optimization module at all times. Known regressions will be recorded and tracked (see Maintainability) to an independent and satisfactory resolution.
System Modes and States
MOOSE applications normally run in normal execution mode when an input file is supplied. However, there are a few other modes that can be triggered with various command line flags as indicated here:
Command Line Flag | Description of mode |
---|---|
-i <input_file> | Normal execution mode |
--split-mesh <splits> | Read the mesh block splitting the mesh into two or more pieces for use in a subsequent run |
--use-split | (implies -i flag) Execute the simulation but use pre-split mesh files instead of the mesh from the input file |
--yaml | Output all object descriptions and available parameters in YAML format |
--json | Output all object descriptions and available parameters in JSON format |
--syntax | Output all registered syntax |
--registry | Output all known objects and actions |
--registry-hit | Output all known objects and actions in HIT format |
--mesh-only (implies -i flag) | Run only the mesh related tasks and output the final mesh that would be used for the simulation |
--start-in-debugger <debugger> | Start the simulation attached to the supplied debugger |
The list of system-modes may not be extensive as the system is designed to be extendable to end-user applications. The complete list of command line options for applications can be obtained by running the executable with zero arguments. See the command line usage.
Physical Characteristics
The Optimization module is software only with no associated physical media. See System Requirements for a description of the minimum required hardware necessary for running the Optimization module.
Environmental Conditions
Not Applicable
System Security
MOOSE-based applications such as the Optimization module have no requirements or special needs related to system security. The software is designed to run completely in user-space with no elevated privileges required nor recommended.
Information Management
The core framework and all modules in their entirety will be made publicly available on an appropriate repository hosting site. Day-to-day backups and security services will be provided by the hosting service. More information about MOOSE backups of the public repository on INL-hosted services can be found on the following page: GitHub Backups
Polices and Regulations
MOOSE-based applications must comply with all export control restrictions.
System Life Cycle Sustainment
MOOSE-based development follows various agile methods. The system is continuously built and deployed in a piecemeal fashion since objects within the system are more or less independent. Every new object requires a test, which in turn requires an associated requirement and design description. The Optimization module development team follows the NQA-1 standards.
Packaging, Handling, Shipping and Transportation
No special requirements are needed for packaging or shipping any media containing MOOSE and Optimization module source code. However, some MOOSE-based applications that use the Optimization module may be export-controlled, in which case all export control restrictions must be adhered to when packaging and shipping media.
Verification
The regression test suite will employ several verification tests using comparison against known analytical solutions, the method of manufactured solutions, and convergence rate analysis.