Skip to content

Commit 2276093

Browse files
authored
the 4th order solvers are only guaranteed to work with square cells (#340)
this asserts that
1 parent 71132d6 commit 2276093

File tree

2 files changed

+56
-49
lines changed

2 files changed

+56
-49
lines changed

pyro/compressible_fv4/simulation.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import numpy as np
2+
13
import pyro.compressible_fv4.fluxes as flx
24
from pyro import compressible_rk
35
from pyro.compressible import get_external_sources, get_sponge_factor
@@ -70,6 +72,9 @@ def preevolve(self):
7072
this solver assumes that the initialization was done to
7173
cell-centers and converts it to cell-averages."""
7274

75+
# this should only work for dx == dy
76+
assert np.abs(self.cc_data.grid.dx - self.cc_data.grid.dy) < 1.e-12 * self.cc_data.grid.dx, "grid cells need to be square"
77+
7378
# we just initialized cell-centers, but we need to store averages
7479
for var in self.cc_data.names:
7580
self.cc_data.from_centers(var)

pyro/solver-test.ipynb

Lines changed: 51 additions & 49 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)