Beispiel #1
0
def test_writere2_3d():
    import pymech.neksuite as ns

    fin = './tests/nek/box3d.re2'
    fout = './test_2.re2'
    mesh = ns.readre2(fin)
    status = ns.writere2(fout, mesh)

    assert status == 0

    meshw = ns.readre2(fout)

    assert meshw.ndim == mesh.ndim
    assert meshw.nel == mesh.nel
    assert meshw.ncurv == mesh.ncurv
    assert meshw.nbc == mesh.nbc
    assert meshw.var == mesh.var
    assert meshw.lr1 == mesh.lr1
    assert meshw.wdsz == 8
    for (el, elw) in zip(mesh.elem, meshw.elem):
        npt.assert_array_equal(elw.pos, el.pos)
        npt.assert_array_equal(elw.bcs, el.bcs)
        npt.assert_array_equal(elw.curv, el.curv)
        npt.assert_array_equal(elw.ccurv, el.ccurv)
Beispiel #2
0
    xyzline = mst.lim_polyg(mesh2D, ielsplit, iedge0)
    funpar[ifun] = xyzline

fun=[mst.fun_polyg, mst.fun_polyg, mst.fun_polyg, mst.fun_polyg]
zlist = mst.define_z(z,n)
mesh3D = mst.extrude_split(mesh2D, zlist, bc1, bc2, fun, funpar, imesh_high)

##Input parameters 2
#z = [-1.0,1.0]
#n = 4
#bc1='v'
#bc2='O'
#imesh_high=0
#funpar=[0.01]
#fun_line = lambda xpos, ypos, rlim: ypos/rlim - 1.0
#fun=[fun_line]
#
#zlist = mst.define_z([-1.0,1.0,0.03],16,'gpdzn')
#mesh3D = mst.extrude_split(mesh2D, zlist, bc1, bc2, fun, funpar, imesh_high)
#
#z0=z[0]
#ble = 10.0 # sweep angle (degrees) at the leading edge (positive is converging for increasing z)
#bte = 20.0 # sweep angle (degrees) at the trailing edge (positive is converging for increasing z)
#dih = 10.0 # dihedral angle (degrees) at the trailing edge
#mesh3D = mst.taper(mesh3D, ble, bte, dih)

ns.writerea(fnameO+'.rea',mesh3D)
ns.writere2(fnameO+'.re2',mesh3D)

print('End of the program')