Skip to content

Commit

Permalink
Fix demo links in PDF manual
Browse files Browse the repository at this point in the history
  • Loading branch information
connorjward authored and JDBetteridge committed Feb 9, 2023
1 parent 5c9f084 commit 3f1b080
Show file tree
Hide file tree
Showing 21 changed files with 32 additions and 26 deletions.
2 changes: 1 addition & 1 deletion demos/DG_advection/DG_advection.py.rst
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ The last step is to make the animation and save it to a file. ::
print("Failed to write movie! Try installing `ffmpeg`.")

This demo can be found as a script in
`DG_advection.py <DG_advection.py>`__.
:demo:`DG_advection.py <DG_advection.py>`.


.. rubric:: References
Expand Down
2 changes: 1 addition & 1 deletion demos/benney_luke/benney_luke.py.rst
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ We are now ready to enter the main time iteration loop::

The output can be visualised using `paraview <http://www.paraview.org/>`__.

A python script version of this demo can be found `here <benney_luke.py>`__.
A python script version of this demo can be found :demo:`here <benney_luke.py>`.

The Benney-Luke system and weak formulations presented in this demo have also been used to model extreme waves that occur due to Mach reflection through the intersection of two obliquely incident solitary waves. More information can be found in :cite:`Gidel:2017`.

Expand Down
2 changes: 1 addition & 1 deletion demos/burgers/burgers.py.rst
Original file line number Diff line number Diff line change
Expand Up @@ -113,4 +113,4 @@ which amount to applying a full LU decomposition as a preconditioner. ::
t += timestep
outfile.write(project(u, V_out, name="Velocity"))
A python script version of this demo can be found `here <burgers.py>`__.
A python script version of this demo can be found :demo:`here <burgers.py>`.
2 changes: 1 addition & 1 deletion demos/camassa-holm/camassaholm.py.rst
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ Images of the solution at shown below.

Solution at :math:`t = 5.3.`

A python script version of this demo can be found `here <camassaholm.py>`__.
A python script version of this demo can be found :demo:`here <camassaholm.py>`.

.. rubric:: References

Expand Down
2 changes: 1 addition & 1 deletion demos/eigenvalues_QG_basinmodes/qgbasinmodes.py.rst
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ Below is a plot of the spatial structure of the imaginary part of one of the eig
.. figure:: eigenmode_imag.png
:align: center

This demo can be found as a Python script in `qgbasinmodes.py <qgbasinmodes.py>`__.
This demo can be found as a Python script in :demo:`qgbasinmodes.py <qgbasinmodes.py>`.

.. rubric:: References

Expand Down
2 changes: 1 addition & 1 deletion demos/extruded_continuity/extruded_continuity.py.rst
Original file line number Diff line number Diff line change
Expand Up @@ -147,4 +147,4 @@ We finally compare our solution to the expected solution: ::
assert max(abs(out.dat.data - exact.dat.data)) < 1e-10

This demo can be found as a script in
`extruded_continuity.py <extruded_continuity.py>`__.
:demo:`extruded_continuity.py <extruded_continuity.py>`.
2 changes: 1 addition & 1 deletion demos/helmholtz/helmholtz.py.rst
Original file line number Diff line number Diff line change
Expand Up @@ -137,4 +137,4 @@ Alternatively, since we have an analytic solution, we can check the
f.interpolate(cos(x*pi*2)*cos(y*pi*2))
print(sqrt(assemble(dot(u - f, u - f) * dx)))

A python script version of this demo can be found `here <helmholtz.py>`__.
A python script version of this demo can be found :demo:`here <helmholtz.py>`.
4 changes: 2 additions & 2 deletions demos/immersed_fem/immersed_fem.py.rst
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ between parts of the mesh (see the concrete example at the end of this page).
Physical Surface("Disc", 4) = {2};
For simplicity, we have gathered all this commands in the file
`immersed_domain.geo <immersed_domain.geo>`__. To generate a mesh using this file,
:demo:`immersed_domain.geo <immersed_domain.geo>`. To generate a mesh using this file,
you can type the following command in the terminal

.. code-block:: none
Expand Down Expand Up @@ -160,4 +160,4 @@ using linear Lagrangian finite elements. ::
# solve the variational problem
solve(a == L, u, bcs=DirBC, solver_parameters={'ksp_type': 'cg'})

A python script version of this demo can be found `here <immersed_fem.py>`__.
A python script version of this demo can be found :demo:`here <immersed_fem.py>`.
2 changes: 1 addition & 1 deletion demos/linear-wave-equation/linear_wave_equation.py.rst
Original file line number Diff line number Diff line change
Expand Up @@ -149,4 +149,4 @@ visualising the results Paraview will use it::
An animation, produced in Paraview, illustrating the output of this simulation can be found `on youtube <https://www.youtube.com/watch?v=xhxvM1N8mDQ>`_.


A python script version of this demo can be found `here <linear_wave_equation.py>`__. The gmsh input file is `here <wave_tank.geo>`__.
A python script version of this demo can be found :demo:`here <linear_wave_equation.py>`. The gmsh input file is :demo:`here <wave_tank.geo>`.
Original file line number Diff line number Diff line change
Expand Up @@ -330,9 +330,9 @@ The result of the computation, visualised with `paraview <http://www.paraview.or
The mesh is deflected for visualization only. As the model is linear, the actual mesh used for computation is fixed. Colours indicate values of the flow potential :math:`\phi`.


A python script version of this demo can be found `here <linear_fluid_structure_interaction.py>`__.
A python script version of this demo can be found :demo:`here <linear_fluid_structure_interaction.py>`.

The mesh file is `here <L_domain.msh>`__. It can be generated with `gmsh <http://gmsh.info/>`__ from `this file <L_domain.geo>`__ with a command: gmsh -2 L_domain.geo.
The mesh file is :demo:`here <L_domain.msh>`. It can be generated with `gmsh <http://gmsh.info/>`__ from :demo:`this file <L_domain.geo>` with a command: gmsh -2 L_domain.geo.

An extended 3D version of this code is published `here <https://zenodo.org/record/1162196>`__.

Expand Down
4 changes: 2 additions & 2 deletions demos/ma-demo/ma-demo.py.rst
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,8 @@ An image of the solution is shown below.
.. figure:: ma.png
:align: center

A python script version of this demo can be found `here
<ma-demo.py>`__.
A python script version of this demo can be found :demo:`here
<ma-demo.py>`.

.. rubric:: References

Expand Down
2 changes: 1 addition & 1 deletion demos/matrix_free/navier_stokes.py.rst
Original file line number Diff line number Diff line change
Expand Up @@ -137,4 +137,4 @@ And finally we write the results to a file for visualisation. ::
File("cavity.pvd").write(u, p)

A runnable python script implementing this demo file is available
`here <navier_stokes.py>`__.
:demo:`here <navier_stokes.py>`.
4 changes: 2 additions & 2 deletions demos/matrix_free/poisson.py.rst
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,5 @@ Finally, we set the preconditioner type for the assembled operator::

"assembled_pc_type": "ilu"})

This demo is available as a runnable python file `here
<poisson.py>`__.
This demo is available as a runnable python file :demo:`here
<poisson.py>`.
2 changes: 1 addition & 1 deletion demos/matrix_free/rayleigh-benard.py.rst
Original file line number Diff line number Diff line change
Expand Up @@ -244,4 +244,4 @@ Finally, we'll output the results for visualisation. ::
File("benard.pvd").write(u, p, T)

A runnable python script implementing this demo file is available
`here <rayleigh-benard.py>`__.
:demo:`here <rayleigh-benard.py>`.
2 changes: 1 addition & 1 deletion demos/matrix_free/stokes.py.rst
Original file line number Diff line number Diff line change
Expand Up @@ -151,4 +151,4 @@ matrix using unpreconditioned conjugate gradients. ::
solve(a == L, up, bcs=bcs, nullspace=nullspace, solver_parameters=parameters)

A runnable python script implementing this demo file is available
`here <stokes.py>`__.
:demo:`here <stokes.py>`.
4 changes: 2 additions & 2 deletions demos/multigrid/geometric_multigrid.py.rst
Original file line number Diff line number Diff line change
Expand Up @@ -261,5 +261,5 @@ Finally, we'll write the solution for visualisation with Paraview. ::

File("stokes.pvd").write(u, p)

A runnable python version of this demo can be found `here
<geometric_multigrid.py>`__.
A runnable python version of this demo can be found :demo:`here
<geometric_multigrid.py>`.
2 changes: 1 addition & 1 deletion demos/nonlinear_QG_winddrivengyre/qg_winddrivengyre.py.rst
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ Below is a plot of the difference between the linear and nonlinear solutions to
.. figure:: fig_diff.png
:align: center

This demo can be found as a Python script in `qg_winddrivengyre.py <qg_winddrivengyre.py>`__.
This demo can be found as a Python script in :demo:`qg_winddrivengyre.py <qg_winddrivengyre.py>`.

.. rubric:: References

Expand Down
2 changes: 1 addition & 1 deletion demos/poisson/poisson_mixed.py.rst
Original file line number Diff line number Diff line change
Expand Up @@ -171,4 +171,4 @@ Don't forget to show the image::

This demo is based on the corresponding `DOLFIN mixed Poisson demo
<http://fenicsproject.org/olddocs/dolfin/1.3.0/python/demo/documented/mixed-poisson/python/documentation.html>`__
and can be found as a script in `poisson_mixed.py <poisson_mixed.py>`__.
and can be found as a script in :demo:`poisson_mixed.py <poisson_mixed.py>`.
2 changes: 1 addition & 1 deletion demos/quasigeostrophy_1layer/qg_1layer_wave.py.rst
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ execute the time loop. ::
v.project(gradperp(psi0))
output.write(q0, psi0, v, time=t)

A python script version of this demo can be found `here <qg_1layer_wave.py>`__.
A python script version of this demo can be found :demo:`here <qg_1layer_wave.py>`.

.. rubric:: References

Expand Down
4 changes: 2 additions & 2 deletions demos/saddle_point_pc/saddle_point_systems.py.rst
Original file line number Diff line number Diff line change
Expand Up @@ -612,8 +612,8 @@ geometric multigrid method with overlapping Schwarz smoothers (using
preconditioners ``AMS`` and ``ADS``. See the separate manual page on
:doc:`../preconditioning`.

A runnable python script version of this demo is available `here
<saddle_point_systems.py>`__.
A runnable python script version of this demo is available :demo:`here
<saddle_point_systems.py>`.

.. rubric:: References

Expand Down
6 changes: 6 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.extlinks',
'sphinx.ext.mathjax',
'sphinx.ext.intersphinx',
'sphinx.ext.viewcode',
Expand Down Expand Up @@ -361,3 +362,8 @@
bibtex_bibfiles = ['demos/demo_references.bib', '_static/bibliography.bib', '_static/firedrake-apps.bib', '_static/references.bib']

numpydoc_show_class_members = False

# -- Options for sphinx.ext.extlinks ------------------------------------
extlinks = {
'demo': ('https://firedrakeproject.org/demos/%s', None)
}

2 comments on commit 3f1b080

@amnchacon
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello, I'm trying to compile the example of Helmholtz via Linux Terminal, but it's not running, so you have the version on the terminal? someone could help me?

@connorjward
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello, I'm trying to compile the example of Helmholtz via Linux Terminal, but it's not running, so you have the version on the terminal? someone could help me?

Please open a GitHub discussion for this. When you do please include as much detail as possible about what you are doing/observing.

Please sign in to comment.