Esempio n. 1
0
def rmBCOfType():
    if CTK.t == []: return

    BCTypes = []
    selection = WIDGETS['BCLB'].curselection()
    for s in selection:
        t = WIDGETS['BCLB'].get(s)
        if t not in Internal.KNOWNBCS: t = 'FamilySpecified:' + t
        BCTypes.append(t)

    CTK.saveTree()
    nzs = CPlot.getSelectedZones()
    if CTK.__MAINTREE__ <= 0 or nzs == []:
        if 'FamilySpecified:-All BC-' in BCTypes:
            Internal._rmNodesByType(CTK.t, 'BC_t')
        else:
            for t in BCTypes:
                C._rmBCOfType(CTK.t, t)
    else:
        for nz in nzs:
            nob = CTK.Nb[nz] + 1
            noz = CTK.Nz[nz]
            z = CTK.t[2][nob][2][noz]
            if 'FamilySpecified:-All BC-' in BCTypes:
                Internal._rmNodesByType(z, 'BC_t')
            else:
                for t in BCTypes:
                    C._rmBCOfType(z, t)
    CTK.TXT.insert('START', 'BCs of type %s have been removed.\n' % type)
    CTK.TKTREE.updateApp()
    check()
Esempio n. 2
0
t2 = Internal.copyRef(t1)
C._initVars(t1, 'centers:cellN', 1.)
C._initVars(t1, 'Pressure', 10.)
C._initVars(t1, 'Density', 1.)
C._addState(t1[2][1], 'Mach', 0.6)
C._addState(t2[2][1], 'Mach', 0.6)
t2 = P.importVariables(t1, t2)
test.testT(t2, 1)

# z2 avec cellN = 0
C._initVars(t2, 'centers:cellN', 0.)
t2 = P.importVariables(t1, t2)
test.testT(t2, 2)

# z1 en centres avec z2 sans solution
Internal._rmNodesByType(t2, 'FlowSolution_t')
t1 = C.node2Center(t1)
t2 = P.importVariables(t1, t2)
test.testT(t2, 3)

# test t1 en centres/ t2 en noeuds
Internal._rmNodesByType(t2, 'FlowSolution_t')
C._initVars(t2, 'centers:cellN', 0.)
t2 = P.importVariables(t1, t2)
test.testT(t2, 4)

# EXTRA GRID : pas de meme nom-memes dimensions
z11 = G.cart((0., 0., 0.), (0.1, 0.1, 0.1), (3, 3, 3))
z12 = G.cart((10., 0., 0.), (0.1, 0.1, 0.1), (3, 3, 3))
z21 = G.cart((20., 0., 0.), (0.1, 0.1, 0.1), (3, 3, 3))
z22 = G.cart((30., 0., 0.), (0.1, 0.1, 0.1), (3, 3, 3))