From 509a9674ef7d161b7640f547b7cdcb04a2c9b897 Mon Sep 17 00:00:00 2001 From: Umberto Zerbinati Date: Fri, 7 Jun 2024 16:07:47 +0100 Subject: [PATCH] typoss Signed-off-by: Umberto Zerbinati --- docs/src/PETScPC/oseen.py.rst | 10 +++++----- docs/src/PETScPC/stokes.py.rst | 2 +- docs/src/PETScSNES/hyperelasticity.py.rst | 4 +++- docs/src/conf.py | 4 ++-- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/docs/src/PETScPC/oseen.py.rst b/docs/src/PETScPC/oseen.py.rst index 5ed0637..4d49606 100755 --- a/docs/src/PETScPC/oseen.py.rst +++ b/docs/src/PETScPC/oseen.py.rst @@ -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. :: diff --git a/docs/src/PETScPC/stokes.py.rst b/docs/src/PETScPC/stokes.py.rst index fba4dce..9de24dd 100755 --- a/docs/src/PETScPC/stokes.py.rst +++ b/docs/src/PETScPC/stokes.py.rst @@ -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: :: diff --git a/docs/src/PETScSNES/hyperelasticity.py.rst b/docs/src/PETScSNES/hyperelasticity.py.rst index 6746732..88e108d 100644 --- a/docs/src/PETScSNES/hyperelasticity.py.rst +++ b/docs/src/PETScSNES/hyperelasticity.py.rst @@ -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) @@ -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. -""" \ No newline at end of file diff --git a/docs/src/conf.py b/docs/src/conf.py index 53f5d91..e96c65f 100644 --- a/docs/src/conf.py +++ b/docs/src/conf.py @@ -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/', '') %} @@ -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'] \ No newline at end of file