Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test(show=False):
geo = dmsh.Translation(dmsh.Rectangle(-1.0, +2.0, -1.0, +1.0), [1.0, 1.0])
X, cells = dmsh.generate(geo, 0.1, show=show)
ref_norms = [1.7525e03, 5.5677444529404333e01, 3.0]
assert_norm_equality(X.flatten(), ref_norms, 1.0e-10)
def test(h0=0.9, show=True):
geo = dmsh.Translation(dmsh.Rectangle(-1.0, +2.0, -1.0, +1.0), [1.0, 1.0])
X, cells = dmsh.generate(geo, h0, show=show)
assert numpy.array_equal(
cells,
[
[4, 3, 0],
[3, 4, 6],
[1, 4, 0],
[5, 1, 2],
[1, 5, 4],
[4, 7, 6],
[7, 5, 8],
[5, 7, 4],
],
), cells