Commit d81a54f2 authored by niklas.baumgarten's avatar niklas.baumgarten
Browse files

worked on notebooks and on pipeline

parent 6f3aebf3
......@@ -3,27 +3,26 @@ stages:
- test
- benchmark
cache:
paths:
- build/mpp/LIB_PS
- build/mpp/googletest
- sprng5
before_script:
- module add foss
- module add OpenMPI/3.1.1-GCC-7.3.0-2.30
- module add Anaconda3
- if [ -z "$(ls sprng5/)" ]; then
- tar xjf sprng5.tar.bz2
- cd sprng5
- ./configure --with-mpi=yes --with-fortran=no
- make -j20
- cd ..
- else
- echo "Using sprng5 from cache"
- fi
- module add foss
- module add OpenMPI/3.1.1-GCC-7.3.0-2.30
- module add Anaconda3
- if [ -z "$(ls sprng5/)" ]; then
- tar xjf sprng5.tar.bz2
- cd sprng5
- ./configure --with-mpi=yes --with-fortran=no
- make -j20
- cd ..
- else
- echo "Using sprng5 from cache"
- fi
build-mlmc:
stage: build
......@@ -55,29 +54,42 @@ test-mlmc:
- cmake .. -DBUILD_MLMC_TESTS=ON
- make -j20
- cd tests
- mpirun -n 4 TestMainProgram
- mpirun -n 4 TestMainProgramElliptic
- mpirun -n 4 TestMainProgramTransport
- mpirun -n 4 TestMultilevelPlotter
benchmark-mlmc:
benchmark-elliptic-mlmc:
stage: benchmark
variables:
BENCHMARK: "false"
KERNELS: "4"
BENCHMARK: ''
only:
variables:
- $BENCHMARK == "true"
- $BENCHMARK == 'all'
- $BENCHMARK == 'elliptic'
script:
- cd build
- cmake ..
- make -j
- cd tests
- mpirun -n $KERNELS BenchmarkEllipticResults
- jupyter nbconvert --ExecutePreprocessor.timeout=600 --execute --to html notebooks/Elliptic\ Experiments.ipynb
artifacts:
paths:
- build/tests/log/log
paths:
- notebooks/Elliptic\ Experiments.html
benchmark-transport-mlmc:
stage: benchmark
variables:
BENCHMARK: ''
only:
variables:
- $BENCHMARK == 'all'
- $BENCHMARK == 'transport'
script:
- jupyter nbconvert --ExecutePreprocessor.timeout=600 --execute --to html notebooks/Transport\ Experiments.ipynb
artifacts:
paths:
- notebooks/Transport\ Experiments.html
\ No newline at end of file
......@@ -107,11 +107,45 @@
"\n",
"================ running cmake ================\n",
"\n",
"-- The C compiler identification is GNU 9.2.1\n",
"-- The CXX compiler identification is GNU 9.2.1\n",
"-- Check for working C compiler: /usr/bin/cc\n",
"-- Check for working C compiler: /usr/bin/cc -- works\n",
"-- Detecting C compiler ABI info\n",
"-- Detecting C compiler ABI info - done\n",
"-- Detecting C compile features\n",
"-- Detecting C compile features - done\n",
"-- Check for working CXX compiler: /usr/bin/c++\n",
"-- Check for working CXX compiler: /usr/bin/c++ -- works\n",
"-- Detecting CXX compiler ABI info\n",
"-- Detecting CXX compiler ABI info - done\n",
"-- Detecting CXX compile features\n",
"-- Detecting CXX compile features - done\n",
"-- Setting prepare commit message hook to mpp\n",
" file: /home/niklas/CLionProjects/mlmc/mpp/doc/../../.git/modules/mpp/hooks/prepare-commit-msg\n",
"-- Found PythonInterp: /home/niklas/anaconda3/bin/python (found version \"3.6.5\") \n",
"-- Looking for pthread.h\n",
"-- Looking for pthread.h - found\n",
"-- Looking for pthread_create\n",
"-- Looking for pthread_create - not found\n",
"-- Looking for pthread_create in pthreads\n",
"-- Looking for pthread_create in pthreads - not found\n",
"-- Looking for pthread_create in pthread\n",
"-- Looking for pthread_create in pthread - found\n",
"-- Found Threads: TRUE \n",
"-- Found MPI_C: /usr/lib/x86_64-linux-gnu/openmpi/lib/libmpi.so (found version \"3.1\") \n",
"-- Found MPI_CXX: /usr/lib/x86_64-linux-gnu/openmpi/lib/libmpi_cxx.so (found version \"3.1\") \n",
"-- Found MPI: TRUE (found version \"3.1\") \n",
"-- C++ version= 17\n",
"-- Compiler version= c++\n",
"-- Compiler optimization= -O0\n",
"-- Looking for sgemm_\n",
"-- Looking for sgemm_ - not found\n",
"-- Looking for sgemm_\n",
"-- Looking for sgemm_ - found\n",
"-- Found BLAS: /usr/lib/x86_64-linux-gnu/libblas.so \n",
"-- Looking for cheev_\n",
"-- Looking for cheev_ - found\n",
"-- A library with LAPACK API found.\n",
"-- Using SuperLU 4.0\n",
"-- Time independent problem\n",
......@@ -127,18 +161,154 @@
"\n",
"================ running make ================\n",
"\n",
"[ 5%] Built target LIB_PS\n",
"[ 5%] Built target gtest\n",
"[ 9%] Built target gmock\n",
"[ 21%] Built target MLMC\n",
"[ 23%] Built target gtest_main\n",
"[ 24%] Built target gmock_main\n",
"[ 92%] Built target SRC\n",
"[ 94%] Built target BenchmarkTransportResults\n",
"[ 96%] Built target MLMC-M++\n",
"[ 97%] Built target BenchmarkEllipticResults\n",
"[ 99%] Built target TestMainProgram\n",
"[100%] Built target TestMultilevelPlotter\n"
"Scanning dependencies of target gtest\n",
"Scanning dependencies of target LIB_PS\n",
"[ 1%] Building CXX object mpp/googletest/googletest/CMakeFiles/gtest.dir/src/gtest-all.cc.o\n",
"[ 1%] Building CXX object mpp/LIB_PS/CMakeFiles/LIB_PS.dir/LIB_PS.C.o\n",
"Scanning dependencies of target MLMC\n",
"[ 2%] Building CXX object mlmc/src/CMakeFiles/MLMC.dir/assemble/EllipticAssemble.cpp.o\n",
"Scanning dependencies of target SRC\n",
"[ 2%] Building CXX object mpp/src/CMakeFiles/SRC.dir/geometry/Point.C.o\n",
"[ 3%] Building CXX object mpp/src/CMakeFiles/SRC.dir/Quadrature.C.o\n",
"[ 4%] Building CXX object mpp/LIB_PS/CMakeFiles/LIB_PS.dir/LIB_PS_Matrix.C.o\n",
"[ 5%] Building CXX object mpp/src/CMakeFiles/SRC.dir/shapes/Shapes.cpp.o\n",
"[ 6%] Building CXX object mpp/LIB_PS/CMakeFiles/LIB_PS.dir/LIB_PS_Parallel.C.o\n",
"[ 7%] Linking CXX static library ../../../lib/libgtest.a\n",
"[ 7%] Built target gtest\n",
"[ 8%] Building CXX object mpp/src/CMakeFiles/SRC.dir/Identify.C.o\n",
"[ 9%] Linking CXX static library libLIB_PS.a\n",
"[ 10%] Building CXX object mlmc/src/CMakeFiles/MLMC.dir/assemble/MixedEllipticAssemble.cpp.o\n",
"[ 10%] Built target LIB_PS\n",
"Scanning dependencies of target gmock\n",
"[ 11%] Building CXX object mpp/googletest/googlemock/CMakeFiles/gmock.dir/src/gmock-all.cc.o\n",
"[ 12%] Building CXX object mpp/src/CMakeFiles/SRC.dir/Distribution.C.o\n",
"Scanning dependencies of target gtest_main\n",
"[ 13%] Building CXX object mpp/googletest/googletest/CMakeFiles/gtest_main.dir/src/gtest_main.cc.o\n",
"[ 14%] Linking CXX static library ../../../lib/libgmock.a\n",
"[ 14%] Built target gmock\n",
"[ 15%] Building CXX object mpp/src/CMakeFiles/SRC.dir/SpaceTimeDistribution.cpp.o\n",
"[ 16%] Linking CXX static library ../../../lib/libgtest_main.a\n",
"[ 16%] Built target gtest_main\n",
"[ 16%] Building CXX object mpp/src/CMakeFiles/SRC.dir/dof/DoF.C.o\n",
"[ 16%] Building CXX object mlmc/src/CMakeFiles/MLMC.dir/assemble/DGEllipticAssemble.cpp.o\n",
"[ 17%] Building CXX object mpp/src/CMakeFiles/SRC.dir/dof/MixedCellDof.cpp.o\n",
"[ 18%] Building CXX object mlmc/src/CMakeFiles/MLMC.dir/assemble/HybridEllipticAssemble.cpp.o\n",
"[ 19%] Building CXX object mlmc/src/CMakeFiles/MLMC.dir/assemble/DGTransportAssemble.cpp.o\n",
"[ 20%] Building CXX object mlmc/src/CMakeFiles/MLMC.dir/assemble/DGReactionAssemble.cpp.o\n",
"[ 21%] Building CXX object mlmc/src/CMakeFiles/MLMC.dir/assemble/PGReactionAssemble.cpp.o\n",
"[ 22%] Building CXX object mpp/src/CMakeFiles/SRC.dir/Interface.C.o\n",
"[ 23%] Building CXX object mlmc/src/CMakeFiles/MLMC.dir/main/MainProgram.cpp.o\n",
"Scanning dependencies of target gmock_main\n",
"[ 23%] Building CXX object mpp/googletest/googlemock/CMakeFiles/gmock_main.dir/src/gmock_main.cc.o\n",
"[ 24%] Building CXX object mpp/src/CMakeFiles/SRC.dir/Algebra.C.o\n",
"[ 25%] Building CXX object mpp/src/CMakeFiles/SRC.dir/basicalgebra/LazyVectors.cpp.o\n",
"[ 26%] Linking CXX static library ../../../lib/libgmock_main.a\n",
"[ 26%] Built target gmock_main\n",
"[ 26%] Building CXX object mlmc/src/CMakeFiles/MLMC.dir/main/MultilevelPlotter.cpp.o\n",
"[ 27%] Building CXX object mlmc/src/CMakeFiles/MLMC.dir/main/Utils.cpp.o\n",
"[ 28%] Building CXX object mpp/src/CMakeFiles/SRC.dir/Sparse.C.o\n",
"[ 29%] Building CXX object mlmc/src/CMakeFiles/MLMC.dir/montecarlo/MonteCarlo.cpp.o\n",
"[ 29%] Building CXX object mpp/src/CMakeFiles/SRC.dir/Transfer.C.o\n",
"[ 30%] Building CXX object mpp/src/CMakeFiles/SRC.dir/Small.C.o\n",
"[ 31%] Building CXX object mlmc/src/CMakeFiles/MLMC.dir/montecarlo/MonteCarloElliptic.cpp.o\n",
"[ 32%] Building CXX object mlmc/src/CMakeFiles/MLMC.dir/montecarlo/MonteCarloTransport.cpp.o\n",
"[ 33%] Building CXX object mlmc/src/CMakeFiles/MLMC.dir/montecarlo/MultilevelMonteCarlo.cpp.o\n",
"[ 34%] Building CXX object mpp/src/CMakeFiles/SRC.dir/Euler.C.o\n",
"[ 35%] Building CXX object mpp/src/CMakeFiles/SRC.dir/TimeSeries.C.o\n",
"[ 36%] Building CXX object mpp/src/CMakeFiles/SRC.dir/m++.cpp.o\n",
"[ 37%] Building CXX object mpp/src/CMakeFiles/SRC.dir/utility/TimeDate.C.o\n",
"[ 37%] Building CXX object mlmc/src/CMakeFiles/MLMC.dir/stochastics/CirculantEmbedding.cpp.o\n",
"[ 38%] Building CXX object mlmc/src/CMakeFiles/MLMC.dir/stochastics/HybridFluxGenerator.cpp.o\n",
"[ 39%] Building CXX object mlmc/src/CMakeFiles/MLMC.dir/stochastics/RandomNumberManager.cpp.o\n",
"[ 39%] Building CXX object mpp/src/CMakeFiles/SRC.dir/utility/Config.cpp.o\n",
"[ 40%] Building CXX object mpp/src/CMakeFiles/SRC.dir/utility/ctools.C.o\n",
"[ 41%] Building CXX object mpp/src/CMakeFiles/SRC.dir/utility/SaveLoad.C.o\n",
"[ 42%] Building CXX object mpp/src/CMakeFiles/SRC.dir/utility/Logger.cpp.o\n",
"[ 43%] Building CXX object mpp/src/CMakeFiles/SRC.dir/utility/Assertion.cpp.o\n",
"[ 44%] Building CXX object mpp/src/CMakeFiles/SRC.dir/utility/M_IOFiles.cpp.o\n",
"[ 45%] Linking CXX static library libMLMC.a\n",
"[ 45%] Built target MLMC\n",
"[ 45%] Building CXX object mpp/src/CMakeFiles/SRC.dir/utility/Random.cpp.o\n",
"[ 46%] Building CXX object mpp/src/CMakeFiles/SRC.dir/utility/MemoryLogger.cpp.o\n",
"[ 47%] Building CXX object mpp/src/CMakeFiles/SRC.dir/parallel/ProcSet.cpp.o\n",
"[ 48%] Building CXX object mpp/src/CMakeFiles/SRC.dir/parallel/ExchangeBuffer.cpp.o\n",
"[ 49%] Building CXX object mpp/src/CMakeFiles/SRC.dir/parallel/Parallel.C.o\n",
"[ 50%] Building CXX object mpp/src/CMakeFiles/SRC.dir/cells/Intval.cpp.o\n",
"[ 50%] Building CXX object mpp/src/CMakeFiles/SRC.dir/cells/TIntval.cpp.o\n",
"[ 51%] Building CXX object mpp/src/CMakeFiles/SRC.dir/cells/Triangle.cpp.o\n",
"[ 52%] Building CXX object mpp/src/CMakeFiles/SRC.dir/cells/Quadrilateral.cpp.o\n",
"[ 53%] Building CXX object mpp/src/CMakeFiles/SRC.dir/cells/Cell.C.o\n",
"[ 54%] Building CXX object mpp/src/CMakeFiles/SRC.dir/mesh/Mesh.C.o\n",
"[ 55%] Building CXX object mpp/src/CMakeFiles/SRC.dir/mesh/Meshfile.cpp.o\n",
"[ 55%] Building CXX object mpp/src/CMakeFiles/SRC.dir/mesh/SpaceTimeMesh.cpp.o\n",
"[ 56%] Building CXX object mpp/src/CMakeFiles/SRC.dir/mesh/datamesh/DataRule.cpp.o\n",
"[ 57%] Building CXX object mpp/src/CMakeFiles/SRC.dir/mesh/datamesh/DataSet.cpp.o\n",
"[ 58%] Building CXX object mpp/src/CMakeFiles/SRC.dir/matrixgraph/MatrixGraph.C.o\n",
"[ 59%] Building CXX object mpp/src/CMakeFiles/SRC.dir/matrixgraph/CellMatrixGraph.cpp.o\n",
"[ 60%] Building CXX object mpp/src/CMakeFiles/SRC.dir/discretization/Discretization.C.o\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"[ 60%] Building CXX object mpp/src/CMakeFiles/SRC.dir/discretization/DGUtils.C.o\n",
"[ 61%] Building CXX object mpp/src/CMakeFiles/SRC.dir/discretization/SpaceTimeDiscretization.cpp.o\n",
"[ 62%] Building CXX object mpp/src/CMakeFiles/SRC.dir/elements/Element.cpp.o\n",
"[ 63%] Building CXX object mpp/src/CMakeFiles/SRC.dir/elements/Elements.C.o\n",
"[ 64%] Building CXX object mpp/src/CMakeFiles/SRC.dir/elements/ScalarFaceElement.C.o\n",
"[ 65%] Building CXX object mpp/src/CMakeFiles/SRC.dir/elements/VectorFieldFaceElement.C.o\n",
"[ 65%] Building CXX object mpp/src/CMakeFiles/SRC.dir/elements/MixedElement.C.o\n",
"[ 66%] Building CXX object mpp/src/CMakeFiles/SRC.dir/elements/MixedFaceElement.C.o\n",
"[ 67%] Building CXX object mpp/src/CMakeFiles/SRC.dir/elements/TaylorHoodElement.C.o\n",
"[ 68%] Building CXX object mpp/src/CMakeFiles/SRC.dir/elements/EqualOrderElement.C.o\n",
"[ 69%] Building CXX object mpp/src/CMakeFiles/SRC.dir/elements/RT0FaceElement.C.o\n",
"[ 70%] Building CXX object mpp/src/CMakeFiles/SRC.dir/elements/RT0_P0Element.C.o\n",
"[ 70%] Building CXX object mpp/src/CMakeFiles/SRC.dir/elements/RT0_P1Element.C.o\n",
"[ 71%] Building CXX object mpp/src/CMakeFiles/SRC.dir/elements/CurlElement.C.o\n",
"[ 72%] Building CXX object mpp/src/CMakeFiles/SRC.dir/elements/DGElement.C.o\n",
"[ 73%] Building CXX object mpp/src/CMakeFiles/SRC.dir/elements/DGFaceElement.C.o\n",
"[ 74%] Building CXX object mpp/src/CMakeFiles/SRC.dir/solver/preconditioner/Preconditioner.C.o\n",
"[ 75%] Building CXX object mpp/src/CMakeFiles/SRC.dir/solver/preconditioner/LIB_PS_Solver.C.o\n",
"[ 75%] Building CXX object mpp/src/CMakeFiles/SRC.dir/solver/linearsolver/LinearSolver.C.o\n",
"[ 76%] Building CXX object mpp/src/CMakeFiles/SRC.dir/solver/Solver.C.o\n",
"[ 77%] Building CXX object mpp/src/CMakeFiles/SRC.dir/solver/Newton.C.o\n",
"[ 78%] Building CXX object mpp/src/CMakeFiles/SRC.dir/Plot.C.o\n",
"[ 79%] Building CXX object mpp/src/CMakeFiles/SRC.dir/plot/VtuPlot.cpp.o\n",
"[ 80%] Building CXX object mpp/src/CMakeFiles/SRC.dir/plot/SerialVtuPlot.cpp.o\n",
"[ 80%] Building CXX object mpp/src/CMakeFiles/SRC.dir/plot/ParallelVtuPlot.cpp.o\n",
"[ 81%] Building CXX object mpp/src/CMakeFiles/SRC.dir/spectrum/Eigenpair.cpp.o\n",
"[ 82%] Building CXX object mpp/src/CMakeFiles/SRC.dir/spectrum/Spectrum.cpp.o\n",
"[ 83%] Building CXX object mpp/src/CMakeFiles/SRC.dir/spectrum/EigenSolver.cpp.o\n",
"[ 84%] Building CXX object mpp/src/CMakeFiles/SRC.dir/basicalgebra/RVector.cpp.o\n",
"[ 85%] Building CXX object mpp/src/CMakeFiles/SRC.dir/basicalgebra/SymRMatrix.cpp.o\n",
"[ 85%] Building CXX object mpp/src/CMakeFiles/SRC.dir/basicalgebra/AntisymRMatrix.cpp.o\n",
"[ 86%] Building CXX object mpp/src/CMakeFiles/SRC.dir/basicalgebra/RMatrix.cpp.o\n",
"[ 87%] Building CXX object mpp/src/CMakeFiles/SRC.dir/basicalgebra/CVector.cpp.o\n",
"[ 88%] Building CXX object mpp/src/CMakeFiles/SRC.dir/basicalgebra/HermCMatrix.cpp.o\n",
"[ 89%] Building CXX object mpp/src/CMakeFiles/SRC.dir/basicalgebra/CMatrix.cpp.o\n",
"[ 90%] Building CXX object mpp/src/CMakeFiles/SRC.dir/timeseries/ITimeSeries.cpp.o\n",
"[ 90%] Building CXX object mpp/src/CMakeFiles/SRC.dir/timeseries/TimeSeriesOfFile.cpp.o\n",
"[ 91%] Building CXX object mpp/src/CMakeFiles/SRC.dir/timestepping/ImplicitEuler.cpp.o\n",
"[ 92%] Building CXX object mpp/src/CMakeFiles/SRC.dir/timestepping/TimeIntegrator.cpp.o\n",
"[ 93%] Linking CXX static library libSRC.a\n",
"[ 93%] Built target SRC\n",
"Scanning dependencies of target TestMultilevelPlotter\n",
"Scanning dependencies of target TestMainProgramTransport\n",
"Scanning dependencies of target TestMainProgramElliptic\n",
"Scanning dependencies of target MLMC-M++\n",
"[ 94%] Building CXX object tests/CMakeFiles/TestMultilevelPlotter.dir/TestMultilevelPlotter.cpp.o\n",
"[ 95%] Building CXX object tests/CMakeFiles/TestMainProgramTransport.dir/TestMainProgramTransport.cpp.o\n",
"[ 95%] Building CXX object tests/CMakeFiles/TestMainProgramElliptic.dir/TestMainProgramElliptic.cpp.o\n",
"[ 96%] Building CXX object CMakeFiles/MLMC-M++.dir/mlmc/src/Main.cpp.o\n",
"[ 97%] Linking CXX executable MLMC-M++\n",
"[ 98%] Linking CXX executable TestMultilevelPlotter\n",
"[ 98%] Built target TestMultilevelPlotter\n",
"[ 99%] Linking CXX executable TestMainProgramTransport\n",
"[100%] Linking CXX executable TestMainProgramElliptic\n",
"[100%] Built target MLMC-M++\n",
"[100%] Built target TestMainProgramTransport\n",
"[100%] Built target TestMainProgramElliptic\n"
]
}
],
......@@ -151,6 +321,7 @@
"import pandas as pd\n",
"\n",
"mpp.mute = False\n",
"mpp.clean_cmake_cache()\n",
"mpp.build()\n",
"mpp.executable = \"MLMC-M++\"\n",
"mpp.kernels = 4"
......
......@@ -35,47 +35,22 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Now, we apply the MLMC method to the linear transport equation in the case of a stochastically modeled flux \n",
"$q \\colon \\Omega \\times \\overline{D} \\longrightarrow \\mathbb{R}^{d}$\n",
"Now, we apply the MLMC method to the linear transport equation in the case of a stochastically modeled flux $q \\colon \\Omega \\times \\overline{D} \\longrightarrow \\mathbb{R}^{d}$. We search for the desity $\\rho \\colon \\Omega \\times [0, T] \\times \\overline{D} \\longrightarrow \\mathbb{R}$, such that\n",
"\n",
"\\begin{align}\n",
"\\text{div} \\, \\big( \\kappa(\\omega, x_1, x_2) u(\\omega, x_1, x_2) \\big) &= 0, \\quad \\text{on} \\quad D = (0,1)^2\\\\\n",
" u(\\omega, x_1,x_2) &= 0, \\quad \\text{on} \\quad x_2 = 0 \\\\\n",
" \\nabla u(\\omega, x_1,x_2) \\cdot n &=-1, \\quad \\text{on} \\quad x_2 = 1 \\\\\n",
" \\nabla u(\\omega, x_1,x_2) \\cdot n &= 0, \\quad \\text{on} \\quad x_1 \\in \\{ 0, 1 \\} \n",
"\\partial_t \\rho (\\omega) + \\text{div}(\\rho(\\omega)q(\\omega)) &= 0, \\quad \\text{in } (0, T) \\times D, \\\\\n",
" \\rho(t=0) &= \\rho_0 \\quad \\text{in } D\n",
"\\end{align}\n",
"\n",
"on a suitable probability space $(\\Omega, \\mathcal{F}_\\Omega , \\mathbb{P})$.\n",
"\n",
"We assume that the permeability tensor is isotropic and only depending on the scalar value\n",
"$\\kappa_0(\\omega, x)>0$. We choose a log-normal ansatz\n",
"\n",
"\\begin{align} \\label{kappa_g}\n",
"\t\\kappa_0(\\omega, x) = \\exp\\big(g(\\omega, x)\\big)\\,,\n",
"\\end{align}\n",
"with the inflow boundary conditon\n",
"\n",
"where $g \\colon \\Omega \\times \\bar D \\rightarrow \\mathbb{R}$ is a Gaussian field with a\n",
"covariance kernel characterized by \n",
"\n",
"\\begin{align} \\label{covariance_fct}\n",
"\tC(x,y) = \\sigma^2 \\exp(- \\| x- y \\|_2^s / \\lambda^s)\n",
"\\begin{align}\n",
" \\rho = \\rho_{\\text{in}} \\quad \\text{on } [0, T] \\times \\Gamma_{\\text{in}} = \\{ x \\in \\partial D \\colon q \\cdot n < 0 \\}\n",
"\\end{align}\n",
"\n",
"depending on variance $\\sigma^2$, correlation length $\\lambda$, and a smoothing parameter $s$.\n",
"\n",
"For efficient sampling of these log-normal fields, we use the special structure of covariance matrices\n",
"with circulant embeddings and fast Fourier transforms.\n",
"\n",
"The stochastic fields as above yield uniform regularity estimates for the elliptic model problem, thus for some $0 < t \\leq 1$,\n",
"it is shown that\n",
"on a suitable probability space $(\\Omega, \\mathcal{F}_\\Omega , \\mathbb{P})$.\n",
"\n",
"\\begin{align}\\label{regularity}\n",
"\\| u(\\omega, \\cdot) &\\|_{H^{r + 1}(D)} \\lesssim \\frac{\\kappa_{\\text{max}}(\\omega) \\| \\kappa(\\omega, \\cdot) \\|_{C^t(\\overline{D})}^2}{\\kappa_{\\text{min}(\\omega)^4}} \\nonumber \\\\\n",
"\t\t&\\left( \\| f(\\omega, \\cdot) \\|_{H^{t-1}(D)} + \\| \\kappa(\\omega, \\cdot) \\|_{C^t(\\overline{D})} \\| u_{D}(\\omega, \\cdot) \\|_{H^{t+\\frac{1}{2}}(\\Gamma_{D})} \\right)\n",
"\\end{align}\n",
"for almost all $\\omega \\in \\Omega$ and for all $0 < r < t$. Therefore,\n",
"we can also retrieve convergence results for the finite element\n",
"solution $u_h(\\omega)\\in V_h^c(u_D)$."
"The stochastic flux is a Darcy flux derived from a mixed formulation of the elliptic subsurface model problem with stochastic permeability. "
]
},
{
......@@ -118,18 +93,146 @@
"\n",
"================ running make ================\n",
"\n",
"Scanning dependencies of target LIB_PS\n",
"[ 2%] Built target gtest\n",
"[ 5%] Built target LIB_PS\n",
"[ 19%] Built target MLMC\n",
"[ 21%] Built target gmock\n",
"[ 23%] Built target gtest_main\n",
"[ 24%] Built target gmock_main\n",
"[ 92%] Built target SRC\n",
"[ 94%] Built target BenchmarkTransportResults\n",
"[ 96%] Built target TestMainProgram\n",
"[ 98%] Built target MLMC-M++\n",
"[ 99%] Built target BenchmarkEllipticResults\n",
"[100%] Built target TestMultilevelPlotter\n"
"[ 2%] Building CXX object mpp/LIB_PS/CMakeFiles/LIB_PS.dir/LIB_PS_Matrix.C.o\n",
"[ 3%] Building CXX object mpp/LIB_PS/CMakeFiles/LIB_PS.dir/LIB_PS.C.o\n",
"Scanning dependencies of target MLMC\n",
"[ 4%] Building CXX object mlmc/src/CMakeFiles/MLMC.dir/assemble/EllipticAssemble.cpp.o\n",
"Scanning dependencies of target SRC\n",
"[ 5%] Building CXX object mpp/src/CMakeFiles/SRC.dir/geometry/Point.C.o\n",
"[ 6%] Building CXX object mpp/src/CMakeFiles/SRC.dir/Quadrature.C.o\n",
"[ 7%] Building CXX object mpp/src/CMakeFiles/SRC.dir/shapes/Shapes.cpp.o\n",
"[ 8%] Building CXX object mpp/LIB_PS/CMakeFiles/LIB_PS.dir/LIB_PS_Parallel.C.o\n",
"[ 9%] Linking CXX static library libLIB_PS.a\n",
"[ 11%] Built target gmock\n",
"[ 11%] Built target LIB_PS\n",
"[ 12%] Building CXX object mlmc/src/CMakeFiles/MLMC.dir/assemble/MixedEllipticAssemble.cpp.o\n",
"[ 14%] Built target gtest_main\n",
"[ 15%] Building CXX object mlmc/src/CMakeFiles/MLMC.dir/assemble/DGEllipticAssemble.cpp.o\n",
"[ 16%] Building CXX object mpp/src/CMakeFiles/SRC.dir/Identify.C.o\n",
"[ 16%] Building CXX object mlmc/src/CMakeFiles/MLMC.dir/assemble/HybridEllipticAssemble.cpp.o\n",
"[ 17%] Building CXX object mpp/src/CMakeFiles/SRC.dir/Distribution.C.o\n",
"[ 17%] Building CXX object mpp/src/CMakeFiles/SRC.dir/SpaceTimeDistribution.cpp.o\n",
"[ 18%] Building CXX object mlmc/src/CMakeFiles/MLMC.dir/assemble/DGTransportAssemble.cpp.o\n",
"[ 19%] Building CXX object mpp/src/CMakeFiles/SRC.dir/dof/DoF.C.o\n",
"[ 20%] Built target gmock_main\n",
"[ 21%] Building CXX object mpp/src/CMakeFiles/SRC.dir/dof/MixedCellDof.cpp.o\n",
"[ 22%] Building CXX object mpp/src/CMakeFiles/SRC.dir/Interface.C.o\n",
"[ 23%] Building CXX object mlmc/src/CMakeFiles/MLMC.dir/assemble/DGReactionAssemble.cpp.o\n",
"[ 24%] Building CXX object mlmc/src/CMakeFiles/MLMC.dir/assemble/PGReactionAssemble.cpp.o\n",
"[ 25%] Building CXX object mpp/src/CMakeFiles/SRC.dir/Algebra.C.o\n",
"[ 25%] Building CXX object mpp/src/CMakeFiles/SRC.dir/basicalgebra/LazyVectors.cpp.o\n",
"[ 26%] Building CXX object mpp/src/CMakeFiles/SRC.dir/Sparse.C.o\n",
"[ 27%] Building CXX object mlmc/src/CMakeFiles/MLMC.dir/main/MainProgram.cpp.o\n",
"[ 28%] Building CXX object mpp/src/CMakeFiles/SRC.dir/Transfer.C.o\n",
"[ 29%] Building CXX object mpp/src/CMakeFiles/SRC.dir/Small.C.o\n",
"[ 30%] Building CXX object mpp/src/CMakeFiles/SRC.dir/Euler.C.o\n",
"[ 31%] Building CXX object mpp/src/CMakeFiles/SRC.dir/TimeSeries.C.o\n",
"[ 31%] Building CXX object mpp/src/CMakeFiles/SRC.dir/m++.cpp.o\n",
"[ 31%] Building CXX object mlmc/src/CMakeFiles/MLMC.dir/main/MultilevelPlotter.cpp.o\n",
"[ 32%] Building CXX object mlmc/src/CMakeFiles/MLMC.dir/main/Utils.cpp.o\n",
"[ 33%] Building CXX object mpp/src/CMakeFiles/SRC.dir/utility/TimeDate.C.o\n",
"[ 34%] Building CXX object mlmc/src/CMakeFiles/MLMC.dir/montecarlo/MonteCarlo.cpp.o\n",
"[ 35%] Building CXX object mpp/src/CMakeFiles/SRC.dir/utility/Config.cpp.o\n",
"[ 36%] Building CXX object mpp/src/CMakeFiles/SRC.dir/utility/ctools.C.o\n",
"[ 37%] Building CXX object mpp/src/CMakeFiles/SRC.dir/utility/SaveLoad.C.o\n",
"[ 38%] Building CXX object mlmc/src/CMakeFiles/MLMC.dir/montecarlo/MonteCarloElliptic.cpp.o\n",
"[ 38%] Building CXX object mpp/src/CMakeFiles/SRC.dir/utility/Logger.cpp.o\n",
"[ 39%] Building CXX object mlmc/src/CMakeFiles/MLMC.dir/montecarlo/MonteCarloTransport.cpp.o\n",
"[ 40%] Building CXX object mpp/src/CMakeFiles/SRC.dir/utility/Assertion.cpp.o\n",
"[ 41%] Building CXX object mpp/src/CMakeFiles/SRC.dir/utility/M_IOFiles.cpp.o\n",
"[ 42%] Building CXX object mpp/src/CMakeFiles/SRC.dir/utility/Random.cpp.o\n",
"[ 43%] Building CXX object mpp/src/CMakeFiles/SRC.dir/utility/MemoryLogger.cpp.o\n",
"[ 44%] Building CXX object mpp/src/CMakeFiles/SRC.dir/parallel/ProcSet.cpp.o\n",
"[ 45%] Building CXX object mlmc/src/CMakeFiles/MLMC.dir/montecarlo/MultilevelMonteCarlo.cpp.o\n",
"[ 45%] Building CXX object mpp/src/CMakeFiles/SRC.dir/parallel/ExchangeBuffer.cpp.o\n",
"[ 45%] Building CXX object mlmc/src/CMakeFiles/MLMC.dir/stochastics/CirculantEmbedding.cpp.o\n",
"[ 46%] Building CXX object mpp/src/CMakeFiles/SRC.dir/parallel/Parallel.C.o\n",
"[ 47%] Building CXX object mpp/src/CMakeFiles/SRC.dir/cells/Intval.cpp.o\n",
"[ 48%] Building CXX object mpp/src/CMakeFiles/SRC.dir/cells/TIntval.cpp.o\n",
"[ 49%] Building CXX object mlmc/src/CMakeFiles/MLMC.dir/stochastics/HybridFluxGenerator.cpp.o\n",
"[ 50%] Building CXX object mpp/src/CMakeFiles/SRC.dir/cells/Triangle.cpp.o\n",
"[ 51%] Building CXX object mpp/src/CMakeFiles/SRC.dir/cells/Quadrilateral.cpp.o\n",
"[ 51%] Building CXX object mpp/src/CMakeFiles/SRC.dir/cells/Cell.C.o\n",
"[ 52%] Building CXX object mlmc/src/CMakeFiles/MLMC.dir/stochastics/RandomNumberManager.cpp.o\n",
"[ 53%] Building CXX object mpp/src/CMakeFiles/SRC.dir/mesh/Mesh.C.o\n",
"[ 54%] Building CXX object mpp/src/CMakeFiles/SRC.dir/mesh/Meshfile.cpp.o\n",
"[ 55%] Linking CXX static library libMLMC.a\n",
"[ 55%] Built target MLMC\n",
"[ 56%] Building CXX object mpp/src/CMakeFiles/SRC.dir/mesh/SpaceTimeMesh.cpp.o\n",
"[ 57%] Building CXX object mpp/src/CMakeFiles/SRC.dir/mesh/datamesh/DataRule.cpp.o\n",
"[ 57%] Building CXX object mpp/src/CMakeFiles/SRC.dir/mesh/datamesh/DataSet.cpp.o\n",
"[ 58%] Building CXX object mpp/src/CMakeFiles/SRC.dir/matrixgraph/MatrixGraph.C.o\n",
"[ 59%] Building CXX object mpp/src/CMakeFiles/SRC.dir/matrixgraph/CellMatrixGraph.cpp.o\n",
"[ 60%] Building CXX object mpp/src/CMakeFiles/SRC.dir/discretization/Discretization.C.o\n",
"[ 61%] Building CXX object mpp/src/CMakeFiles/SRC.dir/discretization/DGUtils.C.o\n",
"[ 62%] Building CXX object mpp/src/CMakeFiles/SRC.dir/discretization/SpaceTimeDiscretization.cpp.o\n",
"[ 62%] Building CXX object mpp/src/CMakeFiles/SRC.dir/elements/Element.cpp.o\n",
"[ 63%] Building CXX object mpp/src/CMakeFiles/SRC.dir/elements/Elements.C.o\n",
"[ 64%] Building CXX object mpp/src/CMakeFiles/SRC.dir/elements/ScalarFaceElement.C.o\n",
"[ 65%] Building CXX object mpp/src/CMakeFiles/SRC.dir/elements/VectorFieldFaceElement.C.o\n",
"[ 66%] Building CXX object mpp/src/CMakeFiles/SRC.dir/elements/MixedElement.C.o\n",
"[ 66%] Building CXX object mpp/src/CMakeFiles/SRC.dir/elements/MixedFaceElement.C.o\n",
"[ 67%] Building CXX object mpp/src/CMakeFiles/SRC.dir/elements/TaylorHoodElement.C.o\n",
"[ 68%] Building CXX object mpp/src/CMakeFiles/SRC.dir/elements/EqualOrderElement.C.o\n",
"[ 69%] Building CXX object mpp/src/CMakeFiles/SRC.dir/elements/RT0FaceElement.C.o\n",
"[ 70%] Building CXX object mpp/src/CMakeFiles/SRC.dir/elements/RT0_P0Element.C.o\n",
"[ 71%] Building CXX object mpp/src/CMakeFiles/SRC.dir/elements/RT0_P1Element.C.o\n",
"[ 71%] Building CXX object mpp/src/CMakeFiles/SRC.dir/elements/CurlElement.C.o\n",
"[ 72%] Building CXX object mpp/src/CMakeFiles/SRC.dir/elements/DGElement.C.o\n",
"[ 73%] Building CXX object mpp/src/CMakeFiles/SRC.dir/elements/DGFaceElement.C.o\n",
"[ 74%] Building CXX object mpp/src/CMakeFiles/SRC.dir/solver/preconditioner/Preconditioner.C.o\n",
"[ 75%] Building CXX object mpp/src/CMakeFiles/SRC.dir/solver/preconditioner/LIB_PS_Solver.C.o\n",
"[ 75%] Building CXX object mpp/src/CMakeFiles/SRC.dir/solver/linearsolver/LinearSolver.C.o\n",
"[ 76%] Building CXX object mpp/src/CMakeFiles/SRC.dir/solver/Solver.C.o\n",
"[ 77%] Building CXX object mpp/src/CMakeFiles/SRC.dir/solver/Newton.C.o\n",
"[ 78%] Building CXX object mpp/src/CMakeFiles/SRC.dir/Plot.C.o\n",
"[ 79%] Building CXX object mpp/src/CMakeFiles/SRC.dir/plot/VtuPlot.cpp.o\n",
"[ 80%] Building CXX object mpp/src/CMakeFiles/SRC.dir/plot/SerialVtuPlot.cpp.o\n",
"[ 80%] Building CXX object mpp/src/CMakeFiles/SRC.dir/plot/ParallelVtuPlot.cpp.o\n",
"[ 81%] Building CXX object mpp/src/CMakeFiles/SRC.dir/spectrum/Eigenpair.cpp.o\n",
"[ 82%] Building CXX object mpp/src/CMakeFiles/SRC.dir/spectrum/Spectrum.cpp.o\n",
"[ 83%] Building CXX object mpp/src/CMakeFiles/SRC.dir/spectrum/EigenSolver.cpp.o\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"[ 84%] Building CXX object mpp/src/CMakeFiles/SRC.dir/basicalgebra/RVector.cpp.o\n",
"[ 84%] Building CXX object mpp/src/CMakeFiles/SRC.dir/basicalgebra/SymRMatrix.cpp.o\n",
"[ 85%] Building CXX object mpp/src/CMakeFiles/SRC.dir/basicalgebra/AntisymRMatrix.cpp.o\n",
"[ 86%] Building CXX object mpp/src/CMakeFiles/SRC.dir/basicalgebra/RMatrix.cpp.o\n",
"[ 87%] Building CXX object mpp/src/CMakeFiles/SRC.dir/basicalgebra/CVector.cpp.o\n",
"[ 88%] Building CXX object mpp/src/CMakeFiles/SRC.dir/basicalgebra/HermCMatrix.cpp.o\n",
"[ 89%] Building CXX object mpp/src/CMakeFiles/SRC.dir/basicalgebra/CMatrix.cpp.o\n",
"[ 89%] Building CXX object mpp/src/CMakeFiles/SRC.dir/timeseries/ITimeSeries.cpp.o\n",
"[ 90%] Building CXX object mpp/src/CMakeFiles/SRC.dir/timeseries/TimeSeriesOfFile.cpp.o\n",
"[ 91%] Building CXX object mpp/src/CMakeFiles/SRC.dir/timestepping/ImplicitEuler.cpp.o\n",
"[ 92%] Building CXX object mpp/src/CMakeFiles/SRC.dir/timestepping/TimeIntegrator.cpp.o\n",
"[ 93%] Linking CXX static library libSRC.a\n",
"[ 93%] Built target SRC\n",
"Scanning dependencies of target BenchmarkTransportResults\n",
"[ 94%] Building CXX object tests/CMakeFiles/BenchmarkTransportResults.dir/BenchmarkTransportResults.cpp.o\n",
"Scanning dependencies of target BenchmarkEllipticResults\n",
"Scanning dependencies of target TestMainProgram\n",
"Scanning dependencies of target MLMC-M++\n",
"[ 94%] Building CXX object tests/CMakeFiles/BenchmarkEllipticResults.dir/BenchmarkEllipticResults.cpp.o\n",
"[ 94%] Building CXX object tests/CMakeFiles/TestMainProgram.dir/TestMainProgram.cpp.o\n",
"[ 95%] Building CXX object CMakeFiles/MLMC-M++.dir/mlmc/src/Main.cpp.o\n",
"[ 96%] Linking CXX executable BenchmarkTransportResults\n",
"[ 96%] Built target BenchmarkTransportResults\n",
"Scanning dependencies of target TestMultilevelPlotter\n",
"[ 97%] Building CXX object tests/CMakeFiles/TestMultilevelPlotter.dir/TestMultilevelPlotter.cpp.o\n",
"[ 97%] Linking CXX executable MLMC-M++\n",
"[ 98%] Linking CXX executable TestMultilevelPlotter\n",
"[ 98%] Built target TestMultilevelPlotter\n",
"[ 99%] Linking CXX executable TestMainProgram\n",
"[100%] Linking CXX executable BenchmarkEllipticResults\n",
"[100%] Built target MLMC-M++\n",
"[100%] Built target TestMainProgram\n",
"[100%] Built target BenchmarkEllipticResults\n"
]
}
],
......@@ -141,20 +244,8 @@
"\n",
"import pandas as pd\n",
"\n",
"# Todo\n",
"import sys\n",
"sys.path.append('../tools')\n",
"from plot_statistics import *\n",
"sys.path.append('../notebooks')\n",
"from tp_utilities import *\n",
"from vtk_utilities import *\n",
"import matplotlib.pyplot as plt\n",
"from starter import *\n",
"from mlmc_solution import *\n",
"sys.path.append('..')\n",
"from python.mlmc_mppy import mpp\n",
"\n",
"mpp.mute = False\n",
"mpp.clean_cmake_cache()\n",
"mpp.build()\n",
"mpp.executable = \"MLMC-M++\"\n",
"mpp.kernels = 4"
......@@ -171,7 +262,19 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"(...)"
"As introductury example we want to take a look at the specific configuration for the stochastic permeability $\\sigma=$, $\\lambda=$ and $s=1.8$. We initialize with $l_{\\text{init}} = [3, 4, 5]$ and $M_l^{\\text{init}} = [12, 6, 3]$. The transport equation is solved with discontinous Galerkin methods and the implicit mid point rule\n",
"\n",
"\n",
"$\\rho_{in} = 0$ \n",
"\n",
"$T = 1$ \n",
"\n",
"$\\rho_0 = $\n",
"\n",
"Mass at $T = 1$ as goal functional\n",
"\n",
"\n",
"Paper: $l_{\\text{init}} = [4, 5, 6, 7]$ $M_l^{\\text{init}} = [16, 8, 4, 2]$."
]
},
{
......@@ -331,6 +434,23 @@
"### Convergence tests"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"sys.path.append('../tools')\n",
"from plot_statistics import *\n",
"sys.path.append('../notebooks')\n",
"from tp_utilities import *\n",
"from vtk_utilities import *\n",
"import matplotlib.pyplot as plt\n",
"from starter import *\n",
"from mlmc_solution import *\n",
"sys.path.append('..')"
]
},
{
"cell_type": "code",
"execution_count": 4,
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment