def aglomerateNonStar(t): nb_cells0 = nb_cells(t) carry_on = 1 i = 0 while (carry_on == 1): print " " print "iter %s" % i t = XOR.agglomerateNonStarCells(t) print "check closure" XOR.checkCellsClosure(t) nb_cells1 = nb_cells(t) if (nb_cells1 == nb_cells0): carry_on = 0 if (carry_on == 0): print "no cell found." if (nb_cells1 != nb_cells0): print "%d cells have been aglomerated" % (nb_cells0 - nb_cells1) #C.convertPyTree2File(t, "nonstar_iter_%s.cgns"%i) nb_cells0 = nb_cells1 i = i + 1 #if (i == 3) : carry_on=0 return t
# - boolean checkCellsClosure (array) - import Generator.PyTree as G import Converter.PyTree as C import Intersector.PyTree as XOR import Geom.PyTree as D M1 = C.convertFile2PyTree('boolNG_M1.tp') M1 = C.convertArray2NGon(M1) err = XOR.checkCellsClosure(M1)