Skip to content

Commit 98b0007

Browse files
committed
Updated documentation to include interface.py in the API
1 parent 17b50f4 commit 98b0007

38 files changed

Lines changed: 1044 additions & 348 deletions

advection/advective_fluxes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33

44
def unsplit_fluxes(my_data, rp, dt, scalar_name):
5-
"""
5+
r"""
66
Construct the fluxes through the interfaces for the linear advection
77
equation:
88

advection_fv4/fluxes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44

55
def fluxes(my_data, rp, dt):
6-
"""Construct the fluxes through the interfaces for the linear advection
6+
r"""Construct the fluxes through the interfaces for the linear advection
77
equation:
88
99
.. math::

advection_fv4/interface.py

Lines changed: 57 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,32 @@
44

55
@njit(cache=True)
66
def states(a, qx, qy, ng, idir):
7+
r"""
8+
Predict the cell-centered state to the edges in one-dimension using the
9+
reconstructed, limited slopes. We use a fourth-order Godunov method.
10+
11+
Our convention here is that:
12+
13+
``al[i,j]`` will be :math:`al_{i-1/2,j}`,
14+
15+
``al[i+1,j]`` will be :math:`al_{i+1/2,j}`.
16+
17+
Parameters
18+
----------
19+
a : ndarray
20+
The cell-centered state.
21+
qx, qy : int
22+
The dimensions of `a`.
23+
ng : int
24+
The number of ghost cells
25+
idir : int
26+
Are we predicting to the edges in the x-direction (1) or y-direction (2)?
27+
28+
Returns
29+
-------
30+
out : ndarray, ndarray
31+
The state predicted to the left and right edges.
32+
"""
733

834
al = np.zeros((qx, qy))
935
ar = np.zeros((qx, qy))
@@ -21,13 +47,9 @@ def states(a, qx, qy, ng, idir):
2147
nx = qx - 2 * ng
2248
ny = qy - 2 * ng
2349
ilo = ng
24-
ihi = ng + nx - 1
50+
ihi = ng + nx
2551
jlo = ng
26-
jhi = ng + ny - 1
27-
28-
# our convention here is that:
29-
# al[i,j] will be al_{i-1/2,j),
30-
# al[i+1,j] will be al_{i+1/2,j)
52+
jhi = ng + ny
3153

3254
# we need interface values on all faces of the domain
3355
if (idir == 1):
@@ -213,6 +235,33 @@ def states(a, qx, qy, ng, idir):
213235

214236
@njit(cache=True)
215237
def states_nolimit(a, qx, qy, ng, idir):
238+
r"""
239+
Predict the cell-centered state to the edges in one-dimension using the
240+
reconstructed slopes (and without slope limiting). We use a fourth-order
241+
Godunov method.
242+
243+
Our convention here is that:
244+
245+
``al[i,j]`` will be :math:`al_{i-1/2,j}`,
246+
247+
``al[i+1,j]`` will be :math:`al_{i+1/2,j}`.
248+
249+
Parameters
250+
----------
251+
a : ndarray
252+
The cell-centered state.
253+
qx, qy : int
254+
The dimensions of `a`.
255+
ng : int
256+
The number of ghost cells
257+
idir : int
258+
Are we predicting to the edges in the x-direction (1) or y-direction (2)?
259+
260+
Returns
261+
-------
262+
out : ndarray, ndarray
263+
The state predicted to the left and right edges.
264+
"""
216265

217266
a_int = np.zeros((qx, qy))
218267
al = np.zeros((qx, qy))
@@ -221,13 +270,9 @@ def states_nolimit(a, qx, qy, ng, idir):
221270
nx = qx - 2 * ng
222271
ny = qy - 2 * ng
223272
ilo = ng
224-
ihi = ng + nx - 1
273+
ihi = ng + nx
225274
jlo = ng
226-
jhi = ng + ny - 1
227-
228-
# our convention here is that:
229-
# al[i,j] will be al_{i-1/2,j),
230-
# al[i+1,j] will be al_{i+1/2,j)
275+
jhi = ng + ny
231276

232277
# we need interface values on all faces of the domain
233278
if (idir == 1):

0 commit comments

Comments
 (0)