LLNL/parelagmc

Name: parelagmc

Owner: Lawrence Livermore National Laboratory

Description: Parallel element agglomeration multilevel Monte Carlo library.

Created: 2018-01-05 17:27:34.0

Updated: 2018-01-05 17:27:34.0

Pushed: 2018-01-05 17:27:35.0

Homepage: null

Size: 0

Language: null

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

/* Copyright (c) 2018, Lawrence Livermore National Security, LLC. Produced at Lawrence Livermore National Laboratory. LLNL-CODE-747639. All rights reserved. Please see COPYRIGHT and LICENSE for details.
This file is part of the ParELAGMC library. For more information and source code availability see https://github.com/LLNL/parelagmc.

ParELAGMC is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License (as published by the
Free Software Foundation) version 2, dated June 1991.
*/

Parallel Element Agglomeration Multilevel Monte Carlo Library
                             version 1.0
    ________              ____________________________________  ___________
    ___  __ \_____ __________  ____/__  /___    |_  ____/__   |/  /_  ____/
    __  /_/ /  __ `/_  ___/_  __/  __  / __  /| |  / __ __  /|_/ /_  /
    _  ____// /_/ /_  /   _  /___  _  /___  ___ / /_/ / _  /  / / / /___
    /_/     \__,_/ /_/    /_____/  /_____/_/  |_\____/  /_/  /_/  \____/
Introduction

ParELAGMC is a parallel distributed memory C++ library for multilevel Monte Carlo (MLMC) simulations with algebraically constructed coarse spaces, primarily focusing on generating Gaussian random fields using a novel SPDE sampling technique.

ParELAGMC enables multilevel variance reduction techniques in the context of general unstructured meshes by using the specialized element-based agglomeration techniques implemented in ParELAG.

The nested hierarchies of algebraically coarse spaces produced by ParELAG are then used to discretize different realizations of the stochastic problem at different spatial resolution, thus allowing for optimal scaling of the multilevel Monte Carlo Method.

ParELAGMC implements different sampling techniques for spatially correlated random fields including the Karhunen?Loève expansion (KLE) for small scale problems and stochastic PDE (SPDE) samplers for large-scale applications. The SPDE sampler provides samples from a Gaussian random field with a Matern covariance function (equivalent to an exponential random field in 3D) and involves solving mixed finite element formulation of a stochastic reaction-diffusion equation with a random, white noise source function. Then the sampler is able to leverage existing scalable solution strategies, thus is a scalable alternative for sampling for large-scale simulations.

Additionally, the library provides functionality to compute the Bayesian posterior expectation of a quantity of interest. The posterior expectation can be computed as a ratio of prior expectations, then approximated using Monte Carlo sampling methods.

The ParELAGMC library can support different type of deterministic problems. In the examples, we present an application to subsurface flow simulation in the mixed finite element setting.

Please see the following publications, and the references therein, for an introduction to these methods:

User Guide
Dependencies

ParELAGMC requires a MPI C++ compiler, as well as the following external libraries:

ParELAGMC has optional dependencies that enable additional functionality:

Building with CMake

CMake (version 3.1 or newer) is used to generate the build system for ParELAGMC.

The CMake system maintains an infrastructure to find and properly link the required libraries when building the ParELAGMC library (see the “Dependencies” section for a complete list of the required and optional libraries).

PLEASE DO NOT DO AN IN-SOURCE BUILD! It will pollute your source tree with various files generated and used by CMake. It is best practice to create a build directory.

The configuration step is performed by running

kdir <build-dir> ; cd <build-dir>                                
make <source-dir> [OPTIONS] ...

Optionally, a shell-script can be used to set the options and invoke CMake. Using a script provides a convenient way to repeat the same configuration repeatedly. Some shell-script templates are located in cmake/example_scripts that provide guidance on invoking CMake. These are provided merely as a suggestion for different ways to build ParELAGMC.

For CMake to find the required libraries, set the environment variables

Some important flags/options are (defaults are in [brackets]):

After CMake configures and generates successfully, change to your build directory (the directory that is listed after “Build files have been written to: " at the bottom of the CMake output) and invoke the build system (i.e. call make or ninja, etc.) to build the library.

The build can be tested by running ctest in the build directory.

Doxygen documentation can be built by executing make doc in the build directory.

Using ParELAGMC

The intent of the library is to provide a modular methodology to specify a Monte Carlo simulation by defining a forward model problem
solver and a sampler strategy.

Currently, the forward model problem is a mixed Darcy problem (implemented in DarcySolver), whereas the sampler of a log-normal spatially correlated random field (that is exp(s) where s is a Gaussian random field) can be one of the following:

Note: For the SPDE sampler with mesh embedding, the boundary of the enlarged/embedded mesh should be at least a correlation length away from the boundary of the original mesh.

The linear solvers for the forward model problem and the saddle point linear system for the SPDE sampler are specified at runtime from the software framework within ParELAG, using solvers and preconditioners from the HYPRE preconditioner and sparse numerical linear algebra library.

Examples

The examples in the examples/ directory build by default. Calling one without arguments uses default values. To specify parameter values, a XML parameter list is specified via command line (--xml-file parameter_list.xml).

Sample parameters are found in build_dir/examples/example_parameters.xml and other parameters lists can be found in src_dir/examples/example_parameterlists.

The directory /meshes contains example finite element meshes, including embedded meshes with matching and non-matching interfaces useful for running examples. Otherwise, a simple finite element mesh is built in the example.

Some examples include:

Additionally, the library provides functionality to compute the Bayesian posterior expectation of a quantity of interest. The posterior expectation can be computed as a ratio of prior expectations using Bayes' rule, then approximated using Monte Carlo sampling methods. That is, E_posterior[Q] = E[Q \Pi_{likelihood}]/E[\Pi_likelihood]. Also, the splitting estimator can be computed, that is, Splitting-E_posterior[Q] = E[(Q \Pi_likelihood)/(\Pi_likelihood)].

This methodology is examined in the following examples:

Examples ending with _Legacy indicate that the forward model problem and sampler use a particular solver/preconditioner strategy to solve the resulting saddle point problems as specified in this publication.

An optional directory of examples using the permeability data from the SPE Comparative Solution Project Model 2 are found in examples/SPE10.

License

Copyright information and licensing restrictions can be found in the file COPYRIGHT. The ParELAGMC library is licensed under the GPL v2.0, see the file LICENSE.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.