Skip to content

Commit

Permalink
More tweaking
Browse files Browse the repository at this point in the history
  • Loading branch information
JDBetteridge committed Jan 30, 2023
1 parent eb7ae84 commit 12ab3a0
Show file tree
Hide file tree
Showing 9 changed files with 71 additions and 57 deletions.
6 changes: 2 additions & 4 deletions AUTHORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ Colin Cotter..................<http://www.imperial.ac.uk/people/colin.cotter>

Joshua Coutinho

Patrick E. Farrell............<https://www.maths.ox.ac.uk/people/patrick.farrell>
Patrick E. Farrell............<https://pefarrell.org>

Simon Funke...................<http://www.simonfunke.com>

Expand All @@ -84,8 +84,6 @@ David Ham.....................<http://www.imperial.ac.uk/people/david.ham>

Christopher Hawkes

Reuben Hill...................<https://www.imperial.ac.uk/people/reuben.hill10>

Miklós Homolya

Christian Jacobs
Expand Down Expand Up @@ -126,7 +124,7 @@ Lawrence Mitchell

Eike Mueller

Reuben W. Nixon-Hill
Reuben Nixon-Hill.............<https://www.imperial.ac.uk/people/reuben.hill10>

Alberto Paganini..............<https://www2.le.ac.uk/departments/mathematics/extranet/staff-material/staff-profiles/alberto-paganini>

Expand Down
16 changes: 12 additions & 4 deletions demos/benney_luke/benney_luke.py.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,18 @@ Note that the Neumann boundary conditions have been used to remove every surface

.. math::
\int_{\Omega} \frac{\phi^{n+1/2}-\phi^n}{\frac{1}{2}\!dt}\,v + \frac{\mu}{2}\nabla\left(\frac{\phi^{n+1/2}-\phi^n}{\frac{1}{2}\!dt}\right)\cdot\nabla v + \eta^n\,v + \frac{\epsilon}{2}\nabla\phi^{n+1/2}\cdot\nabla\phi^{n+1/2}\,v \,dx\,dy &= 0 \\
\int_{\Omega} q^{n+1/2}\,v - \frac{2}{3}\nabla\phi^{n+1/2}\cdot\nabla v \,dx\,dy &= 0 \\
\int_{\Omega} \frac{\eta^{n+1}-\eta^n}{dt}\,v + \frac{\mu}{2}\nabla\left(\frac{\eta^{n+1}-\eta^n}{dt}\right)\cdot\nabla v - \frac{1}{2}\Bigl( \left(1+\epsilon\eta^{n+1}\right) + \left(1+\epsilon\eta^n\right) \Bigr)\nabla\phi^{n+1/2}\cdot\nabla v - \mu\nabla q^{n+1/2}\cdot\nabla v \,dx\,dy &= 0 \\
\int_{\Omega} \frac{\phi^{n+1}-\phi^{n+1/2}}{\frac{1}{2}\!dt}\,v + \frac{\mu}{2}\nabla\left(\frac{\phi^{n+1}-\phi^{n+1/2}}{\frac{1}{2}\!dt}\right)\cdot\nabla v + \eta^{n+1}\,v + \frac{\epsilon}{2}\nabla\phi^{n+1/2}\cdot\nabla\phi^{n+1/2}\,v \,dx\,dy &= 0 \\
\int_{\Omega} \frac{\phi^{n+1/2}-\phi^n}{\frac{1}{2}\!dt}\,v + \frac{\mu}{2}\nabla\left(\frac{\phi^{n+1/2}-\phi^n}{\frac{1}{2}\!dt}\right)\cdot\nabla v \hspace{8em}\\
+ \eta^n\,v + \frac{\epsilon}{2}\nabla\phi^{n+1/2}\cdot\nabla\phi^{n+1/2}\,v \,dx\,dy &= 0 \\\\
%
\int_{\Omega} q^{n+1/2}\,v - \frac{2}{3}\nabla\phi^{n+1/2}\cdot\nabla v \,dx\,dy &= 0 \\\\
%
\int_{\Omega} \frac{\eta^{n+1}-\eta^n}{dt}\,v + \frac{\mu}{2}\nabla\left(\frac{\eta^{n+1}-\eta^n}{dt}\right)\cdot\nabla v \hspace{8em}\\
- \frac{1}{2}\Bigl( \left(1+\epsilon\eta^{n+1}\right) + \left(1+\epsilon\eta^n\right) \Bigr)\nabla\phi^{n+1/2}\cdot\nabla v \hspace{4em}\\
- \mu\nabla q^{n+1/2}\cdot\nabla v \,dx\,dy &= 0 \\\\
%
\int_{\Omega} \frac{\phi^{n+1}-\phi^{n+1/2}}{\frac{1}{2}\!dt}\,v + \frac{\mu}{2}\nabla\left(\frac{\phi^{n+1}-\phi^{n+1/2}}{\frac{1}{2}\!dt}\right)\cdot\nabla v \hspace{8em}\\
+ \eta^{n+1}\,v + \frac{\epsilon}{2}\nabla\phi^{n+1/2}\cdot\nabla\phi^{n+1/2}\,v \,dx\,dy &= 0 \\\\
%
\int_{\Omega} q^{n+1}\,v - \frac{2}{3}\nabla\phi^{n+1}\cdot\nabla v \,dx\,dy &= 0.
Furthermore, we note that the Benney-Luke equations admit asymptotic solutions (correct up to order :math:`\epsilon`). The "exact" solutions can be found by assuming one-dimensional travelling waves of the type
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,18 @@ After numerous manipulations (described in detail in :cite:`Salwa:2017`) and eva
.. math::
\begin{aligned}
& \int v \phi^{n+1} \, {\mathrm d} S_f = \int v (\phi^n - \Delta t \eta^n) \, {\mathrm d} S_f \\
& \int \rho_0 {\bf v} \cdot {\bf U}^{n+1} \, {\mathrm d} x_S \underline{ + \int {\bf n} \cdot {\bf v} \, \phi^{n+1} \, {\mathrm d} s_s} = \rho_0 \int {\bf v} \cdot {\bf U}^n \, {\mathrm d} x_S \nonumber\\
& \hspace{5cm} - \Delta t \int \left( \lambda \nabla \cdot {\bf v} \nabla \cdot {\bf X}^n + \mu \frac{\partial X^n_j}{\partial x_i} \left( \frac{\partial v_i}{\partial x_j} + \frac{\partial v_j}{\partial x_i} \right) \right) \, {\mathrm d} x_S \underline{ + \int {\bf n} \cdot {\bf v} \, \phi^n \, {\mathrm d} s_s }
\\
& \int \nabla v \cdot \nabla \phi^{n+1} \, {\mathrm d} x_F \underline{ - \int v {\bf n} \cdot {\bf U}^{n+1} \, {\mathrm d} s_s }= 0 \\ %\hspace{1cm} (+ \text{Dirichlet BC at } \partial \Omega_f)\\
& \int v \eta^{n+1} \, {\mathrm d} S_f = \int v \eta^n \, {\mathrm d} S_f + \Delta t \int \nabla v \cdot \nabla \phi^{n+1} \, {\mathrm d} x_F \underline{ - \Delta t \int v {\bf n} \cdot {\bf U}^{n+1}\, {\mathrm d} s_s }\\
& \int {\bf v} \cdot {\bf X}^{n+1} \, {\mathrm d} x_S = \int {\bf v} \cdot ( {\bf X}^n + \Delta t {\bf U}^{n+1} ) \, {\mathrm d} x_S \, .
\int v \phi^{n+1} \, {\mathrm d} S_f &= \int v (\phi^n - \Delta t \eta^n) \, {\mathrm d} S_f \\\\
%
\int \rho_0 {\bf v} \cdot {\bf U}^{n+1} \, {\mathrm d} x_S\ \underline{+ \int {\bf n} \cdot {\bf v} \, \phi^{n+1} \, {\mathrm d} s_s} &= \rho_0 \int {\bf v} \cdot {\bf U}^n \, {\mathrm d} x_S \nonumber\\
&\hspace{4em}- \Delta t \int \left( \lambda \nabla \cdot {\bf v} \nabla \cdot {\bf X}^n + \mu \frac{\partial X^n_j}{\partial x_i} \left( \frac{\partial v_i}{\partial x_j} + \frac{\partial v_j}{\partial x_i} \right) \right) \, {\mathrm d} x_S \\
&\hspace{8em}\underline{ + \int {\bf n} \cdot {\bf v} \, \phi^n \, {\mathrm d} s_s }\\\\
%
\int \nabla v \cdot \nabla \phi^{n+1} \, {\mathrm d} x_F\ \underline{- \int v {\bf n} \cdot {\bf U}^{n+1} \, {\mathrm d} s_s } &= 0 \\\\ %\hspace{1cm} (+ \text{Dirichlet BC at } \partial \Omega_f)\\
%
\int v \eta^{n+1} \, {\mathrm d} S_f &= \int v \eta^n \, {\mathrm d} S_f + \Delta t \int \nabla v \cdot \nabla \phi^{n+1} \, {\mathrm d} x_F\\
&\hspace{4em}\underline{- \Delta t \int v {\bf n} \cdot {\bf U}^{n+1}\, {\mathrm d} s_s }\\\\
%
\int {\bf v} \cdot {\bf X}^{n+1} \, {\mathrm d} x_S &= \int {\bf v} \cdot ( {\bf X}^n + \Delta t {\bf U}^{n+1} ) \, {\mathrm d} x_S \, .
\end{aligned}
The underlined terms are the coupling terms. Note that the first equation for :math:`\phi` at the free surface is solved on the free surface only, the last equation for :math:`{\bf X}` in the structure domain, while the others are solved in both domains. Moreover, the second and third equations for :math:`\phi` and :math:`{\bf U}` need to be solved simultaneously. The geometry of the system with initial condition is shown below.
Expand Down
57 changes: 30 additions & 27 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,23 @@

# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = ['sphinx.ext.autodoc',
'sphinx.ext.mathjax',
'sphinx.ext.intersphinx',
'sphinx.ext.viewcode',
'sphinx.ext.graphviz',
'sphinxcontrib.youtube',
'sphinxcontrib.bibtex',
'sphinxcontrib.inkscapeconverter',
'numpydoc']
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.mathjax',
'sphinx.ext.intersphinx',
'sphinx.ext.viewcode',
'sphinx.ext.graphviz',
'sphinxcontrib.youtube',
'sphinxcontrib.bibtex',
'sphinxcontrib.inkscapeconverter',
'numpydoc'
]

mathjax_path = 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/3.2.2/es5/tex-mml-chtml.min.js'

mathjax3_config = {
'loader': {'load': ['[tex]/mathtools']},
'tex': {'packages': {'[+]': ['mathtools']}}
'loader': {'load': ['[tex]/mathtools']},
'tex': {'packages': {'[+]': ['mathtools']}}
}

# Both the class’ and the __init__ method’s docstring are concatenated and
Expand Down Expand Up @@ -197,12 +199,9 @@

# -- Options for LaTeX output --------------------------------------------

# ~ latex_engine = 'lualatex'
# ~ latex_use_xindy = False

latex_additional_files = [
'_static/sphinxpoptitle.sty'
]
'_static/sphinxpoptitle.sty'
]

latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
Expand Down Expand Up @@ -245,14 +244,15 @@

'extrapackages': r'''\usepackage{mathtools}''',

'maketitle' : r'\sphinxpoptitlepages'
'maketitle': r'\sphinxpoptitlepages',

'makeindex': r'\usepackage[columns=1]{idxlayout}\makeindex'
}

# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass [howto/manual]).
latex_documents = [
('book', 'Firedrake.tex', u'User Manual',
' \\and '.join(author_list), 'manual'),
('book', 'Firedrake.tex', u'User Manual', r' \and '.join(author_list), 'manual'),
]

# The name of an image file (relative to this directory) to place at the top of
Expand All @@ -261,7 +261,7 @@

# For "manual" documents, if this is true, then toplevel headings are parts,
# not chapters.
#latex_use_parts = True
#latex_use_parts = False

# If true, show page references after internal links.
#latex_show_pagerefs = False
Expand All @@ -282,8 +282,7 @@
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
('index', 'firedrake', u'Firedrake Documentation',
author, 1)
('index', 'firedrake', u'Firedrake Documentation', author, 1)
]

# If true, show URL addresses after external links.
Expand All @@ -295,11 +294,15 @@
# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
('index', 'Firedrake', u'Firedrake Documentation',
author, 'Firedrake', 'One line description of project.',
'Miscellaneous'),
]
texinfo_documents = [(
'index',
'Firedrake',
u'Firedrake Documentation',
author,
'Firedrake',
'One line description of project.',
'Miscellaneous'
),]

# Documents to append as an appendix to all manuals.
#texinfo_appendices = []
Expand Down
5 changes: 3 additions & 2 deletions docs/source/team.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[a]
# A section for short links
icl: http://www.imperial.ac.uk
gh: https://github.com

Expand Down Expand Up @@ -43,7 +44,7 @@ Sophia Vorderwuelbecke: https://www.imperial.ac.uk/people/s.vorderwuelbecke18
Tom Gregory: https://www.imperial.ac.uk/people/t.gregory18
Jack Betteridge: https://www.imperial.ac.uk/people/j.betteridge, https://upload.wikimedia.org/wikipedia/commons/thumb/a/a1/Mallard2.jpg/632px-Mallard2.jpg
Daniel Shapero: http://psc.apl.uw.edu/people/investigators/daniel-shapero/
Reuben Hill: https://www.imperial.ac.uk/people/reuben.hill10
Reuben Nixon-Hill: https://www.imperial.ac.uk/people/reuben.hill10
Connor Ward: https://www.imperial.ac.uk/people/c.ward20

[inactive-team]
Expand Down Expand Up @@ -110,7 +111,7 @@ Andrew McRae:
Oliver Meister: https://www5.in.tum.de/wiki/index.php/Dipl.-Inf._Oliver_Meister
Lawrence Mitchell:
Eike Mueller:
Reuben W. Nixon-Hill:
Reuben Nixon-Hill:
Alberto Paganini: https://www2.le.ac.uk/departments/mathematics/extranet/staff-material/staff-profiles/alberto-paganini
Francis Poulin:
Florian Rathgeber:
Expand Down
2 changes: 0 additions & 2 deletions docs/source/team.rst_t
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
:orphan:

..
This file is generated by team.py using the team.rst_t template and team.ini.
DO NOT EDIT DIRECTLY
Expand Down
5 changes: 3 additions & 2 deletions firedrake/preconditioners/pcd.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ class PCDPC(PCBase):
S^{-1} \sim K^{-1} F_p M^{-1}
Where :math:`K = \\nabla^2`, :math:`M = \mathbb{I}` and
:math:`F_p = 1/\mathrm{Re} \\nabla^2 + u\cdot\\nabla`.
Where :math:`K = \nabla^2`,
:math:`F_p = (1/\mathrm{Re}) \nabla^2 + u\cdot\nabla`
and :math:`M = \mathbb{I}`.
The inverse of :math:`K` is approximated by a KSP which can be
controlled using the options prefix ``pcd_Kp_``.
Expand Down
10 changes: 5 additions & 5 deletions firedrake/slate/slate.py
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ def _key(self):


class Block(TensorBase):
"""This class represents a tensor corresponding
r"""This class represents a tensor corresponding
to particular block of a mixed tensor. Depending on
the indices provided, the subblocks can span multiple
test/trial spaces.
Expand Down Expand Up @@ -600,21 +600,21 @@ class Block(TensorBase):
.. math::
\\begin{bmatrix}
\begin{bmatrix}
A & B & C \\
D & E & F \\
G & H & J
\\end{bmatrix}
\end{bmatrix}
Providing the 2-tuple ((0, 1), (0, 1)) returns a tensor
corresponding to the upper 2x2 block:
.. math::
\\begin{bmatrix}
\begin{bmatrix}
A & B \\
D & E
\\end{bmatrix}
\end{bmatrix}
More generally, argument indices of the form `(idr, idc)`
produces a tensor of block-size `len(idr)` x `len(idc)`
Expand Down
8 changes: 4 additions & 4 deletions firedrake/slate/static_condensation/la_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -454,10 +454,10 @@ def build_schur(self, rhs, non_zero_saddle_rhs=None):
.. code-block:: text
A.inv = [[I, -A00.inv * A01] * [[A00.inv, 0 ] * [[I, 0]
[0, I ]] [0, S.inv]] [-A10* A00.inv, I]]
-------------------- ----------------- -------------------
block1 block2 block3
A.inv=[[I, -A00.inv * A01] * [[A00.inv, 0 ] * [[I, 0]
[0, I ]] [0, S.inv]] [-A10* A00.inv, I]]
-------------------- ----------------- ------------------
block1 block2 block3
with the (inner) schur complement S = A11 - A10 * A00.inv * A01
"""

Expand Down

0 comments on commit 12ab3a0

Please sign in to comment.