Skip to content

Commit

Permalink
typoss
Browse files Browse the repository at this point in the history
Signed-off-by: Umberto Zerbinati <[email protected]>
  • Loading branch information
Umberto Zerbinati committed Jun 7, 2024
1 parent 58c9b4f commit 509a967
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
10 changes: 5 additions & 5 deletions docs/src/PETScPC/oseen.py.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ Vertex Patch smoothing for Augmented Lagrangian formulations of the Oseen proble
In this tutorial, we will see how to use an augmented Lagrangian formulation to precondition the Oseen problem, i.e.

.. math::
\text{Given }\vec{\beta}\in \mathbb{R}^3 \text{ find } (\vec{u},p) \in [H^1_{0}(\Omega)]^d\times L^2(\Omega) \text{ s.t. }
\text{Given } \vec{\beta} \in \mathbb{R}^3 \text{ find } (\vec{u}, p) \in [H^1_{0}(\Omega)]^d \times L^2(\Omega) \text{ s.t. }
\begin{cases}
\nu (\nabla \vec{u},\nabla \vec{v})_{L^2(\Omega)} + (\nabla\cdot \vec{v}, p)_{L^2(\Omega)} -(\nabla \vec{u}\vec{\beta},\vec{v})_{L^2(\Omega)} + (div(\vec{u}),div(\vec{v}))_{L^2(\Omega)} = (\vec{f},\vec{v})_{L^2(\Omega)} \qquad \forall v\in H^1_{0}(\Omega)\\
(\nabla\cdot \vec{u},q)_{L^2(\Omega)} = 0 \qquad \froall q\in L^2(\Omega)
\nu (\nabla \vec{u}, \nabla \vec{v})_{L^2(\Omega)} + (\nabla \cdot \vec{v}, p)_{L^2(\Omega)} - (\nabla \vec{u} \vec{\beta}, \vec{v})_{L^2(\Omega)} + \gamma (\text{div}(\vec{u}), \text{div}(\vec{v}))_{L^2(\Omega)} = (\vec{f}, \vec{v})_{L^2(\Omega)} \quad \forall v \in H^1_{0}(\Omega) \\
(\nabla \cdot \vec{u}, q)_{L^2(\Omega)} = 0 \quad \forall q \in L^2(\Omega)
\end{cases}
Let us begin defining the parameters of the problem. ::
Expand Down
2 changes: 1 addition & 1 deletion docs/src/PETScPC/stokes.py.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ In particular, we will consider a Bernardi-Raugel inf-sup stable discretization
\begin{cases}
(\nabla \vec{u},\nabla \vec{v})_{L^2(\Omega)} + (\nabla\cdot \vec{v}, p)_{L^2(\Omega)} = (\vec{f},\vec{v})_{L^2(\Omega)} \qquad \forall v\in H^1_{0}(\Omega)\\
(\nabla\cdot \vec{u},q)_{L^2(\Omega)} = 0 \qquad \froall q\in L^2(\Omega)
(\nabla\cdot \vec{u},q)_{L^2(\Omega)} = 0 \qquad \forall q\in L^2(\Omega)
\end{cases}
Such a discretization can easily be constructed using NGSolve as follows: ::
Expand Down
4 changes: 3 additions & 1 deletion docs/src/PETScSNES/hyperelasticity.py.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ A discretization of this energy leads to a non-linear problem that we solve usin
a += Variation(NeoHooke(C(u)).Compile()*dx)
a += ((Id(3)+Grad(u.Trace()))*force)*v*ds("top")

Once we have defined the energy and the weak form, we can solve the non-linear problem using `PETSc SNES`.
In particular, we will use a Newton method with line search, and precondition the linear solves with a direct solver. ::

from ngsPETSc import NonLinearSolver
gfu_petsc = GridFunction(fes)
gfu_ngs = GridFunction(fes)
Expand Down Expand Up @@ -89,4 +92,3 @@ We compare the performance of the two solvers, in the following table:
- 10

This suggests that while NGS non-linear solver when finely tuned performs as well as PETSc SNES, it is more sensitive to the choice of the damping factor. In this case, a damping factor of 0.3 was found to be the best choice.
"""
4 changes: 2 additions & 2 deletions docs/src/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

templates_path = ['_templates']
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']

mathjax3_config = {'chtml': {'displayAlign': 'left'}}
html_sourcelink_suffix = ''
nbsphinx_prolog = r"""
{% set docname = env.doc2path(env.docname, base='').replace('i-tutorials/', '') %}
Expand Down Expand Up @@ -64,4 +64,4 @@
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output

html_theme = 'sphinx_rtd_theme'
html_static_path = ['../_static']
html_static_path = ['../_static']

0 comments on commit 509a967

Please sign in to comment.