def test(show=False): geo = dmsh.Rotation(dmsh.Rectangle(-1.0, +2.0, -1.0, +1.0), 0.1 * numpy.pi) X, cells = dmsh.generate(geo, 0.1, show=show, tol=1.0e-10) ref_norms = [9.5457720168192884e+02, 3.1356929329612782e+01, 2.2111300269652543e+00] assert_norm_equality(X.flatten(), ref_norms, 1.0e-12) return X, cells
def test(show=False): geo = dmsh.Rotation(dmsh.Rectangle(-1.0, +2.0, -1.0, +1.0), 0.1 * numpy.pi) X, cells = dmsh.generate(geo, 0.1, show=show, tol=1.0e-10) ref_norms = [ 9.5352192763033452e02, 3.1344318120314945e01, 2.2111300269652543e00 ] assert_norm_equality(X.flatten(), ref_norms, 1.0e-10) return X, cells
def test(show=False): geo = dmsh.Rotation(dmsh.Rectangle(-1.0, +2.0, -1.0, +1.0), 0.1 * np.pi) X, cells = dmsh.generate(geo, 0.1, show=show, tol=1.0e-10, max_steps=100) ref_norms = [ 9.4730152857365385e02, 3.1160562530932285e01, 2.2111300269652543e00 ] assert_norm_equality(X.flatten(), ref_norms, 1.0e-10) return X, cells
] ) X, cells = dmsh.generate(geo, 0.1, tol=1.0e-10) save(X, cells, "intersection-three-circles.svg") geo = dmsh.Intersection( [ dmsh.HalfSpace(np.sqrt(0.5) * np.array([1.0, 1.0]), 0.0), dmsh.Circle([0.0, 0.0], 1.0), ] ) X, cells = dmsh.generate(geo, 0.1) save(X, cells, "intersection-circle-halfspace.svg") geo = dmsh.Rotation(dmsh.Rectangle(-1.0, +2.0, -1.0, +1.0), 0.1 * np.pi) X, cells = dmsh.generate(geo, 0.1, tol=1.0e-10) save(X, cells, "rotation.svg") geo = dmsh.Scaling(dmsh.Rectangle(-1.0, +2.0, -1.0, +1.0), 2.0) X, cells = dmsh.generate(geo, 0.1, tol=1.0e-5) save(X, cells, "scaling.svg") geo = dmsh.Rectangle(0.0, 1.0, 0.0, 1.0) p1 = dmsh.Path([[0.4, 0.6], [0.6, 0.4]]) X, cells = dmsh.generate(geo, edge_size=lambda x: 0.03 + 0.1 * p1.dist(x), tol=1.0e-10) save(X, cells, "local-refinement.svg")