Skip to content

Commit 66a7a79

Browse files
committed
improved doc
1 parent 8f27eab commit 66a7a79

13 files changed

+180
-71
lines changed

docs/src/estimators.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
# A posteriori error estimation
1+
# Adaptivity and error control
22

3-
## Residual-based error estimation
3+
## Residual-based a posteriori error estimation
44
Spatial error estimation refers to classical residual-based error estimation
55
for the zero-th multi index that refers to the mean value.
66
Stochastic error control has to estimate which stochastic mode needs to be refined
77
in the sense that either the polynomial degree is increased or neighbouring
88
stochastic modes are activated. Both is represented by the multi-indices.
99
Then unified error control allows to perform residual-based error estimation for
10-
the subresiduals that are associated to each multi-index
11-
(see references on the main page for details).
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).
1212

1313

1414
```@autodocs

docs/src/estimators.pdf

-43 Bytes
Binary file not shown.

docs/src/onbasis.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
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+
8+
39
```@autodocs
410
Modules = [ExtendableASGFEM]
511
Pages = ["onbasis.jl"]

docs/src/onbasis.pdf

4.3 KB
Binary file not shown.

docs/src/orthogonal_polynomials.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ satisfy the three-term recurrence relation
2525
initialized by $H_0 = 0$ and $H_1 = 1$.
2626

2727

28+
```@autodocs
29+
Modules = [ExtendableASGFEM]
30+
Pages = ["orthogonal_polynomials/orthogonal_polynomials.jl"]
31+
Order = [:type, :function]
32+
```
33+
2834
## Legendre Polynomials (uniform distribution)
2935

3036
For the weight function $\omega(y) = 1/2$ in the interval $[-1,1]$ (uniform distribution),
@@ -34,6 +40,13 @@ of the resulting Legendre polynomials are given by
3440
\| H_n \|^2_\omega = \frac{2}{2n+1}
3541
```
3642

43+
```@autodocs
44+
Modules = [ExtendableASGFEM]
45+
Pages = ["orthogonal_polynomials/Legendre_uniform.jl"]
46+
Order = [:type, :function]
47+
```
48+
49+
3750
## Hermite Polynomials (normal distribution)
3851

3952
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
@@ -51,3 +64,9 @@ and their norms are given by
5164
```math
5265
\| H_n \|^2_\omega = n!
5366
```
67+
68+
```@autodocs
69+
Modules = [ExtendableASGFEM]
70+
Pages = ["orthogonal_polynomials/Hermite_normal.jl"]
71+
Order = [:type, :function]
72+
```

docs/src/orthogonal_polynomials.pdf

3.56 KB
Binary file not shown.

docs/src/tonbasis.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
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 = \pro_{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+
12+
13+
14+
315
```@autodocs
416
Modules = [ExtendableASGFEM]
517
Pages = ["tensorizedbasis.jl"]

docs/src/tonbasis.pdf

4.46 KB
Binary file not shown.

src/onbasis.jl

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,53 @@ struct ONBasis{T <: Real, OBT <: OrthogonalPolynomialType, npoly, nquad}
1212
vals4xref::SMatrix{nquad, npoly, T} # evaluations of all ONB functions at quadrature points
1313
end
1414

15+
"""
16+
$(TYPEDSIGNATURES)
17+
18+
returns the values of all polynomials at the k-th quadrature point
19+
"""
1520
vals4qp(ONB::ONBasis, k) = view(ONB.vals4xref, k, :)
21+
"""
22+
$(TYPEDSIGNATURES)
23+
24+
returns the values of the p-th polynomial at all quadrature points
25+
"""
1626
vals4poly(ONB::ONBasis, p) = view(ONB.vals4xref, :, p + 1)
27+
"""
28+
$(TYPEDSIGNATURES)
29+
30+
returns the quadrature weights
31+
"""
1732
qw(ONB::ONBasis) = ONB.gauss_rule[2]
33+
"""
34+
$(TYPEDSIGNATURES)
35+
36+
returns the quadrature points
37+
"""
1838
qp(ONB::ONBasis) = ONB.gauss_rule[1]
39+
"""
40+
$(TYPEDSIGNATURES)
41+
42+
returns the values of all polynomials at the quadrature points
43+
"""
1944
vals4xref(ONB::ONBasis) = ONB.vals4xref
45+
"""
46+
$(TYPEDSIGNATURES)
47+
48+
returns the norm of the p-th polynomial
49+
"""
2050
norm4poly(ONB::ONBasis, p) = getindex(ONB.norms, p + 1)
51+
"""
52+
$(TYPEDSIGNATURES)
53+
54+
returns the distribution associated to the orthogonal polynomials
55+
"""
2156
distribution(ONB::ONBasis{T, OBT}) where {T, OBT} = distribution(OBT)
57+
"""
58+
$(TYPEDSIGNATURES)
59+
60+
returns the OrthogonalPolynomialType
61+
"""
2262
OrthogonalPolynomialType(ONB::ONBasis{T, OBT}) where {T, OBT} = OBT
2363

2464

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,30 @@
1+
"""
2+
$(TYPEDEF)
3+
4+
Type for dispatching Hermite Polynomials
5+
"""
16
abstract type HermitePolynomials <: OrthogonalPolynomialType end
27

8+
"""
9+
$(TYPEDSIGNATURES)
310
11+
Returns the recurrence coefficients for the k-th Legendre polynomial
12+
"""
413
recurrence_coefficients(::Type{HermitePolynomials}, k::Integer) =
514
0, 1, k
615

716
issymmetric(::Type{HermitePolynomials}) = true
817

9-
norms(::Type{HermitePolynomials}, k) = sqrt.(factorial.(big(k)))
10-
11-
distribution(::Type{HermitePolynomials}) = Normal(0, 1)
12-
18+
"""
19+
$(TYPEDSIGNATURES)
1320
14-
# abstract type HermitePolynomialsNormalized <: OrthogonalPolynomialType end
15-
16-
# recurrence_coefficients(::Type{HermitePolynomialsNormalized}, k::Integer) =
17-
# 0, 1/sqrt(k+2), sqrt((k+1)/(k+2))
18-
19-
# issymmetric(::Type{HermitePolynomialsNormalized}) = true
21+
Returns the norm of the k-th Hermite polynomial
22+
"""
23+
norms(::Type{HermitePolynomials}, k) = sqrt.(factorial.(big(k)))
2024

21-
# norms(::Type{HermitePolynomialsNormalized}, k) = 1
25+
"""
26+
$(TYPEDSIGNATURES)
2227
23-
# distribution(::Type{HermitePolynomialsNormalized}) = Normal(0,1)
28+
Returns the distribution associated to the Hermite polynomial
29+
"""
30+
distribution(::Type{HermitePolynomials}) = Normal(0, 1)

0 commit comments

Comments
 (0)