How to use the dmsh.Rotation function in dmsh

To help you get started, we’ve selected a few dmsh examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github nschloe / dmsh / test / test_rotation.py View on Github external
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
github nschloe / dmsh / test / test_rotate.py View on Github external
def test(h0=0.9, show=True):
    geo = dmsh.Rotation(dmsh.Rectangle(-1.0, +2.0, -1.0, +1.0), 0.1 * numpy.pi)
    X, cells = dmsh.generate(geo, h0, show=show)

    assert numpy.array_equal(
        cells, [[6, 3, 4], [3, 5, 2], [5, 3, 6], [0, 3, 2], [3, 1, 4], [0, 1, 3]]
    ), cells

    assert_norm_equality(
        X.flatten(),
        [1.2993750765965753e+01, 4.0926763862103552e+00, 2.2111300269652543e+00],
        1.0e-12,
    )
    return