Пример #1
0
def test4():
    n = 3 ; p = 2
    geo = periodic_square(n=[n,n], p=[p,p])
    geo_ref, list_lmatrices = geo.bezier_extract()
    from scipy.io import mmwrite
    M = list_lmatrices[0][0]
    mmwrite("M_conversion_test_4.mtx", M)
Пример #2
0
def test4():
    n = 3
    p = 2
    geo = periodic_square(n=[n, n], p=[p, p])
    geo_ref, list_lmatrices = geo.bezier_extract()
    from scipy.io import mmwrite
    M = list_lmatrices[0][0]
    mmwrite("M_conversion_test_4.mtx", M)
Пример #3
0
def test5():
    # ... number of elemens
    n = 4

    # ... k is the b-spline order
    k = 3

    # ...
    print ("==== connectivity on a periodic square ====")
    geo2d = periodic_square(n=[n-1,n-1], p=[k-1,k-1])
    con2d = connectivity(geo2d)
    con2d.init_data_structure()

    con2d.printinfo()
    print ("==========================================")
Пример #4
0
def test5():
    # ... number of elemens
    n = 4

    # ... k is the b-spline order
    k = 3

    # ...
    print("==== connectivity on a periodic square ====")
    geo2d = periodic_square(n=[n - 1, n - 1], p=[k - 1, k - 1])
    con2d = connectivity(geo2d)
    con2d.init_data_structure()

    con2d.printinfo()
    print("==========================================")
Пример #5
0
def test5():
    print("====== test 5  =====")
#    nx = 3 ; px = 2
#    ny = 3 ; py = 2
#    nx = 7 ; px = 2
#    ny = 7 ; py = 2
#    nx = 15 ; px = 2
#    ny = 15 ; py = 2
#    nx = 31 ; px = 2
#    ny = 31 ; py = 2
#    nx = 63 ; px = 2
#    ny = 63 ; py = 2
#    nx = 3 ; px = 3
#    ny = 3 ; py = 3
#    nx = 7 ; px = 3
#    ny = 7 ; py = 3
#    nx = 15 ; px = 3
#    ny = 15 ; py = 3
#    nx = 31 ; px = 3
#    ny = 31 ; py = 3
#    nx = 63 ; px = 3
#    ny = 63 ; py = 3
#    nx = 3 ; px = 4
#    ny = 3 ; py = 4
#    nx = 7 ; px = 4
#    ny = 7 ; py = 4
#    nx = 15 ; px = 4
#    ny = 15 ; py = 4
#    nx = 31 ; px = 4
#    ny = 31 ; py = 4
#    nx = 63 ; px = 4
#    ny = 63 ; py = 4
#    nx = 3 ; px = 5
#    ny = 3 ; py = 5
#    nx = 7 ; px = 5
#    ny = 7 ; py = 5
    nx = 15 ; px = 5
    ny = 15 ; py = 5
#    nx = 31 ; px = 5
#    ny = 31 ; py = 5
#    nx = 63 ; px = 5
#    ny = 63 ; py = 5

#    geo = square(n=[nx, ny], p=[px, py])
    geo = periodic_square(n=[nx, ny], p=[px, py])

    basis_only = False
    #basis_only = True

    basename = "splines"
    #basename = None

    dirname  = "tmp"
    #dirname  = None

    import os
    os.system("mkdir -p " + dirname)

    from caid.io import BZR
    rw = BZR()
    rw.write(geo, fmt="txt", basename=basename, dirname=dirname, basis_only=basis_only)