Example #1
0
import Geom.PyTree as D
import KCore.test as test
import sys

# Test 1
# Tet mask
mT4 = G.cart((0., 0., 0.), (0.1, 0.1, 0.2), (10, 10, 10))
mT4 = C.convertArray2Tetra(mT4)
# Mesh to blank
a = G.cart((-5., -5., -5.), (0.5, 0.5, 0.5), (100, 100, 100))
t = C.newPyTree(['Cart'])
t[2][1][2].append(a)
# celln init
t = C.initVars(t, 'nodes:cellN', 1.)
# Blanking
t = X.blankCellsTetra(t, [[mT4]], [], blankingType="node_in", tol=1.e-12)
#C.convertPyTree2File(t, 'out1.cgns')
test.testT(t, 1)

# Test 2
# Tet mask
mT4 = G.cart((0., 0., 0.), (0.1, 0.1, 0.2), (10, 10, 10))
mT4 = C.convertArray2Tetra(mT4)
# Mesh to blank
a = G.cart((-5., -5., -5.), (0.5, 0.5, 0.5), (100, 100, 100))
t = C.newPyTree(['Cart'])
t[2][1][2].append(a)
# celln init
t = C.initVars(t, 'centers:cellN', 1.)
# Blanking
t = X.blankCellsTetra(t, [[mT4]], [], blankingType="center_in", tol=1.e-12)
import Converter.PyTree as C
import Connector.PyTree as X
import Generator.PyTree as G
import Geom.PyTree as D

# Tet mask
mT4 = G.cart((0., 0., 0.), (0.1, 0.1, 0.2), (10, 10, 10))
mT4 = C.convertArray2Tetra(mT4)

# Mesh to blank
a = G.cart((-5., -5., -5.), (0.5, 0.5, 0.5), (100, 100, 100))

t = C.newPyTree(['Cart', a])
C._initVars(t, 'centers:cellN', 1.)

masks = [[mT4]]
# Matrice de masquage (arbre d'assemblage)
import numpy
BM = numpy.array([[1]])

t1 = X.blankCellsTetra(t, masks, BM, blankingType='node_in', tol=1.e-12)
C.convertPyTree2File(t1, 'out.cgns')

t2 = C.convertArray2Tetra(t)
t2 = X.blankCellsTetra(t2, masks, BM, blankingType='node_in', tol=1.e-12)
C.convertPyTree2File(t2, 'out2.cgns')

t3 = C.convertArray2NGon(t)
t3 = X.blankCellsTetra(t3, masks, BM, blankingType='node_in', tol=1.e-12)
C.convertPyTree2File(t3, 'out3.cgns')
Example #3
0
import KCore.test as test
import sys

# Test 1
# Tet mask
mT4 = G.cart((0., 0., 0.), (0.1, 0.1, 0.2), (10, 10, 10))
mT4 = C.convertArray2Tetra(mT4)
# Mesh to blank
a = G.cart((-5., -5., -5.), (0.5, 0.5, 0.5), (100, 100, 100))
t = C.newPyTree(['Cart', a])
# celln init
t = C.initVars(t, 'nodes:cellN', 1.)
# Blanking
t = X.blankCellsTetra(t, [[mT4]], [],
                      blankingType="node_in",
                      tol=1.e-12,
                      cellnval=2,
                      overwrite=1)
#C.convertPyTree2File(t, 'out1.cgns')
test.testT(t, 1)

# Test 2
# Tet mask
mT4 = G.cart((0., 0., 0.), (0.1, 0.1, 0.2), (10, 10, 10))
mT4 = C.convertArray2Tetra(mT4)
# Mesh to blank
a = G.cart((-5., -5., -5.), (0.5, 0.5, 0.5), (100, 100, 100))
t = C.newPyTree(['Cart', a])
# celln init
t = C.initVars(t, 'centers:cellN', 1.)
# Blanking
Example #4
0
# - blankCellsTetra (pyTree) - 'NODE IN'
import Converter.PyTree as C
import Connector.PyTree as X
import Generator.PyTree as G
import Geom.PyTree as D

# Tet mask
mT4 = G.cart((0., 0., 0.), (0.1, 0.1, 0.2), (10, 10, 10))
mT4 = C.convertArray2Tetra(mT4)

# Mesh to blank
a = G.cart((-5., -5., -5.), (0.5, 0.5, 0.5), (100, 100, 100))

t = C.newPyTree(['Cart', a])
t = C.initVars(t, 'centers:cellN', 1.)

masks = [[mT4]]
# Matrice de masquage (arbre d'assemblage)
import numpy

BM = numpy.array([[1]])

t = X.blankCellsTetra(t, masks, BM, blankingType='node_in', tol=1.e-12)
C.convertPyTree2File(t, 'out.cgns')