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.Difference(
dmsh.Rectangle(0.0, 5.0, 0.0, 5.0),
dmsh.Polygon([[1, 1], [4, 1], [4, 4], [1, 4]]),
)
X, cells = dmsh.generate(geo, 1.0, show=show, tol=1.0e-3)
ref_norms = [1.4000000000000000e02, 2.3176757306973560e01, 5.0000000000000000e00]
assert_norm_equality(X.flatten(), ref_norms, 1.0e-10)
def test(show=False):
geo = dmsh.Polygon(
[
[0.0, 0.0],
[1.1, 0.0],
[1.2, 0.5],
[0.7, 0.6],
[2.0, 1.0],
[1.0, 2.0],
[0.5, 1.5],
]
)
X, cells = dmsh.generate(geo, 0.1, show=show)
ref_norms = [4.1468030858462305e+02, 2.1861920662017866e+01, 2.0]
assert_norm_equality(X.flatten(), ref_norms, 1.0e-5)
return X, cells
def test_pacman(show=False):
geo = dmsh.Difference(
dmsh.Circle([0.0, 0.0], 1.0),
dmsh.Polygon([[0.0, 0.0], [1.5, 0.4], [1.5, -0.4]]),
)
X, cells = dmsh.generate(geo, 0.1, show=show, tol=1.0e-10)
ref_norms = [3.0385105041432689e02, 1.3644964912810719e01, 1.0]
assert_norm_equality(X.flatten(), ref_norms, 1.0e-10)
return X, cells