Skip to content

Commit c4a7799

Browse files
authored
move the 4th order reconstruction into mesh (#302)
this is consistent with the other reconstruction routines
1 parent 9f497fa commit c4a7799

File tree

5 files changed

+11
-9
lines changed

5 files changed

+11
-9
lines changed

examples/mesh/bc_demo.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
# test the boundary fill routine
22

33

4+
import numpy as np
5+
46
import pyro.mesh.boundary as bnd
57
import pyro.mesh.patch as patch
6-
import numpy as np
78

89

910
def doit():

pyro/advection_fv4/fluxes.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import pyro.mesh.array_indexer as ai
2-
from pyro.advection_fv4 import interface
2+
from pyro.mesh import fourth_order
33

44

55
def fluxes(my_data, rp):
@@ -72,13 +72,13 @@ def fluxes(my_data, rp):
7272
1./12.*(a.jp(-2, buf=1) + a.jp(1, buf=1))
7373

7474
else:
75-
a_l, a_r = interface.states(a, myg.ng, 1)
75+
a_l, a_r = fourth_order.states(a, myg.ng, 1)
7676
if u > 0:
7777
a_x = ai.ArrayIndexer(d=a_l, grid=myg)
7878
else:
7979
a_x = ai.ArrayIndexer(d=a_r, grid=myg)
8080

81-
a_l, a_r = interface.states(a, myg.ng, 2)
81+
a_l, a_r = fourth_order.states(a, myg.ng, 2)
8282
if v > 0:
8383
a_y = ai.ArrayIndexer(d=a_l, grid=myg)
8484
else:

pyro/compressible_fv4/fluxes.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@
44

55
import pyro.compressible as comp
66
import pyro.mesh.array_indexer as ai
7-
from pyro.advection_fv4 import interface
87
from pyro.compressible import riemann
9-
from pyro.mesh import reconstruction
8+
from pyro.mesh import fourth_order, reconstruction
109

1110

1211
def flux_cons(ivars, idir, gamma, q):
@@ -104,7 +103,7 @@ def fluxes(myd, rp, ivars):
104103

105104
else:
106105
for n in range(ivars.nq):
107-
q_l[:, :, n], q_r[:, :, n] = interface.states(q_avg[:, :, n], myg.ng, idir)
106+
q_l[:, :, n], q_r[:, :, n] = fourth_order.states(q_avg[:, :, n], myg.ng, idir)
108107

109108
# apply flattening
110109
for n in range(ivars.nq):

pyro/mesh/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
necessary to work with finite-volume data.
44
"""
55

6-
__all__ = ['patch', 'integration', 'reconstruction']
6+
__all__ = ['patch', 'fourth_order', 'integration', 'reconstruction']
77

88
from .array_indexer import ArrayIndexer, ArrayIndexerFC
99
from .boundary import BC, bc_is_solid, define_bc

pyro/advection_fv4/interface.py renamed to pyro/mesh/fourth_order.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
"""Reconstruction routines for 4th order finite-volume methods"""
2+
13
import numpy as np
24
from numba import njit
35

@@ -84,7 +86,7 @@ def states(a, ng, idir):
8486
# this lives on the interface
8587
d3a[i, j] = d2ac[i, j] - d2ac[i - 1, j]
8688

87-
# this is a look over cell centers, affecting
89+
# this is a loop over cell centers, affecting
8890
# i-1/2,R and i+1/2,L
8991
for i in range(ilo - 1, ihi + 1):
9092
for j in range(jlo - 1, jhi + 1):

0 commit comments

Comments
 (0)