Skip to content

Commit f6d735e

Browse files
Small doc fixes (#499)
* A small shift in notation * Docs: Clarify ex2-surface mathematical description * Refactor \boldsymbol -> \bm * Refactor \mathbf -> \bm * Sphinx: clear html_static_path This is needed to avoid the 'html_static_path entry '_static' does not exist' warning readthedocs/readthedocs.org#1776 * Fix some incosistencies * Invert inner products (u,v) -> (v,u) * Add SVG figure for coordinates on the sphere * doc: use dirhtml on readthedocs * Improve caption of sphere coords figure * Add reference to figure in the bps on the cubed-sphere section Co-authored-by: Jed Brown <[email protected]>
1 parent 054e94b commit f6d735e

File tree

12 files changed

+742
-224
lines changed

12 files changed

+742
-224
lines changed

.readthedocs.yml

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ version: 2
66

77
# Build documentation in the docs/ directory with Sphinx
88
sphinx:
9+
builder: dirhtml
910
configuration: doc/sphinx/source/conf.py
1011

1112
# Optionally build your docs in additional formats such as PDF and ePub

doc/img/SphereSketch.svg

+504
Loading

doc/sphinx/source/FEMtheory.rst.inc

+17-17
Original file line numberDiff line numberDiff line change
@@ -15,42 +15,42 @@ of computational device types (selectable at run time). We present here the nota
1515
and the mathematical formulation adopted in libCEED.
1616

1717
We start by considering the discrete residual :math:`F(u)=0` formulation
18-
in weak form. We first define the :math:`L^2` inner product
18+
in weak form. We first define the :math:`L^2` inner product between real-valued functions
1919

2020
.. math::
21-
\langle u, v \rangle = \int_\Omega u v d \mathbf{x},
21+
\langle v, u \rangle = \int_\Omega v u d \bm{x},
2222

23-
where :math:`d \mathbf{x} \in \mathbb{R}^d \supset \Omega`.
23+
where :math:`\bm{x} \in \mathbb{R}^d \supset \Omega`.
2424

2525
We want to find :math:`u` in a suitable space :math:`V_D`,
2626
such that
2727

2828
.. math::
29-
\langle v, f(u) \rangle = \int_\Omega v \cdot f_0 (u, \nabla u) + \nabla v : f_1 (u, \nabla u) = 0
29+
\langle \bm v, \bm f(u) \rangle = \int_\Omega \bm v \cdot \bm f_0 (u, \nabla u) + \nabla \bm v : \bm f_1 (u, \nabla u) = 0
3030
:label: residual
3131

32-
for all :math:`v` in the corresponding homogeneous space :math:`V_0`, where :math:`f_0`
33-
and :math:`f_1` contain all possible sources in the problem. We notice here that
34-
:math:`f_0` represents all terms in :math:numref:`residual` which multiply the test
35-
function :math:`v` and :math:`f_1` all terms which multiply its gradient :math:`\nabla v`.
36-
For an n-component problems in :math:`d` dimensions, :math:`f_0 \in \mathbb{R}^n` and
37-
:math:`f_1 \in \mathbb{R}^{nd}`.
32+
for all :math:`\bm v` in the corresponding homogeneous space :math:`V_0`, where :math:`\bm f_0`
33+
and :math:`\bm f_1` contain all possible sources in the problem. We notice here that
34+
:math:`\bm f_0` represents all terms in :math:numref:`residual` which multiply the (possibly vector-valued) test
35+
function :math:`\bm v` and :math:`\bm f_1` all terms which multiply its gradient :math:`\nabla \bm v`.
36+
For an n-component problems in :math:`d` dimensions, :math:`\bm f_0 \in \mathbb{R}^n` and
37+
:math:`\bm f_1 \in \mathbb{R}^{nd}`.
3838

3939
.. note::
40-
The notation :math:`\nabla \boldsymbol v \!:\! f_1` represents contraction over both
40+
The notation :math:`\nabla \bm v \!:\! \bm f_1` represents contraction over both
4141
fields and spatial dimensions while a single dot represents contraction in just one,
42-
which should be clear from context, e.g., :math:`v \cdot f_0` contracts only over
42+
which should be clear from context, e.g., :math:`\bm v \cdot \bm f_0` contracts only over
4343
fields.
4444

4545
.. note::
4646
In the code, the function that represents the weak form at quadrature
4747
points is called the :ref:`CeedQFunction`. In the :ref:`Examples` provided with the
48-
library (in the :file:`examples/` directory), we store the term :math:`f_0` directly
49-
into `v`, and the term :math:`f_1` directly into `dv` (which stands for
50-
:math:`\nabla v`). If equation :math:numref:`residual` only presents a term of the
51-
type :math:`f_0`, the :ref:`CeedQFunction` will only have one output argument,
48+
library (in the :file:`examples/` directory), we store the term :math:`\bm f_0` directly
49+
into `v`, and the term :math:`\bm f_1` directly into `dv` (which stands for
50+
:math:`\nabla \bm v`). If equation :math:numref:`residual` only presents a term of the
51+
type :math:`\bm f_0`, the :ref:`CeedQFunction` will only have one output argument,
5252
namely `v`. If equation :math:numref:`residual` also presents a term of the type
53-
:math:`f_1`, then the :ref:`CeedQFunction` will have two output arguments, namely,
53+
:math:`\bm f_1`, then the :ref:`CeedQFunction` will have two output arguments, namely,
5454
`v` and `dv`.
5555

5656

doc/sphinx/source/conf.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@
130130
# Add any paths that contain custom static files (such as style sheets) here,
131131
# relative to this directory. They are copied after the builtin static files,
132132
# so a file named "default.css" will overwrite the builtin "default.css".
133-
html_static_path = ['_static']
133+
html_static_path = []
134134

135135
# Custom sidebar templates, must be a dictionary that maps document names
136136
# to template names.

doc/sphinx/source/libCEEDapi.rst

+56-64
Large diffs are not rendered by default.

examples/bps.rst

+6-6
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ find :math:`u \in V^p` such that for all :math:`v \in V^p`
2020
.. math::
2121
:label: eq-general-weak-form
2222
23-
\langle u,v \rangle = \langle f,v \rangle ,
23+
\langle v,u \rangle = \langle v,f \rangle ,
2424
25-
where :math:`\langle u,v\rangle` and :math:`\langle f,v\rangle` express the continuous
25+
where :math:`\langle v,u\rangle` and :math:`\langle v,f\rangle` express the continuous
2626
bilinear and linear forms, respectively, defined on :math:`V^p`, and, for sufficiently
2727
regular :math:`u`, :math:`v`, and :math:`f`, we have:
2828

@@ -50,13 +50,13 @@ into :math:numref:`eq-general-weak-form`, we obtain the inner-products
5050
.. math::
5151
:label: eq-inner-prods
5252
53-
\langle v,u \rangle = \bm v^T M \bm u , \qquad \langle f,v\rangle = \bm v^T \bm b \,.
53+
\langle v,u \rangle = \bm v^T M \bm u , \qquad \langle v,f\rangle = \bm v^T \bm b \,.
5454
5555
Here, we have introduced the mass matrix, :math:`M`, and the right-hand side,
5656
:math:`\bm b`,
5757

5858
.. math::
59-
M_{ij} := (\phi_i,\phi_j), \;\; \qquad b_{i} := \langle f, \phi_i \rangle,
59+
M_{ij} := (\phi_i,\phi_j), \;\; \qquad b_{i} := \langle \phi_i, f \rangle,
6060
6161
each defined for index sets :math:`i,j \; \in \; \{1,\dots,n\}`.
6262

@@ -70,9 +70,9 @@ The Laplace's operator used in BP3-BP6 is defined via the following variational
7070
formulation, i.e., find :math:`u \in V^p` such that for all :math:`v \in V^p`
7171

7272
.. math::
73-
a(u,v) = \langle f,v \rangle , \,
73+
a(v,u) = \langle v,f \rangle , \,
7474
75-
where now :math:`a (u,v)` expresses the continuous bilinear form defined on
75+
where now :math:`a (v,u)` expresses the continuous bilinear form defined on
7676
:math:`V^p` for sufficiently regular :math:`u`, :math:`v`, and :math:`f`, that is:
7777

7878
.. math::

examples/ceed/index.rst

+18-14
Original file line numberDiff line numberDiff line change
@@ -13,25 +13,27 @@ Ex1-Volume
1313

1414
This example is located in the subdirectory :file:`examples/ceed`. It illustrates a
1515
simple usage of libCEED to compute the volume of a given body using a matrix-free
16-
application of the mass operator. Arbitrary mesh and solution orders in 1D, 2D and 3D
16+
application of the mass operator. Arbitrary mesh and solution orders in 1D, 2D, and 3D
1717
are supported from the same code.
1818

1919
This example shows how to compute line/surface/volume integrals of a 1D, 2D, or 3D
2020
domain :math:`\Omega` respectively, by applying the mass operator to a vector of
21-
:math:`\mathbf{1}`\s. It computes:
21+
:math:`1`\s. It computes:
2222

2323
.. math::
24-
I = \int_{\Omega} \mathbf{1} \, dV .
24+
I = \int_{\Omega} 1 \, dV .
2525
:label: eq-ex1-volume
2626
2727
Using the same notation as in :ref:`Theoretical Framework`, we write here the vector
28-
:math:`u(\mathbf{x})\equiv \mathbf{1}` in the Galerkin approximation,
28+
:math:`u(x)\equiv 1` in the Galerkin approximation,
2929
and find the volume of :math:`\Omega` as
3030

3131
.. math::
32-
\sum_e \int_{\Omega_e} v(x) \cdot \mathbf{1} \, dV
32+
:label: volume-sum
3333
34-
with :math:`v(x) \in \mathcal{V}_p = \{ v \in H^{1}(\Omega_e) \,|\, v \in P_p(\boldsymbol{I}), e=1,\ldots,N_e \}`,
34+
\sum_e \int_{\Omega_e} v(x) 1 \, dV
35+
36+
with :math:`v(x) \in \mathcal{V}_p = \{ v \in H^{1}(\Omega_e) \,|\, v \in P_p(\bm{I}), e=1,\ldots,N_e \}`,
3537
the test functions.
3638

3739

@@ -42,25 +44,27 @@ Ex2-Surface
4244

4345
This example is located in the subdirectory :file:`examples/ceed`. It computes the
4446
surface area of a given body using matrix-free application of a diffusion operator.
45-
Arbitrary mesh and solution orders in 1D, 2D and 3D are supported from the same code.
46-
47-
Similarly to :ref:`Ex1-Volume`, it computes:
47+
Similar to :ref:`Ex1-Volume`, arbitrary mesh and solution orders in 1D, 2D, and 3D
48+
are supported from the same code. It computes:
4849

4950
.. math::
50-
I = \int_{\partial \Omega} \mathbf{1} \, dS .
51+
I = \int_{\partial \Omega} 1 \, dS ,
5152
:label: eq-ex2-surface
5253
53-
but this time by applying the divergence theorem using a Laplacian.
54+
by applying the divergence theorem.
5455
In particular, we select :math:`u(\bm x) = x_0 + x_1 + x_2`, for which :math:`\nabla u = [1, 1, 1]^T`, and thus :math:`\nabla u \cdot \hat{\bm n} = 1`.
5556

5657
Given Laplace's equation,
5758

5859
.. math::
59-
-\nabla \cdot \nabla u = 0, \textrm{ for } \mathbf{x} \in \Omega
60+
\nabla \cdot \nabla u = 0, \textrm{ for } \bm{x} \in \Omega
6061
61-
multiply by a test function :math:`v` and integrate by parts to obtain
62+
let us multiply by a test function :math:`v` and integrate by parts to obtain
6263

6364
.. math::
6465
\int_\Omega \nabla v \cdot \nabla u \, dV - \int_{\partial \Omega} v \nabla u \cdot \hat{\bm n}\, dS = 0 .
6566
66-
Since we have chosen :math:`u` such that the boundary integrand is :math:`v 1`, we may evaluate the surface integral by applying the volumetric Laplacian and summing the result.
67+
Since we have chosen :math:`u` such that :math:`\nabla u \cdot \hat{\bm n} = 1`, the boundary integrand is :math:`v 1 \equiv v`. Hence, similar to :math:numref:`volume-sum`, we can evaluate the surface integral by applying the volumetric Laplacian as follows
68+
69+
.. math::
70+
\int_\Omega \nabla v \cdot \nabla u \, dV \approx \sum_e \int_{\partial \Omega_e} v(x) 1 \, dS .

0 commit comments

Comments
 (0)