Skip to content
Snippets Groups Projects
test_ntrfc_grid_convergence_index.py 609 B
Newer Older
Malte Nyhuis's avatar
Malte Nyhuis committed
def test_getgci():

Malte Nyhuis's avatar
Malte Nyhuis committed
    from ntrfc.meshquality.grid_convergece_index import getGCI
    import numpy as np
    #
Malte Nyhuis's avatar
Malte Nyhuis committed
    fc3 = 23.263
    fc2 = 23.165
    fc1 = 23.151

    N3 = 18576
    N2 = 74304
    N1 = 297216
Malte Nyhuis's avatar
Malte Nyhuis committed
    Fs = 1.25
    D = 2

    GCI_1, GCI_2, GCI_3 = getGCI(N1, N2, N3, fc1, fc2, fc3, D, Fs=1.25)
Malte Nyhuis's avatar
Malte Nyhuis committed

    assert np.isclose(GCI_1,0.0001259844787122061), "GCI_1 computation does not seem to be correct"
    assert np.isclose(GCI_2,0.0008813583711057829), "GCI_3 computation does not seem to be correct"
    assert np.isclose(GCI_3,0.0061695085977409286), "GCI_3 computation does not seem to be correct"