Skip to content

Commit 1ce68fb

Browse files
IanHawkezingale
authored andcommitted
Sphinx docs check (#34)
* Documentation tweaks. Mostly minor typos and grammar fixes. In the installation instructions, removed a duplication f2py entry. * One more tiny typo in docs. * Remove mention of Jupyter notebook. As the notebook is auto-included in the documentation immediately after. * In multigrid docs, complete intro to link to numerical_exercises notes
1 parent 1b396c7 commit 1ce68fb

10 files changed

Lines changed: 20 additions & 34 deletions

docs/source/compressible_basics.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ The equations of compressible hydrodynamics take the form:
77
88
\frac{\partial \rho}{\partial t} + \nabla \cdot (\rho U) &= 0 \\
99
\frac{\partial (\rho U)}{\partial t} + \nabla \cdot (\rho U U) + \nabla p &= \rho g \\
10-
\frac{\partial (\rho E)}{\partial t} + \nabla \cdot [(\rho E + p ) U] &= \rho U \cdot g
10+
\frac{\partial (\rho E)}{\partial t} + \nabla \cdot [(\rho E + p ) U] &= \rho U \cdot g
1111
1212
with :math:`\rho E = \rho e + \frac{1}{2} \rho |U|^2` and :math:`p = p(\rho, e)`.
1313

@@ -26,7 +26,7 @@ pyro has several compressible solvers:
2626

2727
The implementations here have flattening at shocks, artificial
2828
viscosity, a simple gamma-law equation of state, and (in some cases) a
29-
choice Riemann solvers. Optional constant gravity in the vertical
29+
choice of Riemann solvers. Optional constant gravity in the vertical
3030
direction is allowed.
3131

3232
The main parameters that affect this solver are:
@@ -164,7 +164,7 @@ quad
164164

165165
The quad problem sets up different states in four regions of the
166166
domain and watches the complex interfaces that develop as shocks
167-
interact. This problem has appear in several places (and a `detailed
167+
interact. This problem has appeared in several places (and a `detailed
168168
investigation
169169
<http://planets.utsc.utoronto.ca/~pawel/Riemann.hydro.html>`_ is
170170
online by Pawel Artymowicz). It is run as:
@@ -250,7 +250,7 @@ Extensions
250250
sedov explosion instead of the cylindrical explosion.
251251

252252
* Swap the piecewise linear reconstruction for piecewise parabolic
253-
(PPM). The notes and Miller and Colella paper provide a good basis
253+
(PPM). The notes and the Miller and Colella paper provide a good basis
254254
for this. Research the Roe Riemann solver and implement it in pyro.
255255

256256

docs/source/design.rst

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ Fortran
9494
-------
9595

9696
Fortran is used to speed up some critical portions of the code, and in
97-
often cases, provides more clarity than trying to write optimized
97+
many cases, provides more clarity than trying to write optimized
9898
python code using array operations in numpy. The Fortran code
9999
seemlessly integrates into python using f2py.
100100

@@ -165,5 +165,3 @@ inheritance is used, so many of these methods come from the base
165165
* ``write_extras``: any solver-specific writing
166166

167167
Each problem setup needs only provide an ``init_data()`` function that fills the data in the patch object.
168-
169-

docs/source/incompressible_basics.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Incompressible hydrodynamics solver
44
pyro's incompressible solver solves:
55

66
.. math::
7-
7+
88
\frac{\partial U}{\partial t} + U \cdot \nabla U + \nabla p &= 0 \\
99
\nabla \cdot U &= 0
1010
@@ -43,7 +43,7 @@ we are using an approximate projection.
4343
convergence
4444
^^^^^^^^^^^
4545

46-
The convergence test initialize a simple velocity field on a periodic
46+
The convergence test initializes a simple velocity field on a periodic
4747
unit square with known analytic solution. By evolving at a variety of
4848
resolutions and comparing to the analytic solution, we can measure the
4949
convergence rate of the algorithm. The particular set of initial
@@ -105,4 +105,3 @@ hydrodynamics code <http://amrex-astro.github.io/MAESTRO/>`_. Maestro
105105
can do variable-density incompressible, anelastic, and low Mach number
106106
stratified flows in stellar (and terrestrial) environments in close
107107
hydrostatic equilibrium.
108-

docs/source/installation.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ The following python packages are required:
1313

1414
* ``numpy``
1515
* ``matplotlib``
16-
* ``f2py``
1716
* ``f2py`` (part of NumPy)
1817
* ``pytest`` (for unit tests)
1918

docs/source/intro.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ hydrodynamics solvers. It is designed to provide a tutorial for
88
students in computational astrophysics (and hydrodynamics in
99
general). We introduce simple implementations of some popular methods
1010
used in the field, with the code written to be easily
11-
understandable. All simulations use a single grid (no domain decomposition)
11+
understandable. All simulations use a single grid (no domain decomposition).
1212

13-
.. note::
13+
.. note::
1414

1515
pyro is not meant for demanding scientific simulations—given the
1616
choice between performance and clarity, clarity is taken.
@@ -37,7 +37,7 @@ Runtime visualization shows the evolution as the equations are solved.
3737
In the pages that follow, the following format is adopted:
3838

3939
* PDF notes provide the basic theory behind the methods. References
40-
are cited to provide more detail.
40+
are cited to provide more detail.
4141

4242
* An overview of the use of the applicable modules from pyro provided.
4343

docs/source/mesh_basics.rst

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ There are several main objects in the patch class that we interact with:
5555
class that subclasses the NumPy ndarray and makes the data in the
5656
array know about the details of the grid it is defined on. In
5757
particular, it knows which cells are valid and which are the ghost
58-
cells, and it has methods to do the ai+1,j operations that are
58+
cells, and it has methods to do the :math:`a_{i+1,j}` operations that are
5959
common in difference methods.
6060

6161
* :func:`integration.RKIntegrator <mesh.integration.RKIntegrator>`:
@@ -110,6 +110,3 @@ The actual filling of the boundary conditions is done by the ``fill_BC()``
110110
method. The script ``bc_demo.py`` tests the various types of boundary
111111
conditions by initializing a small grid with sequential data, filling
112112
the BCs, and printing out the results.
113-
114-
115-

docs/source/multigrid_basics.rst

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Multigrid solvers
44
pyro solves elliptic problems (like Laplace's equation or Poisson's
55
equation) through multigrid. This accelerates the convergence of
66
simple relaxation by moving the solution down and up through a series
7-
of grids. Chapter
7+
of grids. Chapter 9 of the `pdf notes<http://bender.astro.sunysb.edu/hydro_by_example/CompHydroTutorial.pdf>`_ gives an introduction to solving elliptic equations, including multigrid.
88

99
There are three solvers:
1010

@@ -17,10 +17,10 @@ There are three solvers:
1717
* The class :func:`general_MG.GeneralMG2d <multigrid.general_MG.GeneralMG2d>` solves a general elliptic
1818
equation of the form :math:`\alpha \phi + \nabla \cdot ( \beta
1919
\nabla \phi) + \gamma \cdot \nabla \phi = f`. This class inherits
20-
the core functionality from ``MG.CellCenterMG2d``.
20+
the core functionality from ``MG.CellCenterMG2d``.
2121

2222
This solver is the only one to support inhomogeneous boundary
23-
conditions.
23+
conditions.
2424

2525
We simply use V-cycles in our implementation, and restrict ourselves
2626
to square grids with zoning a power of 2.
@@ -40,12 +40,12 @@ A basic multigrid test is run as:
4040
4141
The ``mg_test_simple.py`` script solves a Poisson equation with a
4242
known analytic solution. This particular example comes from the text
43-
`A Multigrid Tutorial, 2nd Ed.`. The example is:
43+
`A Multigrid Tutorial, 2nd Ed.`, by Briggs. The example is:
4444

4545
.. math::
4646
4747
u_{xx} + u_{yy} = -2 \left [(1-6x^2)y^2(1-y^2) + (1-6y^2)x^2(1-x^2)\right ]
48-
48+
4949
on :math:`[0,1] \times [0,1]` with :math:`u = 0` on the boundary.
5050

5151
The solution to this is shown below.
@@ -113,10 +113,6 @@ results are shown below:
113113

114114
Left is the original u velocity, middle is the modified field after adding the gradient of the scalar, and right is the recovered field.
115115

116-
Jupyter Notebook
117-
----------------
118-
119-
A jupyter notebook showing how to use the basic solver can be found here: multigrid-examples.ipynb
120116

121117
Exercises
122118
---------

docs/source/output.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Several simply utilities exist to operate on output files
1717
1818
./compare.py shear_128_0216.pyro incompressible/tests/shear_128_0216.pyro
1919
20-
Differences on the order of machine precision are may arise because
20+
Differences on the order of machine precision may arise because
2121
of optimizations and compiler differences across platforms. Students
2222
should familiarize themselves with the details of how computers
2323
store numbers (floating point). An excellent read is `What every

docs/source/problems.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Adding a problem
22
================
33

44
The easiest way to add a problem is to copy an existing problem setup
5-
in the solver you wish to use (in its problems/ sub-directory. Three
5+
in the solver you wish to use (in its problems/ sub-directory). Three
66
different files will need to be copied (created):
77

88
* ``problem.py``: this is the main initialization routine. The
@@ -25,4 +25,3 @@ different files will need to be copied (created):
2525
problem is defined, you need to add the problem name to the
2626
``__all__`` list in the ``__init__.py`` file in the ``problems/``
2727
sub-directory. This lets python know about the problem.
28-

docs/source/running.rst

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ For example, to run the Sedov problem with the compressible solver we would do:
1616
This knows to look for ``inputs.sedov`` in ``compressible/problems/``
1717
(alternately, you can specify the full path for the inputs file).
1818

19-
To run the smooth Gaussin advection problem with the advection solver, we would do:
19+
To run the smooth Gaussian advection problem with the advection solver, we would do:
2020

2121
.. code-block:: none
2222
@@ -50,7 +50,7 @@ parameters are stored in three places:
5050
* the ``pyro/_defaults`` file
5151
* the solver's ``_defaults`` file
5252
* problem's ``_defaults`` file (named ``_problem-name.defaults`` in the
53-
solver's ``problem/`` sub-directory).
53+
solver's ``problem/`` sub-directory).
5454

5555
These three files are parsed at runtime to define the list of valid
5656
parameters. The inputs file is read next and used to override the
@@ -135,5 +135,3 @@ All solvers use the following parameters:
135135
+---------------------+---------------------------------------------------------------------------------------------------------+
136136
|``ny`` | the number zones in the y-direction |
137137
+---------------------+---------------------------------------------------------------------------------------------------------+
138-
139-

0 commit comments

Comments
 (0)