How to use the dmsh.Translation 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_translation.py View on Github external
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)
github nschloe / dmsh / test / test_translate.py View on Github external
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