try: range = xrange except: pass # Solution en noeuds et en centres a = C.convertFile2Arrays('outputn.plt') sol = C.convertFile2Arrays('output.plt') CPlot.display(sol, dim=2) # Entree du point d'emission print "Cliquez pour definir le point d'emission..." Point = [] while Point == []: Point = CPlot.getActivePoint() # Point d'emission print "Point d'emission :", Point # Particules np = 20 nq = 20 nodes = C.array('x,y,z,ro,rou,rov,row,roE,cellN', np * nq, 0, 'NODE') x = nodes[1] for j in range(nq): for i in range(np): x[0, i + j * np] = Point[0] + 0.04 * i x[1, i + j * np] = Point[1] + 0.04 * j x[2, i + j * np] = Point[2]
def getActivePoint(): """Return the active point coordinates in plotter. Usage: n=getActivePoint()""" return CPlot.getActivePoint()