Пример #1
0
def test_cvt_qnb(mesh, ref1, ref2, refi):
    X, cells = mesh()

    X, cells = optimesh.cvt.quasi_newton_uniform_blocks(X, cells, 1.0e-2, 100)

    # Assert that we're dealing with the mesh we expect.
    helpers.assert_norms(X, [ref1, ref2, refi], 1.0e-12)
    return
Пример #2
0
def test_cvt_lloyd2(mesh, ref1, ref2, refi):
    X, cells = mesh()
    X, cells = optimesh.cvt.quasi_newton_uniform_lloyd(X,
                                                       cells,
                                                       1.0e-2,
                                                       100,
                                                       omega=2.0)
    helpers.assert_norms(X, [ref1, ref2, refi], 1.0e-12)
Пример #3
0
def test_cvt_qnf(mesh, ref1, ref2, refi):
    X, cells = mesh()
    X, cells = optimesh.cvt.quasi_newton_uniform_full(X,
                                                      cells,
                                                      1.0e-2,
                                                      100,
                                                      omega=0.9)

    import meshplex

    mesh = meshplex.MeshTri(X, cells)
    mesh.show()

    # Assert that we're dealing with the mesh we expect.
    helpers.assert_norms(X, [ref1, ref2, refi], 1.0e-12)
Пример #4
0
def test_cvt_qnb(mesh, ref1, ref2, refi):
    X, cells = mesh()
    X, cells = optimesh.cvt.quasi_newton_uniform_blocks(X, cells, 1.0e-2, 100)
    helpers.assert_norms(X, [ref1, ref2, refi], 1.0e-10)