Skip to content

Commit a517688

Browse files
author
Michael Zingale
committed
remove the hack of the runtime parameters living in the CellCenterData2d
object -- they now live in the Simulation object. Also initData -> init_data
1 parent 3647db4 commit a517688

19 files changed

Lines changed: 25 additions & 48 deletions

File tree

advection/advectiveFluxes.py

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

33
import mesh.reconstruction_f as reconstruction_f
44

5-
def unsplitFluxes(my_data, dt, scalar_name):
5+
def unsplitFluxes(my_data, rp, dt, scalar_name):
66
"""
77
Construct the fluxes through the interfaces for the linear advection
88
equation:
@@ -52,7 +52,6 @@ def unsplitFluxes(my_data, dt, scalar_name):
5252
"""
5353

5454
my_grid = my_data.grid
55-
rp = my_data.rp
5655

5756
a = my_data.get_var(scalar_name)
5857

advection/problems/smooth.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,11 @@
33
import numpy
44
from util import msg
55

6-
def initData(my_data):
6+
def init_data(my_data, rp):
77
""" initialize the smooth advection problem """
88

99
msg.bold("initializing the smooth advection problem...")
1010

11-
rp = my_data.rp
12-
1311
# make sure that we are passed a valid patch object
1412
if not isinstance(my_data, patch.CellCenterData2d):
1513
print "ERROR: patch invalid in smooth.py"

advection/problems/tophat.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import numpy
44
from util import msg
55

6-
def initData(my_data):
6+
def init_data(my_data, rp):
77
""" initialize the tophat advection problem """
88

99
msg.bold("initializing the tophat advection problem...")

advection/simulation.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def initialize(self):
5252
bc = patch.BCObject(xlb=xlb_type, xrb=xrb_type,
5353
ylb=ylb_type, yrb=yrb_type)
5454

55-
my_data = patch.CellCenterData2d(my_grid, runtime_parameters=self.rp)
55+
my_data = patch.CellCenterData2d(my_grid)
5656

5757
my_data.register_var("density", bc)
5858

@@ -61,7 +61,7 @@ def initialize(self):
6161
self.cc_data = my_data
6262

6363
# now set the initial conditions for the problem
64-
exec self.problem_name + '.initData(self.cc_data)'
64+
exec self.problem_name + '.init_data(self.cc_data, self.rp)'
6565

6666

6767
def timestep(self):
@@ -109,7 +109,7 @@ def evolve(self, dt):
109109
dtdx = dt/self.cc_data.grid.dx
110110
dtdy = dt/self.cc_data.grid.dy
111111

112-
flux_x, flux_y = unsplitFluxes(self.cc_data, dt, "density")
112+
flux_x, flux_y = unsplitFluxes(self.cc_data, self.rp, dt, "density")
113113

114114
"""
115115
do the differencing for the fluxes now. Here, we use slices so we

analysis/smooth_error.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def abort(string):
3939
analytic.create()
4040

4141
# use the original initialization routine to set the analytic solution
42-
smooth.initData(analytic)
42+
smooth.init_data(analytic, None)
4343

4444
# compare the error
4545
dens_numerical = myd.get_var("density")

compressible/problems/bubble.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,11 @@
33
import numpy
44
from util import msg
55

6-
def initData(my_data):
6+
def init_data(my_data, rp):
77
""" initialize the bubble problem """
88

99
msg.bold("initializing the bubble problem...")
1010

11-
rp = my_data.rp
12-
1311
# make sure that we are passed a valid patch object
1412
if not isinstance(my_data, patch.CellCenterData2d):
1513
print "ERROR: patch invalid in bubble.py"

compressible/problems/kh.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,11 @@
44
from util import msg
55
import math
66

7-
def initData(my_data):
7+
def init_data(my_data, rp):
88
""" initialize the Kelvin-Helmholtz problem """
99

1010
msg.bold("initializing the sedov problem...")
1111

12-
rp = my_data.rp
13-
1412
# make sure that we are passed a valid patch object
1513
if not isinstance(my_data, patch.CellCenterData2d):
1614
print my_data.__class__

compressible/problems/quad.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,11 @@
33
import numpy
44
from util import msg
55

6-
def initData(my_data):
6+
def init_data(my_data, rp):
77
""" initialize the quadrant problem """
88

99
msg.bold("initializing the quadrant problem...")
1010

11-
rp = my_data.rp
12-
1311
# make sure that we are passed a valid patch object
1412
if not isinstance(my_data, patch.CellCenterData2d):
1513
print "ERROR: patch invalid in quad.py"

compressible/problems/rt.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,11 @@
55
import mesh.patch as patch
66
from util import msg
77

8-
def initData(my_data):
8+
def init_data(my_data, rp):
99
""" initialize the rt problem """
1010

1111
msg.bold("initializing the rt problem...")
1212

13-
rp = my_data.rp
14-
1513
# make sure that we are passed a valid patch object
1614
if not isinstance(my_data, patch.CellCenterData2d):
1715
print "ERROR: patch invalid in rt.py"

compressible/problems/sedov.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,11 @@
44
from util import msg
55
import math
66

7-
def initData(my_data):
7+
def init_data(my_data, rp):
88
""" initialize the sedov problem """
99

1010
msg.bold("initializing the sedov problem...")
1111

12-
rp = my_data.rp
13-
1412
# make sure that we are passed a valid patch object
1513
if not isinstance(my_data, patch.CellCenterData2d):
1614
print "ERROR: patch invalid in sedov.py"

0 commit comments

Comments
 (0)