def __init__(self, fileList, filePath, simPara, meshPara): self.fileList = fileList self.filePath = filePath self.simPara = simPara self.meshPara = meshPara path = os.getcwd() self.pathB = path + '/b' if not os.path.exists(self.pathB): os.makedirs(self.pathB) os.chdir(self.pathB) for i in range(0, len(fileList)): shutil.copy(filePath[i] + '/' + fileList[i], os.getcwd() + '/' + fileList[i]) funcs.simPara(filePath[1], fileList[1], simPara) funcs.editGeo(os.getcwd(), os.getcwd(), meshPara[0], meshPara[1], meshPara[2], meshPara[3]) subprocess.call("/tools/gmsh/2.9.2/bin/gmsh -2 -order 9 divConv2D.scr", shell=True) subprocess.call("~/bin/MeshConvert divConv2D.msh geom.xml", shell=True) subprocess.call("~/bin/IncNavierStokesSolver geom.xml " + fileList[1] + ' > log.txt', shell=True) j = funcs.MaxChk(self.pathB) args = 'cp ' + 'geom_' + str(j) + '.chk' + ' geom3D.bse' subprocess.call(args, shell=True) os.chdir(path)
def CritRe2(self,para): for i in self.ReList: para[6]=str(self.alpha)+'-'+str(self.Sval)+'-'+str(self.beta)+'-'+str(int(i))+'-.mdl'; para[3]=i; para[5]=self.beta; funcs.simPara(os.getcwd(),self.FileList[1],para); funcs.incSolver(self.exe,self.FileList[:-1]);
def CritRe2(self,para): for i in self.ReList: para[6]=str(self.alpha)+'-'+str(self.Sval)+'-'+str(self.beta)+'-'+str(i)+'-.mdl'; para[3]=i; para[5]=self.beta; funcs.simPara(os.getcwd(),self.FileList[1],para); funcs.incSolver(self.exe,self.FileList[:-1]); fileName=str(self.alpha)+'-'+str(self.Sval)+'-'+str(self.beta)+'-'+str(i)+'-'+'.his'; arg='mv TimeValues.his '+fileName;
def CritRe2(self, para): for i in self.ReList: para[6] = str(self.alpha) + '-' + str(self.Sval) + '-' + str( self.beta) + '-' + str(i) + '-.mdl' para[3] = i para[5] = self.beta funcs.simPara(os.getcwd(), self.FileList[1], para) fileName = str(self.alpha) + '-' + str(self.Sval) + '-' + str( self.beta) + '-' + str(i) + '-' + '.his' funcs.HiFileCh(os.getcwd(), self.FileList[1], fileName) funcs.incSolver(self.exe, self.FileList[:-1])
def CritRe2(self, para): for i in self.ReList: para[6] = str(self.alpha) + '-' + str(self.Sval) + '-' + str( self.beta) + '-' + str(i) + '-.mdl' para[3] = i para[5] = self.beta funcs.simPara(os.getcwd(), self.FileList[1], para) funcs.incSolver(self.exe, self.FileList[:-1]) fileName = str(self.alpha) + '-' + str(self.Sval) + '-' + str( self.beta) + '-' + str(i) + '-' + '.his' arg = 'mv TimeValues.his ' + fileName subprocess.call(arg, shell=True)
def IncModFreFile(self,para): for i in self.ReList: para[6]=str(self.alpha)+'-'+str(self.Sval)+'-'+str(self.beta)+'-'+str(int(i))+'-.mdl'; para[3]=i; para[5]=self.beta; funcs.simPara(os.getcwd(),self.FileList[1],para); funcs.incSolver(self.exe,self.FileList[:-1]); fileName=str(self.alpha)+'-'+str(self.Sval)+'-'+str(self.beta)+'-'+str(int(i))+'-'+'.his'; arg='mv TimeValues.his '+fileName; subprocess.call(arg,shell=True); filelist=['geom.xml','bd.xml','geomHplusD.fld']; #ipVar.incSolverHypS(filelist); #ipVar.incSolverHyp(1,4,filelist); ipVar.incSolver('~/.sg',filelist);
def __init__(self,fileList,filePath,simPara): self.fileList=fileList; self.filePath=filePath; self.simPara=simPara; path=os.getcwd(); pathD=path+'/d'; if not os.path.exists(pathD): os.makedirs(pathD); os.chdir(pathD); for i in range(0,len(fileList)): shutil.copy(filePath[i]+'/'+fileList[i],os.getcwd()+'/'+fileList[i]); funcs.simPara(filePath[1],fileList[1],simPara); subprocess.call("~/bin/IncNavierStokesSolver geom.xml "+fileList[1]+' > log.txt',shell=True);
def __init__(self, fileList, filePath, simPara): self.fileList = fileList self.filePath = filePath self.simPara = simPara path = os.getcwd() pathD = path + '/d' if not os.path.exists(pathD): os.makedirs(pathD) os.chdir(pathD) for i in range(0, len(fileList)): shutil.copy(filePath[i] + '/' + fileList[i], os.getcwd() + '/' + fileList[i]) funcs.simPara(filePath[1], fileList[1], simPara) subprocess.call("~/bin/IncNavierStokesSolver geom.xml " + fileList[1] + ' > log.txt', shell=True)
def __init__(self,fileList,filePath,simPara,meshPara): self.fileList=fileList; self.filePath=filePath; self.simPara=simPara; self.meshPara=meshPara; path=os.getcwd(); self.pathB=path+'/b'; if not os.path.exists(self.pathB): os.makedirs(self.pathB); os.chdir(self.pathB); for i in range(0,len(fileList)): shutil.copy(filePath[i]+'/'+fileList[i],os.getcwd()+'/'+fileList[i]); funcs.simPara(filePath[1],fileList[1],simPara); funcs.editGeo(os.getcwd(),os.getcwd(),meshPara[0],meshPara[1],meshPara[2],meshPara[3]); subprocess.call("/tools/gmsh/2.9.2/bin/gmsh -2 -order 9 divConv2D.scr" ,shell=True); subprocess.call("~/bin/MeshConvert divConv2D.msh geom.xml",shell=True); subprocess.call("~/bin/IncNavierStokesSolver geom.xml "+fileList[1]+' > log.txt',shell=True); j=funcs.MaxChk(self.pathB); args='cp '+'geom_'+str(j)+'.chk'+' geom3D.bse'; subprocess.call(args,shell=True); os.chdir(path);
tree=ET.parse(FilePath,OrderedXMLTreeBuilder()); root=tree.getroot(); Re=int(root[1][1][5].text.split('=')[-1]); os.chdir(pathA); ReMult=[10,15,15,15]; beta=0.4 for f in ReMult: Re=int(Re+f); if not os.path.exists(str(Re)): os.makedirs(str(Re)); os.chdir(str(Re)); pathB=os.getcwd(); time=20; para=[0.005,time,'FinalTime/(5*TimeStep)',Re,64,beta,'','','','1']; funcs.CopyFile(pathA,os.getcwd(),FileList); funcs.simPara(os.getcwd(),'bd.xml',para); #subprocess.call('mpirun -np 32 /home/nyadav/.sg/IncNavierStokesSolver --npz 32 geom.xml bd.xml',shell=True); subprocess.call('mpirun -np 16 /home/nyadav/bin/mpiInc --npz 16 geom.xml bd.xml > log.txt',shell=True); funcs.simPara(os.getcwd(),'bd.xml',para); if not os.path.exists(str(2)): os.makedirs(str(2)); os.chdir(str(2)); funcs.CopyFile(pathB,os.getcwd(),FileList); #f=funcs.MaxChk(os.getcwd()); #icfile='geom_'+str(f)+'.chk'; funcs.ICFile(pathB,os.getcwd(),'geom.fld','bd.xml'); #subprocess.call('mpirun -np 32 /home/nyadav/.sg/IncNavierStokesSolver --npz 32 geom.xml bd.xml',shell=True); subprocess.call('mpirun -np 16 /home/nyadav/bin/mpiInc --npz 16 geom.xml bd.xml >log.txt',shell=True); subprocess.call('rm -r IC.bse',shell=True) subprocess.call('mv geom.fld IC.bse',shell=True);