# - compute (pyTree) - import Generator.PyTree as G import Converter.PyTree as C import Fast.PyTree as Fast import FastS.PyTree as FastS import Post.PyTree as P import Connector.PyTree as X import Geom.PyTree as D import Converter.Internal as Internal import Fast.Utils as Utils # NP: 0: Seq, NP> 0: running with mpi, distributed on NP procs NP = Utils.getArgs1() if NP > 0: import Converter.Mpi as Cmpi import FastS.Mpi as FastS rank = Cmpi.rank else: import FastS.PyTree as FastS rank=0 NIT = 10000 # Reading input files: t.cgns/restart.cgns and tc.cgns t,tc,ts,graph = Fast.load('t.cgns', 'tc.cgns', split='single', restart=False, NP=NP) # Numerics numb = {} numb["temporal_scheme"] = "explicit" numb["ss_iteration"] = 20 numz = {} numz["time_step"] = 0.007 numz["time_step_nature"] = "global" numz["cfl"] = 1. numz["scheme"] = "senseur" FastS._setNum2Zones(t, numz) ; FastS._setNum2Base(t, numb) (t, tc, metrics) = FastS.warmup(t, tc, graph) # Extraction de zone (si plusieurs zones, elles doivent etre sur le meme rank) zone = Internal.getNodeFromName(tc, 'join.6') if zone is not None: hook = C.createHook(zone, 'extractMesh') point = D.point( (5.17,0.65,1.72) ) line = D.line( (5.17,0.65,1.72), (20.,0.65,1.72), N=10) time = time0 time_step = Internal.getNodeFromName(t, 'time_step') time_step = Internal.getValue(time_step) for it in xrange(NIT): FastS._compute(t, metrics, it, tc, graph) if it%100 == 0: if rank == 0: print '- %d / %d - %f'%(it+it0, NIT+it0, time) if zone is not None: point = P.extractMesh(zone, point, hook=hook) line = P.extractMesh(zone, line, hook=hook) C.convertPyTree2File([point,line], 'extract_it%s.cgns'%(it+it0)) time += time_step # time stamp Internal.createUniqueChild(t, 'Iteration', 'DataArray_t', value=it0+NIT) Internal.createUniqueChild(t, 'Time', 'DataArray_t', value=time) Fast.save(t, 'restart.cgns', split='single', NP=NP)