Skip to content

Commit bcfd568

Browse files
authored
improved documentation and show functions
supported by gitlab copilot
2 parents 9021213 + 69700c8 commit bcfd568

23 files changed

Lines changed: 381 additions & 187 deletions

docs/src/coefficients.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,19 @@
11
# Stochastic Coefficients
22

3-
Coefficients are assumed to be represented by a Karhunen-Loeve expansion (KLE)
4-
that have the following general structure and API.
3+
Stochastic coefficients play a central role in uncertainty quantification and stochastic finite element methods. In this package, coefficients are represented using a Karhunen-Loève expansion (KLE), which allows for the efficient representation of random fields with prescribed covariance structure.
4+
5+
## Overview
6+
7+
The Karhunen-Loève expansion expresses a stochastic process as a series of orthogonal functions weighted by uncorrelated random variables:
8+
9+
$$
10+
a(x, \omega) = a_0(x) + \sum_{n=1}^N \sqrt{\lambda_n} \phi_n(x) \xi_n(\omega)
11+
$$
12+
13+
where $a_0(x)$ is the mean, $\lambda_n$ and $\phi_n(x)$ are the eigenvalues and eigenfunctions of the covariance operator, and $\xi_n$ are independent standard normal random variables.
514

615
## API
16+
717
```@autodocs
818
Modules = [ExtendableASGFEM]
919
Pages = ["coefficients/coefficients.jl"]

docs/src/estimators.md

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
11
# Adaptivity and error control
22

33
## Residual-based a posteriori error estimation
4-
Spatial error estimation refers to classical residual-based error estimation
5-
for the zero-th multi index that refers to the mean value.
6-
Stochastic error control has to estimate which stochastic mode needs to be refined
7-
in the sense that either the polynomial degree is increased or neighbouring
8-
stochastic modes are activated. Both is represented by the multi-indices.
9-
Then unified error control allows to perform residual-based error estimation for
10-
the subresiduals that are associated to each multi-index and depend on the model
11-
problem (see references on the main page for details).
4+
Spatial error estimation refers to classical residual-based error estimation for the zero-th multi-index, which corresponds to the mean value.
5+
Stochastic error control determines which stochastic mode should be refined, either by increasing the polynomial degree or by activating neighboring stochastic modes. Both are represented by multi-indices.
6+
Unified error control enables residual-based error estimation for the subresiduals associated with each multi-index, depending on the model problem (see references on the main page for details).
127

138

149
```@autodocs
@@ -17,12 +12,10 @@ Pages = ["estimate.jl"]
1712
Order = [:type, :function]
1813
```
1914

20-
## Multi index management
15+
## Multi-index management
2116

22-
Depending on the model problem and stochastic coefficient the
23-
amount of multi indices that should be added to the error estimation
24-
varies.
25-
Here are some methods that help with enriching the set of multi-indices.
17+
Depending on the model problem and stochastic coefficient, the number of multi-indices to be added for error estimation varies.
18+
The following methods assist in enriching the set of multi-indices.
2619

2720

2821
```@autodocs
@@ -31,12 +24,10 @@ Pages = ["mopcontrol.jl"]
3124
Order = [:type, :function]
3225
```
3326

34-
## Monte carlo sampling estimator
27+
## Monte Carlo sampling estimator
28+
29+
A hierarchical Monte Carlo error estimator is also available. It compares the solution with a higher-order discrete solution for sampled deterministic problems. This is mainly intended to compute a reference error to assess the efficiency of the residual-based error estimator.
3530

36-
There is also a hierarchical Monte carlo error estimator available that
37-
compares the solution with a higher order discrete solution for sampled
38-
deterministic problems. This is merely intended as a way to compute the
39-
reference error to assess the efficiency of the residual-based error estimator.
4031

4132
```@autodocs
4233
Modules = [ExtendableASGFEM]

docs/src/index.md

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,22 @@
11
# ExtendableASGFEM
22

3-
This package implements the stochastic Galerkin finite element method for certain two dimensional
4-
model problems involving KLE of stochastic coefficients. The rather huge systems have a tensorized
5-
structure and are solved by iterative solvers. A posteriori error estimators steer the spatial
6-
and stochastic refinement.
7-
8-
The spatial discretization is based on the finite element package [ExtendableFEM.jl](https://github.com/WIAS-PDELib/ExtendableFEM.jl)/[ExtendableFEMBase.jl](https://github.com/WIAS-PDELib/ExtendableFEMBase.jl)
3+
This package provides an implementation of the stochastic Galerkin finite element method (SGFEM) for selected two-dimensional model problems involving Karhunen-Loève expansions (KLE) of stochastic coefficients. The resulting large-scale systems exhibit a tensorized structure and are efficiently solved using iterative solvers. Adaptive a posteriori error estimators guide both spatial and stochastic refinement to ensure accuracy and efficiency.
94

5+
Spatial discretization is performed using the finite element packages [ExtendableFEM.jl](https://github.com/WIAS-PDELib/ExtendableFEM.jl) and [ExtendableFEMBase.jl](https://github.com/WIAS-PDELib/ExtendableFEMBase.jl).
106

117
## References
128

13-
- [1] "Adaptive stochastic Galerkin FEM"\
14-
M. Eigel, C.J. Gittelson, C. Schwab, E. Zander\
15-
CMAME 270, 1 (2014), 247--269\
16-
[>Journal-Link<](https://www.doi.org/10.1016/J.CMA.2013.11.015)
17-
[>Preprint-Link<](https://www.research-collection.ethz.ch/handle/20.500.11850/154941)
18-
- [2] "A posteriori error control for stochastic Galerkin FEM with high-dimensional random parametric PDEs",\
19-
M. Eigel, C. Merdon\
20-
to be published in: Error Control, Adaptive Discretizations, and Applications, Part 3, Academic Press\
21-
[>Preprint-Link<](https://www.wias-berlin.de/publications/wias-publ/run.jsp?template=abstract&type=Preprint&year=&number=3174)
22-
- [3] "Local equilibration error estimators for guaranteed error control in adaptive higher-order stochastic Galerkin finite element methods"\
23-
M. Eigel and C. Merdon\
24-
SIAM/ASA J. Uncertainty Quantification 4(1) (2016), 1372--1397"\
25-
[>Journal-Link<](https://epubs.siam.org/doi/10.1137/15M102188X)
26-
[>Preprint-Link<](http://www.wias-berlin.de/publications/wias-publ/run.jsp?template=abstract&type=Preprint&year=2014&number=1997)
9+
- [1] "Adaptive stochastic Galerkin FEM"
10+
M. Eigel, C.J. Gittelson, C. Schwab, E. Zander
11+
CMAME 270, 1 (2014), 247269
12+
[Journal-Link](https://www.doi.org/10.1016/J.CMA.2013.11.015)
13+
[Preprint-Link](https://www.research-collection.ethz.ch/handle/20.500.11850/154941)
14+
- [2] "A posteriori error control for stochastic Galerkin FEM with high-dimensional random parametric PDEs"
15+
M. Eigel, C. Merdon
16+
To appear in: Error Control, Adaptive Discretizations, and Applications, Part 3, Academic Press
17+
[Preprint-Link](https://www.wias-berlin.de/publications/wias-publ/run.jsp?template=abstract&type=Preprint&year=&number=3174)
18+
- [3] "Local equilibration error estimators for guaranteed error control in adaptive higher-order stochastic Galerkin finite element methods"
19+
M. Eigel and C. Merdon
20+
SIAM/ASA J. Uncertainty Quantification 4(1) (2016), 13721397
21+
[Journal-Link](https://epubs.siam.org/doi/10.1137/15M102188X)
22+
[Preprint-Link](http://www.wias-berlin.de/publications/wias-publ/run.jsp?template=abstract&type=Preprint&year=2014&number=1997)

docs/src/index.pdf

361 Bytes
Binary file not shown.

docs/src/onbasis.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
# ONBasis
22

3-
An ONBasis (=orthonormal basis) stores information for the orthogonal polynomials
4-
of the disctribution, like norms, quadrature rules and cached evaluations at quadrature points.
5-
It is the main building brick for the tensorized basis associated to the multi-indices
6-
of the stochastic discretization.
7-
3+
An ONBasis (orthonormal basis) encapsulates information about the orthogonal polynomials associated with a given probability distribution. This includes norms, quadrature rules, and cached evaluations at quadrature points. The ONBasis serves as a fundamental building block for constructing the tensorized basis linked to the multi-indices in the stochastic discretization.
84

95
```@autodocs
106
Modules = [ExtendableASGFEM]

docs/src/onbasis.pdf

267 Bytes
Binary file not shown.

docs/src/orthogonal_polynomials.md

Lines changed: 17 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,34 @@
11
# Orthogonal Polynomials
22

3-
The stochastic discretization of random variables involves global
4-
polynomials that are orthogonal with respect to the involved
5-
random distribution of the `y_m`. These polynomials
6-
can be generated by some recurrence relation with coefficients
7-
that depend on the distribution.
3+
In the stochastic discretization of random variables, global polynomials that are orthogonal with respect to the probability distribution of each random variable $y_m$ are used. These orthogonal polynomials can be generated via recurrence relations, with coefficients determined by the underlying distribution.
4+
5+
## Recurrence Relations
6+
Orthogonal polynomials $H_n$ with respect to a weight function $\omega$ satisfy
87

9-
## Recurrence relations
10-
Orthogonal polynomials
11-
$H_n$ with respect to some weight function $\omega$, i.e.,
128
```math
13-
\int_\Gamma \omega(y) H_{n}(y) H_m(y) dy = N^2_{nm}\delta_{nm}
9+
\int_\Gamma \omega(y) H_{n}(y) H_m(y) \,dy = N^2_{nm}\delta_{nm}
1410
```
15-
where
11+
where
1612
```math
17-
N_{nn} := \| H_n \|_{\omega}^2 := \int_\Gamma \omega(y) H_{n}(y) H_n(y) dy
13+
N_{nn} := \| H_n \|_{\omega}^2 := \int_\Gamma \omega(y) H_{n}(y) H_n(y) \,dy
1814
```
19-
satisfy the three-term recurrence relation
15+
The polynomials satisfy the three-term recurrence relation:
2016
```math
2117
\begin{aligned}
22-
H_{n+2}(y) & = (a_n y-b_n) H_{n+1}(y) - c_n H_{n}(y)
23-
\end{aligned}
18+
H_{n+2}(y) & = (a_n y - b_n) H_{n+1}(y) - c_n H_{n}(y)
19+
\end{aligned}
2420
```
25-
initialized by $H_0 = 0$ and $H_1 = 1$.
26-
21+
with initial values $H_0 = 0$ and $H_1 = 1$.
2722

2823
```@autodocs
2924
Modules = [ExtendableASGFEM]
3025
Pages = ["orthogonal_polynomials/orthogonal_polynomials.jl"]
3126
Order = [:type, :function]
3227
```
3328

34-
## Legendre Polynomials (uniform distribution)
29+
## Legendre Polynomials (Uniform Distribution)
3530

36-
For the weight function $\omega(y) = 1/2$ in the interval $[-1,1]$ (uniform distribution),
37-
take $a_n = (2n+1)/(n+1)$, $b_n = 0$ and $c_n = n/(n+1)$. The norms
38-
of the resulting Legendre polynomials are given by
31+
For the weight function $\omega(y) = 1/2$ on the interval $[-1,1]$ (uniform distribution), the recurrence coefficients are $a_n = (2n+1)/(n+1)$, $b_n = 0$, and $c_n = n/(n+1)$. The norms of the resulting Legendre polynomials are
3932
```math
4033
\| H_n \|^2_\omega = \frac{2}{2n+1}
4134
```
@@ -46,21 +39,20 @@ Pages = ["orthogonal_polynomials/Legendre_uniform.jl"]
4639
Order = [:type, :function]
4740
```
4841

42+
## Hermite Polynomials (Normal Distribution)
4943

50-
## Hermite Polynomials (normal distribution)
51-
52-
For the weight function $\omega(y) = \exp(-y^2/2)/(2\pi)$ (normal distribution), take $a_n = 1$, $b_n = 0$ and $c_n = n$. Then, the first six polynomials read
44+
For the weight function $\omega(y) = \exp(-y^2/2)/(2\pi)$ (normal distribution), the recurrence coefficients are $a_n = 1$, $b_n = 0$, and $c_n = n$. The first six Hermite polynomials are:
5345
```math
5446
\begin{aligned}
5547
H_0 & = 0\\
5648
H_1 & = 1\\
5749
H_2 & = y\\
5850
H_3 & = y^2 - 1\\
5951
H_4 & = y^3 - 3y\\
60-
H_5 & = y^4 - 6y^2 +3\\
52+
H_5 & = y^4 - 6y^2 + 3\\
6153
\end{aligned}
6254
```
63-
and their norms are given by
55+
Their norms are given by
6456
```math
6557
\| H_n \|^2_\omega = n!
6658
```
588 Bytes
Binary file not shown.

docs/src/solvers.md

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,21 @@
11
# Solver
22

3-
Solving requires a spatial and stochastic discretization.
4-
Both are connected in a special vector structure
5-
that is passed to a solve function that runs a special
6-
iterative solver for each model problem.
3+
Solving a problem requires both spatial and stochastic discretization. These are combined into a specialized vector structure, which is then passed to a solver function that executes an iterative algorithm tailored to each model problem.
74

85
## SGFEVector
96

10-
The spatial discretization is represented by
11-
s single finite element space from [ExtendableFEM.jl](https://github.com/WIAS-PDELib/ExtendableFEM.jl),
12-
while the stochastic discretization is represented by a tensorized basis
13-
for the parameter space of the stochastic coefficient. Both have to be prepared in
14-
advance.
7+
The spatial discretization is defined by a single finite element space from [ExtendableFEM.jl](https://github.com/WIAS-PDELib/ExtendableFEM.jl), while the stochastic discretization uses a tensorized basis for the parameter space of the stochastic coefficient. Both components must be set up in advance.
158

169
!!! note
17-
18-
Currently it is not possible to use different finite element spaces for different multi-indices,
19-
but this feature might be added in the future.
10+
Currently, it is not possible to use different finite element spaces for different multi-indices. This feature may be added in the future.
2011

2112
```@autodocs
2213
Modules = [ExtendableASGFEM]
2314
Pages = ["sgfevector.jl"]
2415
Order = [:type, :function]
2516
```
2617

27-
## Solve function
18+
## Solve Function
2819

2920
```@autodocs
3021
Modules = [ExtendableASGFEM]

docs/src/tonbasis.md

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,8 @@
11
# TensorizedBasis
22

3-
Each multi-index ``\mu = [\mu_1,\mu_2,\ldots,\mu_M]``
4-
encodes a tensorized basis function for the parameter space
5-
of the form ``H_\mu = \prod_{k=1}^M H_k`` where the
6-
``H_k`` are the orthogonal polynomials.
7-
The TensorizedBasis collects all information necessary
8-
to evaluate those basis functions, i.e. the set of multi-indices
9-
and the triple products of the form ``(y_mH_\mu, H_\lambda)``
10-
for each ``m`` and ``\mu, \lambda`` in the set of multi-indices
11-
as a sparse matrix. There are analytic formulas to evaluate
12-
these triple products in terms of recurrence coefficients, but it makes
13-
sense to store them for faster evaluation times.
14-
15-
3+
Each multi-index $\mu = [\mu_1, \mu_2, \ldots, \mu_M]$ defines a tensorized basis function for the parameter space of the form $H_\mu = \prod_{k=1}^M H_k$, where each $H_k$ is an orthogonal polynomial.
164

5+
The `TensorizedBasis` object collects all information required to evaluate these basis functions, including the set of multi-indices and the triple products of the form $(y_m H_\mu, H_\lambda)$ for each $m$ and $\mu, \lambda$ in the set of multi-indices, stored as a sparse matrix. While analytic formulas exist to compute these triple products using recurrence coefficients, storing them can significantly speed up evaluations.
176

187
```@autodocs
198
Modules = [ExtendableASGFEM]

0 commit comments

Comments
 (0)