示例#1
0
def correctPyTree():
    if CTK.t == []: return
    v = VARS[3].get()
    if v == 'Multigrid compatibility':
        CTK.TXT.insert('START', 'Can not correct for multigrid.\n')
        CTK.TXT.insert('START', 'Error: ', 'Error')
        return
    if v == 'Maximum number of nodes':
        CTK.TXT.insert('START',
                       'Can not correct for maximum number of nodes.\n')
        CTK.TXT.insert('START', 'Error: ', 'Error')
        return

    if v == 'All conformity' or v == ' > Node conformity':
        Internal._correctPyTree(CTK.t, level=1)
    if v == 'All conformity' or v == ' > Unique base name':
        Internal._correctPyTree(CTK.t, level=2)
    if v == 'All conformity' or v == ' > Unique zone name':
        Internal._correctPyTree(CTK.t, level=3)
    if v == 'All conformity' or v == ' > Unique BC name':
        Internal._correctPyTree(CTK.t, level=4)
    if v == 'All conformity' or v == ' > Valid BC ranges':
        Internal._correctPyTree(CTK.t, level=5)
    if v == 'All conformity' or v == ' > Valid BC match':
        Internal._correctPyTree(CTK.t, level=6)
    if v == 'All conformity' or v == ' > Referenced families':
        Internal._correctPyTree(CTK.t, level=7)
    if v == 'All conformity' or v == ' > Valid CGNS types':
        Internal._correctPyTree(CTK.t, level=8)
    if v == 'All conformity' or v == ' > Valid element nodes':
        Internal._correctPyTree(CTK.t, level=9)
    if v == 'All conformity' or v == ' > Valid CGNS flowfield name':
        Internal.correctPyTree(CTK.t, level=10)
    #C._fillMissingVariables(CTK.t)
    (CTK.Nb, CTK.Nz) = CPlot.updateCPlotNumbering(CTK.t)
    CTK.TKTREE.updateApp()
    CTK.display(CTK.t)
    CTK.TXT.insert('START', 'pyTree corrected.\n')
示例#2
0
# - correctPyTree (pyTree) -
import Converter.PyTree as C
import Generator.PyTree as G
import Connector.PyTree as X
import Converter.Internal as Internal
import KCore.test as test

# Correct
a = G.cart( (0,0,0), (1,1,1), (10,10,10) )
b = G.cart( (9,0,0), (1,1,1), (10,10,10) )
a = C.addBC2Zone(a, 'wall1', 'BCWall', 'imin')
t = C.newPyTree(['Base']); t[2][1][2] += [a,b]
t = X.connectMatch(t)
print(Internal.checkPyTree(t))
t = Internal.correctPyTree(t)
test.testT(t, 1)

# Wrong range for BCWall and wrong range for donor
a = G.cart( (0,0,0), (1,1,1), (10,10,10) ) 
b = G.cart( (0,0,0), (1,1,1), (10,10,10) ); b[0] = 'toto'
a = C.initVars(a, '{centers:Density}={centers:CoordinateX}')
a = C.addBC2Zone(a, 'wall', 'BCWall', wrange=[1,1,1,11,1,10])
a = C.addBC2Zone(a, 'match', 'BCMatch', wrange=[1,1,1,10,1,10], 
                 zoneDonor=b, rangeDonor=[1,1,1,10,1,11], trirac=[1,2,3]) 

t = C.newPyTree(['Base', a])
t = Internal.correctPyTree(t)
test.testT(t, 2)