Skip to content

Commit b4f7d0d

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 2245540 commit b4f7d0d

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

tests/test_eb.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,12 @@ def test_makeEBFabFactory():
1212
max_grid_size = 16
1313

1414
# Build Geometry
15-
domain = amr.Box(amr.IntVect(0,0,0), amr.IntVect(n_cell-1, n_cell-1, n_cell-1))
16-
real_box = amr.RealBox([0., 0., 0.], [1. , 1., 1.])
15+
domain = amr.Box(
16+
amr.IntVect(0, 0, 0), amr.IntVect(n_cell - 1, n_cell - 1, n_cell - 1)
17+
)
18+
real_box = amr.RealBox([0.0, 0.0, 0.0], [1.0, 1.0, 1.0])
1719
coord = 0 # Cartesian
18-
is_per = [1, 1, 1] # is periodic?
20+
is_per = [1, 1, 1] # is periodic?
1921
geom = amr.Geometry(domain, real_box, coord, is_per)
2022

2123
# EB parameters
@@ -39,13 +41,13 @@ def test_makeEBFabFactory():
3941
dm = amr.DistributionMapping(ba)
4042

4143
# Make EB Factory
42-
ng = amr.Vector_int([1,1,1])
44+
ng = amr.Vector_int([1, 1, 1])
4345
factory = amr.makeEBFabFactory(geom, ba, dm, ng, amr.EBSupport.full)
4446

4547
# Get EB data
4648
vfrac = factory.getVolFrac()
4749

4850
dx = geom.data().CellSize()
49-
total_vol = vfrac.sum()*dx[0]*dx[1]*dx[2]
50-
sphere_vol = 4./3.*numpy.pi*rsphere**3
51-
assert abs(sphere_vol-total_vol)/sphere_vol < 2.e-3
51+
total_vol = vfrac.sum() * dx[0] * dx[1] * dx[2]
52+
sphere_vol = 4.0 / 3.0 * numpy.pi * rsphere**3
53+
assert abs(sphere_vol - total_vol) / sphere_vol < 2.0e-3

0 commit comments

Comments
 (0)