Beispiel #1
0
    y = t * t + 1 + u * u
    z = u
    return (x, y, z)


# surface grid
a = D.surface(f, N=50)
b = T.splitSize(a, 100)
b = X.connectMatch(b, dim=2)
t = C.newPyTree(['Surface', 2])
t[2][1][2] += b
t = C.initVars(t, 'F', 1.)
t = C.initVars(t, 'centers:G', 2.)
t[2][1][2][0] = C.addBC2Zone(t[2][1][2][0], 'overlap', 'BCOverlap', 'imin')
t = C.fillEmptyBCWith(t, 'wall', 'BCWall', dim=2)
b = T.merge(t)
t2 = C.newPyTree(['Surface', 2])
t2[2][1][2] += b
test.testT(t2, 1)
b = T.merge(t, alphaRef=45.)
t2 = C.newPyTree(['Surface', 2])
t2[2][1][2] = b
test.testT(t2, 2)
#
# cas d'angles vifs
#
a1 = G.cart((0, 0, 0), (1, 1, 1), (11, 11, 1))
a3 = G.cart((10, 0, 0), (1, 1, 1), (11, 11, 1))
a2 = T.rotate(a1, (0, 0, 0), (1, 0, 0), 90.)
a2 = T.reorder(a2, (-1, 2, 3))
a2[0] = C.getZoneName(a1[0])
Beispiel #2
0
# - merge (pyTree) -
import Converter.PyTree as C
import Generator.PyTree as G
import Transform.PyTree as T
import Connector.PyTree as X
import Geom.PyTree as D

def f(t,u):
    x = t+u
    y = t*t+1+u*u
    z = u
    return (x,y,z)

a = D.surface(f)
b = T.splitSize(a, 100)
b = X.connectMatch(b, dim=2)
t = C.newPyTree(['Surface']); t[2][1][2] += b
b = T.merge(t)
t[2][1][2] = b
C.convertPyTree2File(t, "out.cgns")
Beispiel #3
0
a = D.surface(f)
t = C.newPyTree(['Base', 2])
b = []
i1 = 1
for i in range(10):
    i2 = (i + 1) * 10
    j1 = 1
    for j in range(10):
        j2 = (j + 1) * 10
        b.append(T.subzone(a, (i1, j1, 1), (i2, j2, 1)))
        j1 = j2
    i1 = i2
t[2][1][2] += b
t = C.initVars(t, 'F', 1.)
t = C.initVars(t, 'centers:G', 2.)
res = T.merge(t, dir=2)
t[2][1][2] = res
test.testT(t, 1)
res = T.merge(t, dir=1)
t[2][1][2] = res
test.testT(t, 2)

# volume grids
distrib = G.cart((0., 0., 0.), (0.1, 1, 1), (10, 1, 1))
a = G.addNormalLayers(a, distrib)
i1 = 1
b = []
for i in range(10):
    i2 = (i + 1) * 10
    j1 = 1
    for j in range(10):