Example #1
0
File: run.py Project: ttnghia/MPM
def space(mainDir):
   sf=open('space.keep','w')
   print>>sf,'\n\n'
   header=['tInt','shape','Ncell','Npart','Nnode','incCount','wallTime','L1norm','L2norm','Linfnorm']
   for r in header:print>>sf,r,'\t',
   print>>sf
   loN=10.
   hiN=90.
   rN=1.7783
   N=loN
   while int(N)<=hiN:
      try:
         #outDict={'mainDir':mainDir,'Ncell':int(N),'single':0,'shape':'spline','tInt':'CD','load':.1,'CFL':.7}
         outDict={'mainDir':mainDir,'Ncell':int(N),'single':0,'shape':'spline','tInt':'CD','load':.1,'CFL':.7,'np':'2~2~1'}
         single(outDict,False)
         for r in header:print>>sf,outDict[r],'\t',
         print>>sf
         sf.flush()
         N*=rN
      except KeyboardInterrupt:
         sf.flush()
         break
   sf.close()
   logLog('space.keep',1)
Example #2
0
File: run.py Project: ttnghia/MPM
   ls+=[{'testName':'pullin2D-geom-3020','beamL':.1,'pois':.31,'Nthick':1,'lastFac':.01,'Nstep':8,'theta':1,'volt':3020,'linIter':200,'NewtTol':1e-6,'linTol':1e-8,'maxLoadIter':32,'np':'4~1~1'}]
   ls+=[{'testName':'pullin2D-lin-3050' ,'beamL':.1,'pois':.31,'Nthick':1,              'Nstep':8,'theta':1,'volt':3050,'linIter':200,'NewtTol':1e-6,'linTol':1e-8,'maxLoadIter':32,'np':'4~1~1'}]
   return ls


if __name__ == "__main__":
   topDir=os.path.split(os.getcwd())[0]
   mainDir=os.path.join(topDir,'0main') # Define the path to the main program files
   sys.path.append(mainDir)             # allow importing of modules from mainDir
   from main import single

   #dataDict={'mainDir':mainDir,'pois':.31,'Nthick':2,'lastFac':.01,'Nstep':10,'theta':1,'volt':195,'linIter':10000,'NewtTol':1e-6,'linTol':1e-8}

   dataDict={'mainDir':mainDir,'beamL':.1,'pois':.31,'Nthick':1,'Nstep':10,'theta':1,'volt':2800,'linIter':200,'NewtTol':1e-6,'linTol':1e-8}

   single(dataDict)
   tipTrace()
   #animGif(dataDict['frameCount'])
   #animGif(3)











Example #3
0
File: run.py Project: ttnghia/MPM
   #print>>gf,"set yrange[-1:2]"
   #print>>gf,"set zrange[-1:2]"
   print>>gf,'set palette rgbformulae 33,13,10'
   print>>gf,"set nokey"
   print>>gf,"set border 0"
   print>>gf,"splot 'history.xls' index 0 using 3:1:2:4 with points pt 5 ps 1 lt palette"
   gf.close()
   subprocess.Popen(['gnuplot','-persist','gnucomm.xls'],shell=False).wait()

def regressionTest(): # should NOT specify mainDir
   ls=[]
   ls+=[{'testName':'massMPI','Ncell':8,'shape':'MPM','tInt':'momentum','CFL':.9,'np':'2~2~2'}]
   return ls



if __name__ == "__main__":
   topDir=os.path.split(os.getcwd())[0]
   mainDir=os.path.join(topDir,'0main') # Define the path to the main program files
   sys.path.append(mainDir)             # allow importing of modules from mainDir
   from main import single
   #dataDict={'mainDir':mainDir,'Ncell':8,'shape':'MPM','tInt':'mass','CFL':.9,'np':'1~1~1'}
   #dataDict={'mainDir':mainDir,'Ncell':4,'shape':'MPM','tInt':'mass','CFL':.9,'np':'2~1~1'}
   dataDict={'mainDir':mainDir,'Ncell':8,'shape':'GIMP','tInt':'CD','CFL':.9,'np':'2~2~2'}
   single(dataDict,False)
   #for el in outDict:print el,'=',outDict[el]
   gnuLive3D(dataDict)