MCPcopy
hub / github.com/tum-pbs/PhiFlow / test_implicit_stability

Method test_implicit_stability

tests/commit/physics/test_diffuse.py:57–66  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

55 field.assert_close(grid, back_explicit, back_implicit, back_fourier, rel_tolerance=0, abs_tolerance=0.1)
56
57 def test_implicit_stability(self):
58 DIFFUSIVITY = 10
59 grid = CenteredGrid((1,) * 3 + (0,) * 3, extrapolation.PERIODIC, x=21)
60 try:
61 implicit = diffuse.implicit(grid, DIFFUSIVITY, 1)
62 print(implicit.values)
63 field.assert_close(0 <= implicit <= 1.0001, True)
64 except NotConverged as err:
65 print(err)
66 pass # solve_linear did not converge
67
68 def test_explicit_centered_non_isotropic(self):
69 grid = CenteredGrid(wrap([[0, 0, 0], [0, 1, 0], [0, 0, 0]], spatial('x,y')), 0)

Callers

nothing calls this directly

Calls 1

CenteredGridFunction · 0.90

Tested by

no test coverage detected