Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use balanced braces for doxygen formulas. #15640

Merged
merged 1 commit into from
Jul 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/step-11/doc/intro.dox
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

The problem we will be considering is the solution of Laplace's problem with
Neumann boundary conditions only:
@f{eqnarray*}
@f{eqnarray*}{
-\Delta u &=& f \qquad \mathrm{in}\ \Omega,
\\
\partial_n u &=& g \qquad \mathrm{on}\ \partial\Omega.
Expand Down
8 changes: 4 additions & 4 deletions examples/step-14/doc/intro.dox
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ sum over cells where each cell's contribution can then be used as an
error indicator for this cell.
Thus, we split the scalar products into terms for each cell, and
integrate by parts on each of them:
@f{eqnarray*}
@f{eqnarray*}{
J(e)
&=&
\sum_K (\nabla (u-u_h), \nabla (z-\varphi_h))_K
Expand All @@ -98,7 +98,7 @@ with which this term could cancel, the weight $z-\varphi_h$ can be chosen as
zero, and the whole term disappears.

Thus, we have
@f{eqnarray*}
@f{eqnarray*}{
J(e)
&=&
\sum_K (f+\Delta u_h, z-\varphi_h)_K
Expand All @@ -109,7 +109,7 @@ the value of this quantity as taken from this side of the cell (for the usual
Lagrange elements, derivatives are not continuous across edges). We then
rewrite the above formula by exchanging half of the edge integral of cell $K$
with the neighbor cell $K'$, to obtain
@f{eqnarray*}
@f{eqnarray*}{
J(e)
&=&
\sum_K (f+\Delta u_h, z-\varphi_h)_K
Expand All @@ -126,7 +126,7 @@ the jump of the normal derivative by
and get the final form after setting the discrete function $\varphi_h$, which
is by now still arbitrary, to the point interpolation of the dual solution,
$\varphi_h=I_h z$:
@f{eqnarray*}
@f{eqnarray*}{
J(e)
&=&
\sum_K (f+\Delta u_h, z-I_h z)_K
Expand Down
4 changes: 2 additions & 2 deletions examples/step-15/doc/intro.dox
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ have to use Newton's method to compute the solution iteratively.
In a classical sense, the problem is given in the following form:


@f{align*}
@f{align*}{
-\nabla \cdot \left( \frac{1}{\sqrt{1+|\nabla u|^{2}}}\nabla u \right) &= 0 \qquad
\qquad &&\textrm{in} ~ \Omega
\\
Expand All @@ -53,7 +53,7 @@ space. In this example, we choose $\Omega$ as the unit disk.
As described above, we solve this equation using Newton's method in which we
compute the $n$th approximate solution from the $(n-1)$th one, and use
a damping parameter $\alpha^n$ to get better global convergence behavior:
@f{align*}
@f{align*}{
F'(u^{n},\delta u^{n})&=- F(u^{n})
\\
u^{n+1}&=u^{n}+\alpha^n \delta u^{n}
Expand Down
4 changes: 2 additions & 2 deletions examples/step-15/doc/results.dox
Original file line number Diff line number Diff line change
Expand Up @@ -221,11 +221,11 @@ the form
@f]
we use a Newton iteration that requires us to repeatedly solve the
linear partial differential equation
@f{align*}
@f{align*}{
F'(u^{n},\delta u^{n}) &=- F(u^{n})
@f}
so that we can compute the update
@f{align*}
@f{align*}{
u^{n+1}&=u^{n}+\alpha^n \delta u^{n}
@f}
with the solution $\delta u^{n}$ of the Newton step. For the problem
Expand Down
14 changes: 7 additions & 7 deletions examples/step-18/doc/intro.dox
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ In addition, initial conditions
@f]
and Dirichlet (displacement) or Neumann (traction) boundary conditions need
to be specified for a unique solution:
@f{eqnarray*}
@f{eqnarray*}{
\mathbf{u}(\mathbf{x},t) &=& \mathbf{d}(\mathbf{x},t)
\qquad
\textrm{on}\ \Gamma_D\subset\partial\Omega,
Expand Down Expand Up @@ -82,7 +82,7 @@ that all changes in external forcing happen on times scales that are
much larger than $\tau$. In that case, the dynamic nature of the change is
unimportant: we can consider the body to always be in static equilibrium,
i.e. we can assume that at all times the body satisfies
@f{eqnarray*}
@f{eqnarray*}{
- \textrm{div}\ ( C \varepsilon(\mathbf{u})) &=& \mathbf{f}(\mathbf{x},t)
\qquad
\textrm{in}\ \Omega,
Expand Down Expand Up @@ -127,7 +127,7 @@ implementing a <i>real</i> model, as we will see in step-44.
To come back to defining our "artificial" model, let us first
introduce a tensorial stress variable $\sigma$, and write the differential
equations in terms of the stress:
@f{eqnarray*}
@f{eqnarray*}{
- \textrm{div}\ \sigma &=& \mathbf{f}(\mathbf{x},t)
\qquad
\textrm{in}\ \Omega(t),
Expand Down Expand Up @@ -172,7 +172,7 @@ and $\Delta \mathbf{u}^n$ the incremental displacement for time step
$n$. In addition, we have to specify initial data $\mathbf{u}(\cdot,0)=\mathbf{u}_0$.
This way, if we want to solve for the displacement increment, we
have to solve the following system:
@f{align*}
@f{align*}{
- \textrm{div}\ C \varepsilon(\Delta\mathbf{u}^n) &= \mathbf{f} + \textrm{div}\ \sigma^{n-1}
\qquad
&&\textrm{in}\ \Omega(t_{n-1}),
Expand All @@ -190,7 +190,7 @@ finite element formulation, reads as follows: find $\Delta \mathbf{u}^n \in
\{v\in H^1(\Omega(t_{n-1}))^d: v|_{\Gamma_D}=\mathbf{d}(\cdot,t_n) - \mathbf{d}(\cdot,t_{n-1})\}$
such that
<a name="step_18.linear-system"></a>
@f{align*}
@f{align*}{
(C \varepsilon(\Delta\mathbf{u}^n), \varepsilon(\varphi) )_{\Omega(t_{n-1})}
&=
(\mathbf{f}, \varphi)_{\Omega(t_{n-1})}
Expand All @@ -207,7 +207,7 @@ Using that $\sigma^{n-1} \mathbf{n}
= [C \varepsilon(\mathbf{u}^{n-1})] \mathbf{n}
= \mathbf{b}(\mathbf x, t_{n-1})$,
these equations can be simplified to
@f{align*}
@f{align*}{
(C \varepsilon(\Delta\mathbf{u}^n), \varepsilon(\varphi) )_{\Omega(t_{n-1})}
&=
(\mathbf{f}, \varphi)_{\Omega(t_{n-1})}
Expand Down Expand Up @@ -529,7 +529,7 @@ for (unsigned int i=0; i<dofs_per_cell; ++i)
between symmetric tensors of even rank here.

Assembling the local contributions
@f{eqnarray*}
@f{eqnarray*}{
f^K_i &=&
(\mathbf{f}, \varphi_i)_K -(\sigma^{n-1},\varepsilon(\varphi_i))_K
\\
Expand Down
30 changes: 15 additions & 15 deletions examples/step-20/doc/intro.dox
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ particular Raviart-Thomas elements -- and using block matrices to define
solvers, preconditioners, and nested versions of those that use the
substructure of the system matrix. The equation we are going to solve is again
the Poisson equation, though with a matrix-valued coefficient:
@f{eqnarray*}
@f{eqnarray*}{
-\nabla \cdot K({\mathbf x}) \nabla p &=& f \qquad {\textrm{in}\ } \Omega, \\
p &=& g \qquad {\textrm{on}\ }\partial\Omega.
@f}
Expand Down Expand Up @@ -89,7 +89,7 @@ areas of high pressure to areas of low pressure (thus the negative sign).

With this second variable, one then finds an alternative version of the
Laplace equation, called the <i>mixed formulation</i>:
@f{eqnarray*}
@f{eqnarray*}{
K^{-1} {\mathbf u} + \nabla p &=& 0 \qquad {\textrm{in}\ } \Omega, \\
-{\textrm{div}}\ {\mathbf u} &=& -f \qquad {\textrm{in}\ }\Omega, \\
p &=& g \qquad {\textrm{on}\ } \partial\Omega.
Expand All @@ -103,11 +103,11 @@ under the common assumption that $K$ is a symmetric tensor.

The weak formulation of this problem is found by multiplying the two
equations with test functions and integrating some terms by parts:
@f{eqnarray*}
@f{eqnarray*}{
A(\{{\mathbf u},p\},\{{\mathbf v},q\}) = F(\{{\mathbf v},q\}),
@f}
where
@f{eqnarray*}
@f{eqnarray*}{
A(\{{\mathbf u},p\},\{{\mathbf v},q\})
&=&
({\mathbf v}, K^{-1}{\mathbf u})_\Omega - ({\textrm{div}}\ {\mathbf v}, p)_\Omega
Expand Down Expand Up @@ -141,7 +141,7 @@ elements, for example the classic book by Brenner and Scott, also state the
relevant results. In any case, with appropriate choices of function
spaces, the discrete formulation reads as follows: Find ${\mathbf
u}_h,p_h$ so that
@f{eqnarray*}
@f{eqnarray*}{
A(\{{\mathbf u}_h,p_h\},\{{\mathbf v}_h,q_h\}) = F(\{{\mathbf v}_h,q_h\})
\qquad\qquad \forall {\mathbf v}_h,q_h.
@f}
Expand All @@ -156,20 +156,20 @@ zero everywhere else. If we also choose ${\mathbf v}=0$ everywhere
(remember that the weak form above has to hold for <i>all</i> discrete
test functions $q,v$), then putting these choices of test functions
into the weak formulation above implies in particular that
@f{eqnarray*}
@f{eqnarray*}{
- (1,{\textrm{div}}\ {\mathbf u}_h)_K
=
-(1,f)_K,
@f}
which we can of course write in more explicit form as
@f{eqnarray*}
@f{eqnarray*}{
\int_K {\textrm{div}}\ {\mathbf u}_h
=
\int_K f.
@f}
Applying the divergence theorem results in the fact that ${\mathbf
u}_h$ has to satisfy, for every choice of cell $K$, the relationship
@f{eqnarray*}
@f{eqnarray*}{
\int_{\partial K} {\mathbf u}_h\cdot{\mathbf n}
=
\int_K f.
Expand Down Expand Up @@ -202,7 +202,7 @@ The deal.II library (of course) implements Raviart-Thomas elements $RT(k)$ of
arbitrary order $k$, as well as discontinuous elements $DG(k)$. If we forget
about their particular properties for a second, we then have to solve a
discrete problem
@f{eqnarray*}
@f{eqnarray*}{
A(x_h,w_h) = F(w_h),
@f}
with the bilinear form and right hand side as stated above, and $x_h=\{{\mathbf u}_h,p_h\}$, $w_h=\{{\mathbf v}_h,q_h\}$. Both $x_h$ and $w_h$ are from the space
Expand Down Expand Up @@ -263,7 +263,7 @@ return a non-zero value for more than just one component.
We could now attempt to rewrite the bilinear form above in terms of vector
components. For example, in 2d, the first term could be rewritten like this
(note that $u_0=x_0, u_1=x_1, p=x_2$):
@f{eqnarray*}
@f{eqnarray*}{
({\mathbf u}_h^i, K^{-1}{\mathbf u}_h^j)
=
&\left((x_h^i)_0, K^{-1}_{00} (x_h^j)_0\right) +
Expand Down Expand Up @@ -463,7 +463,7 @@ In view of the difficulties using standard solvers and preconditioners
mentioned above, let us take another look at the matrix. If we sort our
degrees of freedom so that all velocity come before all pressure variables,
then we can subdivide the linear system $Ax=b$ into the following blocks:
@f{eqnarray*}
@f{eqnarray*}{
\left(\begin{array}{cc}
M & B \\ B^T & 0
\end{array}\right)
Expand All @@ -483,7 +483,7 @@ to the gradient.
By block elimination, we can then re-order this system in the following way
(multiply the first row of the system by $B^TM^{-1}$ and then subtract the
second row from it):
@f{eqnarray*}
@f{eqnarray*}{
B^TM^{-1}B P &=& B^TM^{-1} F - G, \\
MU &=& F - BP.
@f}
Expand Down Expand Up @@ -713,7 +713,7 @@ We will try something along the second approach, as much to improve the
performance of the program as to demonstrate some techniques. To this end, let
us recall that the ideal preconditioner is, of course, $S^{-1}$, but that is
unattainable. However, how about
@f{eqnarray*}
@f{eqnarray*}{
\tilde S^{-1} = [B^T ({\textrm{diag}\ }M)^{-1}B]^{-1}
@f}
as a preconditioner? That would mean that every time we have to do one
Expand Down Expand Up @@ -782,12 +782,12 @@ formulation as stated above. Since we want to monitor convergence of the
solution inside the program, we choose right hand side, boundary conditions,
and the coefficient so that we recover a solution function known to us. In
particular, we choose the pressure solution
@f{eqnarray*}
@f{eqnarray*}{
p = -\left(\frac \alpha 2 xy^2 + \beta x - \frac \alpha 6 x^3\right),
@f}
and for the coefficient we choose the unit matrix $K_{ij}=\delta_{ij}$ for
simplicity. Consequently, the exact velocity satisfies
@f{eqnarray*}
@f{eqnarray*}{
{\mathbf u} =
\left(\begin{array}{cc}
\frac \alpha 2 y^2 + \beta - \frac \alpha 2 x^2 \\
Expand Down
30 changes: 15 additions & 15 deletions examples/step-21/doc/intro.dox
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ however.
The velocity with which molecules of each of the two phases move is
determined by Darcy's law that states that the velocity is
proportional to the pressure gradient:
@f{eqnarray*}
@f{eqnarray*}{
\mathbf{u}_{j}
=
-\frac{k_{rj}(S)}{\mu_{j}} \mathbf{K} \cdot \nabla p
Expand All @@ -61,7 +61,7 @@ each phase,
with a source term for each phase. By summing over the two phases,
we can express the governing equations in terms of the
so-called pressure equation:
@f{eqnarray*}
@f{eqnarray*}{
- \nabla \cdot (\mathbf{K}\lambda(S) \nabla p)= q.
@f}
Here, $q$ is the sum source term, and
Expand All @@ -80,12 +80,12 @@ The second part of the equations is the description of the
dynamics of the saturation, i.e., how the relative concentration of the
two fluids changes with time. The saturation equation for the displacing
fluid (water) is given by the following conservation law:
@f{eqnarray*}
@f{eqnarray*}{
S_{t} + \nabla \cdot (F(S) \mathbf{u}) = q_{w},
@f}
which can be rewritten by using the product rule of the divergence operator
in the previous equation:
@f{eqnarray*}
@f{eqnarray*}{
S_{t} + F(S) \left[\nabla \cdot \mathbf{u}\right]
+ \mathbf{u} \cdot \left[ \nabla F(S)\right]
= S_{t} + F(S) q + \mathbf{u} \cdot \nabla F(S) = q_{w}.
Expand All @@ -104,7 +104,7 @@ where the fractional flow is often parameterized via the (heuristic) expression
@f]
Putting it all together yields the saturation equation in the following,
advected form:
@f{eqnarray*}
@f{eqnarray*}{
S_{t} + \mathbf{u} \cdot \nabla F(S) = 0,
@f}
where $\mathbf u$ is the total velocity
Expand All @@ -124,7 +124,7 @@ $\mathbf u (1-F'(S))$. $F(S)$ is consequently often referred to as the
<i>fractional flow</i>.

In summary, what we get are the following two equations:
@f{eqnarray*}
@f{eqnarray*}{
- \nabla \cdot (\mathbf{K}\lambda(S) \nabla p) &=& q
\qquad \textrm{in}\ \Omega\times[0,T],
\\
Expand Down Expand Up @@ -169,7 +169,7 @@ In the reservoir simulation community, it is common to solve the equations
derived above by going back to the first order, mixed formulation. To this
end, we re-introduce the total velocity $\mathbf u$ and write the equations in
the following form:
@f{eqnarray*}
@f{eqnarray*}{
\mathbf{u}+\mathbf{K}\lambda(S) \nabla p&=&0 \\
\nabla \cdot\mathbf{u} &=& q \\
S_{t} + \mathbf{u} \cdot \nabla F(S) &=& 0.
Expand All @@ -194,7 +194,7 @@ L. Stone and A. O. Gardner Jr: <i>Analysis of gas-cap or dissolved-gas
reservoirs</i>, Trans. SPE AIME, 222 (1961), pp. 92-104).
In a slightly modified form, this algorithm can be
written as follows: for each time step, solve
@f{eqnarray*}
@f{eqnarray*}{
\mathbf{u}^{n+1}+\mathbf{K}\lambda(S^n) \nabla p^{n+1}&=&0 \\
\nabla \cdot\mathbf{u}^{n+1} &=& q^{n+1} \\
\frac {S^{n+1}-S^n}{\triangle t} + \mathbf{u}^{n+1} \cdot \nabla F(S^n) &=& 0,
Expand All @@ -211,7 +211,7 @@ splitting" method. step-58 has a long description of the idea behind this.)
We can then state the problem in weak form as follows, by multiplying each
equation with test functions $\mathbf v$, $\phi$, and $\sigma$ and integrating
terms by parts:
@f{eqnarray*}
@f{eqnarray*}{
\left((\mathbf{K}\lambda(S^n))^{-1} \mathbf{u}^{n+1},\mathbf v\right)_\Omega -
(p^{n+1}, \nabla\cdot\mathbf v)_\Omega &=&
- (p^{n+1}, \mathbf v)_{\partial\Omega}
Expand All @@ -223,7 +223,7 @@ the boundary $\partial\Omega$ as boundary values for our problem. $\mathbf n$
denotes the unit outward normal vector to $\partial K$, as usual.

For the saturation equation, we obtain after integrating by parts
@f{eqnarray*}
@f{eqnarray*}{
(S^{n+1}, \sigma)_\Omega
-
\triangle t
Expand All @@ -238,7 +238,7 @@ For the saturation equation, we obtain after integrating by parts
@f}
Using the fact that $\nabla \cdot \mathbf{u}^{n+1}=q^{n+1}$, we can rewrite the
cell term to get an equation as follows:
@f{eqnarray*}
@f{eqnarray*}{
(S^{n+1}, \sigma)_\Omega
-
\triangle t
Expand Down Expand Up @@ -272,7 +272,7 @@ terms on the interfaces between cells, since discontinuous functions are not
really defined there. In particular, we have to give a meaning to the last
term on the left hand side of the saturation equation. To this end, let us
define that we want to evaluate it in the following sense:
@f{eqnarray*}
@f{eqnarray*}{
&&\left(F(S^n) (\mathbf n \cdot \mathbf{u}^{n+1}), \sigma\right)_{\partial K}
\\
&&\qquad =
Expand Down Expand Up @@ -321,7 +321,7 @@ B & 0 & 0\\
where the individual matrices and vectors are defined as follows using
shape functions $\mathbf v_i$ (of type Raviart Thomas $RT_k$) for
velocities and $\phi_i$ (of type $DGQ_k$) for both pressures and saturations:
@f{eqnarray*}
@f{eqnarray*}{
M^u(S^n)_{ij} &=&
\left((\mathbf{K}\lambda(S^n))^{-1} \mathbf{v}_i,\mathbf
v_j\right)_\Omega,
Expand Down Expand Up @@ -471,7 +471,7 @@ boundary conditions for the saturation on the inflow part of the boundary,
\mathbf{n} \cdot \mathbf{u}(\mathbf{x},t) < 0\}.
@f]
On this inflow boundary, we impose the following saturation values:
@f{eqnarray}
@f{eqnarray}{
S(\mathbf{x},t) = 1 & \textrm{on}\ \Gamma_{in}\cap\{x_1=0\},
\\
S(\mathbf{x},t) = 0 & \textrm{on}\ \Gamma_{in}\backslash \{x_1=0\}.
Expand Down Expand Up @@ -540,7 +540,7 @@ functions introduced at the end of the results section of @ref step_20
linear solvers will no longer converge properly.

<li>A function that models a somewhat random medium. Here, we choose
@f{eqnarray*}
@f{eqnarray*}{
k(\mathbf x)
&=&
\min \left\{ \max \left\{ \sum_{i=1}^N \sigma_i(\mathbf{x}), 0.01 \right\}, 4\right\},
Expand Down