def prepareCompositeIBMData(t, tb, DEPTH=2, loc='centers', frontType=1): dimPb = Internal.getNodeFromName(tb, 'EquationDimension') if dimPb is None: raise ValueError('EquationDimension is missing in input body tree.') dimPb = Internal.getValue(dimPb) tc = C.newPyTree() for nob in range(len(t[2])): if Internal.getType(t[2][nob]) == 'CGNSBase_t': basename = t[2][nob][0] C._addBase2PyTree(tc, basename) for nob in range(len(tb[2])): if tb[2][nob][3] == 'CGNSBase_t': basename = tb[2][nob][0] tloc = C.newPyTree([basename]) tloc[2][1] = t[2][nob] tbloc = C.newPyTree([basename]) tbloc[2][1] = tb[2][nob] # prepro IBM + interpolation entre blocs internes tloc, tcloc = prepareIBMData(tloc, tbloc, DEPTH=DEPTH, loc=loc, frontType=frontType, interp='composite') C._cpVars(tloc, 'centers:cellN', tcloc, 'cellN') tc[2][nob][2] += Internal.getZones(tcloc) Internal._rmNodesFromType(t[2][nob], "Zone_t") t[2][nob][2] += Internal.getZones(tloc) # offbodyZones = C.node2Center(t[2][-1][2]) Internal._rmNodesByName(tc, "*TurbulentDistance*") Internal._rmNodesByName(tc, Internal.__FlowSolutionCenters__) tc[2][-1][2] += offbodyZones return t, tc
def prepareCompositeChimeraData(t, tc, tblank, noBaseOff, DEPTH=2, loc='centers', NIT=1, RotationCenter=None, RotationAngle=None, Translation=None): tBB = G.BB(tc) listOfOffBodyIntersectingNBZones = getListOfOffBodyIntersectingNBZones( tBB, noBaseOff, NIT=NIT, DEPTH=DEPTH, RotationCenter=RotationCenter, RotationAngle=RotationAngle, Translation=Translation) listOfSteadyOffBodyZones = getListOfSteadyOffBodyZones( tBB, noBaseOff, listOfOffBodyIntersectingNBZones) t, tc = prepareSteadyOffBodyChimeraData( t, tc, tblank, noBaseOff, tBB=tBB, DEPTH=2, loc='centers', NIT=NIT, RotationCenter=RotationCenter, RotationAngle=RotationAngle, Translation=Translation, listOfSteadyOffBodyZones=listOfSteadyOffBodyZones) t, tc = prepareMotionChimeraData( t, tc, tblank, noBaseOff, tBB=tBB, DEPTH=2, loc='centers', NIT=NIT, RotationCenter=RotationCenter, RotationAngle=RotationAngle, Translation=Translation, listOfSteadyOffBodyZones=listOfSteadyOffBodyZones, listOfOffBodyIntersectingNBZones=listOfOffBodyIntersectingNBZones) Internal._rmNodesByName(tc, Internal.__FlowSolutionNodes__) Internal._rmNodesByName(tc, Internal.__GridCoordinates__) return t, tc
s = C.convertArray2Tetra(s); s = T.join(s); s = P.exteriorFaces(s) t = C.newPyTree(['Base']); t[2][1][2] = [a] # Blanking bodies = [[s]] BM = N.array([[1]],N.int32) t = X.blankCells(t,bodies,BM,blankingType='center_in') t = X.setHoleInterpolatedPoints(t,depth=-2) # Dist2Walls t = DTW.distance2Walls(t,[s],type='ortho',loc='centers',signed=1) t = C.center2Node(t,'centers:TurbulentDistance') # Gradient de distance localise en centres => normales t = P.computeGrad(t, 'TurbulentDistance') t = I.initConst(t,MInf=0.2,loc='centers') tc = C.node2Center(t) t = X.setIBCData(t, tc, loc='centers', storage='direct') no = 1 for bcType in xrange(4): for varType in xrange(1,4): t2 = X.setInterpTransfers(t,tc,bcType=bcType,varType=varType) test.testT(t2,no) no+=1 # Stockage inverse Internal._rmNodesByName(t,"IBCD_*") tc = X.setIBCData(t, tc, loc='centers', storage='inverse') for bcType in xrange(4): for varType in xrange(1,4): X._setInterpTransfers(t,tc,bcType=bcType,varType=varType) test.testT(tc,no) no += 1