def Re10(self, N, time): self.ReList = [] [a, b] = ipVar.poptFile(os.getcwd()) xx = [] for i in range(0, len(a) - 1): if (a[i] * a[i + 1] < 0): xx.append(i) if (len(xx) > 2): self.ReList.append(b[xx[1]] + 10) self.ReList.append(abs(b[xx[1]] - 10)) self.ReList.append(b[xx[2]] + 10) self.ReList.append(abs(b[xx[2]] - 10)) para = [ 0.005, 150, '2*FinalTime/TimeStep', '', '', self.beta, '', '0.2/TimeStep', str(np.pi / self.alpha) + ' 0 0 ', '0.5' ] self.CritRe2(para) self.ReList = [] [a, b] = ipVar.poptFile(os.getcwd()) re = funcs.calcReC(a, b) a = np.floor(re / 100) * 100 b = np.ceil(re / 100) * 100 c = (b - a) / N c = int(c) for i in range(1, N): self.ReList.append(int(a + i * c)) para = [ 0.005, time, '2*FinalTime/TimeStep', '', '', self.beta, '', '0.2/TimeStep', str(np.pi / self.alpha) + ' 0 0 ', '1' ] self.CritRe2(para)
def Re10(self,N,time): self.ReList=[]; [a,b]=ipVar.poptFile(os.getcwd()); xx=[]; for i in range(0,len(a)-1): if(a[i]*a[i+1] < 0):xx.append(i); if(len(xx) >2): self.ReList.append(b[xx[1]]+10); self.ReList.append(abs(b[xx[1]]-10)); self.ReList.append(b[xx[2]]+10); self.ReList.append(abs(b[xx[2]]-10)); para=[0.005,150,'2*FinalTime/TimeStep','','',self.beta,'','2*FinalTime/TimeStep',str(np.pi/self.alpha)+' 0 0 ','0.5']; self.CritRe2(para); self.ReList=[]; [a,b]=ipVar.poptFile(os.getcwd()); re=funcs.calcReC(a,b); a=np.floor(re/100)*100; b=np.ceil(re/100)*100; c=(b-a)/N; c=int(c); for i in range(1,N): self.ReList.append(int(a+i*c)); para=[0.005,time,'2*FinalTime/TimeStep','','',self.beta,'','2*FinalTime/TimeStep',str(np.pi/self.alpha)+' 0 0 ','1']; self.CritRe2(para);
def Re100(self, N, time): self.ReList = [] [a, b] = ipVar.poptFile(os.getcwd()) xx = (i for i in range(0, len(a)) if a[i] > 0).next() self.ReList.append(abs(b[xx] - 100)) para = [ 0.005, 150, '2*FinalTime/TimeStep', '', '', self.beta, '', '0.2/TimeStep', str(np.pi / self.alpha) + ' 0 0 ', '0.5' ] self.CritRe2(para) self.ReList = [] re = funcs.calcReC(a, b) a = np.floor(re / 1000) * 1000 b = np.ceil(re / 1000) * 1000 c = (b - a) / N c = int(c) for i in range(1, N): self.ReList.append(int(a + i * c)) para = [ 0.005, time, '2*FinalTime/TimeStep', '', '', self.beta, '', '0.2/TimeStep', str(np.pi / self.alpha) + ' 0 0 ', '0.5' ] self.CritRe2(para)
def ReFinal2(self,time): [a,b]=ipVar.poptFile(os.getcwd()); re=funcs.calcReC(a,b); self.ReList=[]; self.ReList.append(re); para=[0.005,time,'0.1*FinalTime/TimeStep','','',self.beta,'','2*FinalTime/TimeStep',str(np.pi/self.alpha)+' 0 0 ','1']; self.CritRe2(para);
def ReFinal2(self,time): [a,b]=ipVar.poptFile(os.getcwd()); re=funcs.calcReC(a,b); re=int(re); self.ReList=[]; self.ReList.append(re); para=[0.005,time,'0.1*FinalTime/TimeStep','','',self.beta,'','0.2/TimeStep',str(np.pi/self.alpha)+' 0 0 ','1']; self.CritRe2(para);
def ReFinal(self): [a,b]=ipVar.poptFile(os.getcwd()); re=funcs.calcReC(a,b); re=int(re); self.ReList=[]; self.ReList.append(re); path=os.getcwd(); if not os.path.exists(str(re)): os.makedirs(str(re)); os.chdir(str(re)); para=[0.005,400,'0.1*FinalTime/TimeStep','','',self.beta,'','0.2/TimeStep',str(np.pi/self.alpha)+' 0 0 ','1']; funcs.CopyFile(path,os.getcwd(),self.FileList); self.CritRe2(para);
def ReSmooth(self, time, incre): [a, b] = ipVar.poptFile(os.getcwd()) re = funcs.calcReC(a, b) self.ReList = [] self.ReList.append(re) self.ReList.append(re + incre) self.ReList.append(re - incre) para = [ 0.005, time, '2*FinalTime/TimeStep', '', '', self.beta, '', '2*FinalTime/TimeStep', str(np.pi / self.alpha) + ' 0 0 ', '1' ] self.CritRe2(para)
def ReFinal(self, time): [a, b] = ipVar.poptFile(os.getcwd()) re = funcs.calcReC(a, b) re = int(re) self.ReList = [] self.ReList.append(re) path = os.getcwd() if not os.path.exists(str(re)): os.makedirs(str(re)) os.chdir(str(re)) para = [ 0.005, time, '2*FinalTime/TimeStep', '', '', self.beta, '', '2*FinalTime/TimeStep', str(np.pi / self.alpha) + ' 0 0 ', '1' ] funcs.CopyFile(path, os.getcwd(), self.FileList) self.CritRe2(para)
def Re100(self,N,time): self.ReList=[]; [a,b]=ipVar.poptFile(os.getcwd()); xx=(i for i in range(0,len(a)) if a[i] > 0 ).next(); self.ReList.append(abs(b[xx]-100)); para=[0.005,150,'2*FinalTime/TimeStep','','',self.beta,'','2*FinalTime/TimeStep',str(np.pi/self.alpha)+' 0 0 ','0.5']; self.CritRe2(para); self.ReList=[]; re=funcs.calcReC(a,b); a=np.floor(re/1000)*1000; b=np.ceil(re/1000)*1000; c=(b-a)/N; c=int(c); for i in range(1,N): self.ReList.append(int(a+i*c)); para=[0.005,time,'2*FinalTime/TimeStep','','',self.beta,'','2*FinalTime/TimeStep',str(np.pi/self.alpha)+' 0 0 ','0.5']; self.CritRe2(para);
import ipVar; import numpy as np; from scipy.interpolate import UnivariateSpline; cwd=os.getcwd(); S=[];bCr=[]; path=glob("*/"); for k in path: os.chdir(k); path1=glob("*/"); cwd1=os.getcwd(); bb=[];aa=[];cc=[]; for i in path1: os.chdir(i); mdl=glob("*.mdl"); if(len(mdl)>5): [a,b]=ipVar.poptFile(os.getcwd()); if(len(a)>5): for j in a: c=[j for j in a if j>0]; if(len(c)>0): c=min(c);aa.append(c);c=np.where(a==c); bb.append(b[c[0]]); cc.append(float(i.split('/')[0])); os.chdir(cwd1); if(len(bb)>2): l2, l1 = zip(*sorted(zip(cc,bb))); cc=list(l2);bb=list(l1); f=UnivariateSpline(cc,bb,k=2); cc=np.linspace(min(cc),max(cc),1000); bb=f(cc); MIN=min(bb);
cwd = os.getcwd() S = [] bCr = [] path = glob("*/") for k in path: os.chdir(k) path1 = glob("*/") cwd1 = os.getcwd() bb = [] aa = [] cc = [] for i in path1: os.chdir(i) mdl = glob("*.mdl") if (len(mdl) > 5): [a, b] = ipVar.poptFile(os.getcwd()) if (len(a) > 5): for j in a: c = [j for j in a if j > 0] if (len(c) > 0): c = min(c) aa.append(c) c = np.where(a == c) bb.append(b[c[0]]) cc.append(float(i.split('/')[0])) os.chdir(cwd1) if (len(bb) > 2): l2, l1 = zip(*sorted(zip(cc, bb))) cc = list(l2) bb = list(l1) f = UnivariateSpline(cc, bb, k=2)