Exemple #1
0
# - nearestNodes (array) -
import Converter as C
import Generator as G
import Transform as T
import KCore.test as test

def nearest(a):
    f = G.cartHexa((2,0,0),(1,1,1),(3,1,1))
    f = T.translate(f,(0.15,0.,0.))
    if isinstance(a[0], list):
        a=a[0]; f = [f,f]
    hook = C.createHook(a, function='nodes')
    nodes = C.nearestNodes(hook, f)
    C.freeHook(hook)
    return nodes

test.stdTestA(nearest)
Exemple #2
0
# - patch (array) - ijk indices
import Transform as T
import Generator as G
import Converter as C
import KCore.test as test

a = G.cart((0,0,0), (1,1,1), (5,1,1))
a = C.initVars(a, 'F=1')
test.stdTestA(T.patch,a,(3,1,1))
# - barycenter (array) -
import Generator as G
import KCore.test as test

test.stdTestA(G.barycenter)
# - splitConnexity (array) -
import Transform as T
import KCore.test as test

test.stdTestA(T.splitConnexity)
Exemple #5
0
# - getNormalMap (array) -
import Generator as G
import KCore.test as test

test.stdTestA(G.getNormalMap)
Exemple #6
0
# - collapse (array) -
import Transform as T
import KCore.test as test

test.stdTestA(T.collapse)


Exemple #7
0
# - addkplane (array) -
import Transform as T
import KCore.test as test

test.stdTestA(T.addkplane)
Exemple #8
0
# - deformMesh (array) -
import Transform as T
import Converter as C
import Geom as D
import Generator as G
import KCore.test as test

a1 = D.sphere6((0,0,0), 1, 18)
a1 = C.convertArray2Tetra(a1); a1 = T.join(a1)
point = C.getValue(a1, 0)
a2 = T.deformPoint(a1, point, (0.1,0.05,0.2), 0.5, 2.)
delta = C.addVars(a1, ['dx','dy','dz'])
delta = C.extractVars(delta, ['dx','dy','dz'])
delta[1][:,:] = a2[1][:,:]-a1[1][:,:]
a1 = C.addVars([a1, delta])

test.stdTestA(T.deformMesh,a1)
Exemple #9
0
# - convertArray2Tetra (array) -
import Converter as C
import KCore.test as test

test.stdTestA(C.convertArray2Tetra, 'withBarycenters')
# - normalize (array) -
import Converter as C
import KCore.test as test

test.stdTestA(C.normalize, ['x', 'y', 'z'])
# - convertArray2NGon(array) -
import Converter as C
import KCore.test as test

test.stdTestA(C.convertArray2NGon)
Exemple #12
0
# - smooth (array) -
import Transform as T
import KCore.test as test

test.stdTestA(T.smooth, 0.5, 10)
# - splitTRI (array) -
import Transform as T
import KCore.test as test

c = [[0, 1, 12, 23, 24, 14, 4], [97, 87, 88, 89]]
test.stdTestA(T.splitTRI, c)
# - addVars (array) -
import Converter as C
import KCore.test as test

test.stdTestA(C.addVars, 'ro')
# - bbox (array) -
import Generator as G
import KCore.test as test

test.stdTestA(G.bbox)
Exemple #16
0
# - reorder (array) -
import Transform as T
import KCore.test as test

test.stdTestA(T.reorder,(3,-1,2))
Exemple #17
0
# - extractVars (array) -
import Converter as C
import KCore.test as test

test.stdTestA(C.extractVars, 'F')
Exemple #18
0
# - createGlobalHook (array) -
import Converter as C
import Generator as G
import KCore.test as test

test.stdTestA(C.createGlobalHook, 'nodes', 1)
test.stdTestA(C.createGlobalHook, 'nodes', 0)
# - getMaxValue (array) -
import Converter as C
import KCore.test as test

test.stdTestA(C.getMaxValue, 'F')
# - identifyElements (array) -
import Converter as C
import Post as P
import KCore.test as test


def identify(a):
    f = P.exteriorElts(a)
    if (isinstance(a[0], list) == True): a = a[0]
    hook = C.createHook(a, function='elementCenters')
    elts = C.identifyElements(hook, f)
    C.freeHook(hook)
    return elts


test.stdTestA(identify)
# - splitSize (array) -
import Transform as T
import KCore.test as test

test.stdTestA(T.splitSize, 9)
Exemple #22
0
# - normL2 (array) -
import Converter as C
import KCore.test as test

test.stdTestA(C.normL2, 'F')
Exemple #23
0
# - perturbate (array) -
import Transform as T
import KCore.test as test

test.stdTestA(T.perturbate, 0.1)
Exemple #24
0
# - createHook (array) -
import Converter as C
import KCore.test as test

test.stdTestA(C.createHook, 'elementCenters')
# - randomizeVar (array) -
import Converter as C
import KCore.test as test
test.stdTestA(C.randomizeVar, 'F', 0.1,0.2)

# - BB (array) -
import Generator as G
import KCore.test as test

test.stdTestA(G.BB)
# - splitCurvatureAngle (array) -
import Converter as C
import Transform as T
import Geom as D
import Generator as G
import KCore.test as test

test.stdTestA(T.splitCurvatureAngle, 10.)
# - getValue (array) -
import Converter as C
import Generator as G
import KCore.test as test

test.stdTestA(C.getValue, (1, 1, 1))
# - selectCells2 (array) -
import Converter as C
import Generator as G
import Post as P
import KCore.test as test


def G(x, y, z):
    if (x + y + z > 5.): return True
    else: return False


def F(a):
    b = C.initVars(a, 'tag', G, ['x', 'y', 'z'])
    tag = C.extractVars(b, ['tag'])
    return P.selectCells2(a, tag, strict=1)


test.stdTestA(F)
Exemple #30
0
# - oneovern (array) -
import Transform as T
import KCore.test as test

test.stdTestA(T.oneovern, (2, 2, 2))