Skip to content

Commit

Permalink
tweak orders and enable asserts
Browse files Browse the repository at this point in the history
  • Loading branch information
alexfikl committed Aug 19, 2021
1 parent d50ace6 commit 1c7fd49
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions test/test_stokes.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,14 +267,13 @@ def test_exterior_stokes(actx_factory, ambient_dim, visualize=False):
eocs = [EOCRecorder() for _ in range(ambient_dim)]

target_order = 5
source_ovsmp = 4
qbx_order = 3

if ambient_dim == 2:
resolutions = [20, 35, 50]
source_ovsmp = 4
elif ambient_dim == 3:
resolutions = [0, 1, 2]
source_ovsmp = 4
else:
raise ValueError(f"unsupported dimension: {ambient_dim}")

Expand All @@ -298,10 +297,11 @@ def test_exterior_stokes(actx_factory, ambient_dim, visualize=False):
error_format="%.8e",
eoc_format="%.2f"))

# This convergence data is not as clean as it could be. See
# https://github.com/inducer/pytential/pull/32
# for some discussion.
assert eoc.order_estimate() > target_order - 0.5
# This convergence data is not as clean as it could be. See
# https://github.com/inducer/pytential/pull/32
# for some discussion.
order = min(target_order, qbx_order)
assert eoc.order_estimate() > order - 0.5

# }}}

Expand Down Expand Up @@ -422,9 +422,8 @@ def test_stokeslet_identity(actx_factory, cls, visualize=False):
if visualize:
logging.basicConfig(level=logging.INFO)

source_ovsmp = 4 if cls.func.ambient_dim == 2 else 4
case = cls(fmm_backend=None, fmm_tol=None,
target_order=5, qbx_order=3, source_ovsmp=source_ovsmp)
target_order=5, qbx_order=3, source_ovsmp=4)
identity = StokesletIdentity(case.ambient_dim)
logger.info("\n%s", str(case))

Expand All @@ -448,7 +447,8 @@ def test_stokeslet_identity(actx_factory, cls, visualize=False):
error_format="%.8e",
eoc_format="%.2f"))

# assert eoc.order_estimate() > case.target_order - 0.5
order = min(case.target_order, case.qbx_order)
assert eoc.order_estimate() > order - 0.5

# }}}

Expand Down Expand Up @@ -481,9 +481,8 @@ def test_stresslet_identity(actx_factory, cls, visualize=False):
if visualize:
logging.basicConfig(level=logging.INFO)

source_ovsmp = 4 if cls.func.ambient_dim == 2 else 4
case = cls(fmm_backend=None,
target_order=3, qbx_order=3, source_ovsmp=source_ovsmp)
target_order=5, qbx_order=3, source_ovsmp=4)
identity = StressletIdentity(case.ambient_dim)
logger.info("\n%s", str(case))

Expand All @@ -507,7 +506,8 @@ def test_stresslet_identity(actx_factory, cls, visualize=False):
error_format="%.8e",
eoc_format="%.2f"))

# assert eoc.order_estimate() > case.target_order - 0.5
order = min(case.target_order, case.qbx_order)
assert eoc.order_estimate() > order - 0.5

# }}}

Expand Down

0 comments on commit 1c7fd49

Please sign in to comment.