diff --git a/tools/evaluation/thesisCoupled.py b/tools/evaluation/thesisCoupled.py index 75cd2669653d8e7fce43e16f93c494c312d33ea7..de99d3508a901acf9a2dee994c85bca99ad2039d 100644 --- a/tools/evaluation/thesisCoupled.py +++ b/tools/evaluation/thesisCoupled.py @@ -78,7 +78,7 @@ def ErrorExtraVInt(case): def ErrorExtra(case): lL=[1,2,3,4] - tL=[0,1,2,3,4] + tL=[1,2,3] sdt=0.0004 endTime=0.6 if case=='Volumes': @@ -91,7 +91,7 @@ def ErrorExtra(case): savePath='../../../thesis-lindner/thesis/tables/erstmal/coupled/' tabWriter = TableWriter(lL,tL,sdt,endTime,1,[fSIOC],listEvaluationPoints) if case=='Volumes': - tabWriter.writeVolumesExtraError(path,fN,savePath,nL) + tabWriter.writeVolumesExtraError(eP,fL,savePath,nL) else: tabWriter.writeErrorExtraTab(eP,fL,savePath,nL,case) @@ -281,7 +281,7 @@ if __name__=="__main__": #plotGamma() - #plotVolumen() + plotVolumen() ErrorExtra('Volumes') #print(read.getActivaitionTimeFromLog(4,4,1, fSIOC, 8,threshold,False,'')) diff --git a/tools/evaluation/utility/latexTables.py b/tools/evaluation/utility/latexTables.py index ddeaae11e025e74a263302da465a183eb6a3e298..45aba0ede5d0099b2fdb872c5bd0ceeb9a3cc568 100644 --- a/tools/evaluation/utility/latexTables.py +++ b/tools/evaluation/utility/latexTables.py @@ -2054,6 +2054,64 @@ class Table: block+='|c' block+='}\n' return block + def writeExtraErrorVolumes(self,fL,nL): + block = '' + + length=len(fL)*2+2 + block+=self.BeginDifferenceTable(length,'c') + block+='\\multicolumn{2}{c}{}'+'&\\multicolumn{'+str(len(fL))+'}{c}{ $\\errorLV^{j,\ell,}$}'+'& &\\multicolumn{'+str(len(fL))+'}{c}{ $\\errorRV^{j,\ell}$}'+'\\\\\n' + block+='\cmidrule(lr){3-'+str(len(fL)+2)+'}\n' + block+='\cmidrule(l){'+str(len(fL)+4)+'-'+str(2*len(fL)+3)+'}\n' + block+='\\multicolumn{2}{c}{}' + for alg in nL: + block+='&'+alg + block +=' & ' + for alg in nL: + block+='&'+alg + block+='\\\\\n' + #block+='\\addlinespace\n' + block+='\cmidrule(r){1-2}\n' + block+='\cmidrule(lr){3-'+str(len(fL)+2)+'}\n' + block+='\cmidrule(l){'+str(len(fL)+4)+'-'+str(2*len(fL)+3)+'}\n' + + #Extrapolates + LV_ref=comp.getFullExtrapolate(self.lL[-1],self.tL[-1],self.m,1,self.sdt,self.T,self.exP,'Volumes') + normLV_ref=comp.L2(LV_ref,self.sdt,self.T,self.tL[-2],False) + RV_ref=comp.getFullExtrapolate(self.lL[-1],self.tL[-1],self.m,2,self.sdt,self.T,self.exP,'Volumes') + normRV_ref=comp.L2(RV_ref,self.sdt,self.T,self.tL[-2],False) + + for l in self.lL: + block+='$\\ell='+str(l)+'$' + for j in self.tL: + block +='& $j='+str(j)+'$' + standardlength=int(round(self.T/(self.sdt*2**(-j))))+1 + for alg in fL: + (t,V)=read.getDataFromTXT(alg,read.createFilename(l,j,self.m)+'Volumes',1) + if len(t)==standardlength or len(t)==standardlength-1: + value=comp.L2DiffInterval(V,LV_ref,self.sdt,j,self.tL[-2]) + value=value/normLV_ref + block += " & $"+ str("%8.4f"%(value))+"$" + else: + block+=" & - " + block+='& ' + for alg in fL: + (t,V)=read.getDataFromTXT(alg,read.createFilename(l,j,self.m)+'Volumes',2) + if len(t)==standardlength or len(t)==standardlength-1: + value=comp.L2DiffInterval(V,RV_ref,self.sdt,j,self.tL[-2]) + value=value/normRV_ref + block += " & $"+ str("%8.4f"%(value))+"$" + else: + block+=" & - " + block+='\\\\\n' + if l<self.lL[-1]: + block+='\cmidrule(r){1-2}\n' + block+='\cmidrule(lr){3-'+str(len(fL)+2)+'}\n' + block+='\cmidrule(l){'+str(len(fL)+4)+'-'+str(2*len(fL)+3)+'}\n' + + block+='\\bottomrule\n' + block +=self.EndTabular() + return block + def writeExtraErrorTab(self,fL,nL,p,case): block = '' @@ -2122,7 +2180,7 @@ class Table: block+='\cmidrule(lr){3-'+str(len(fL)+2)+'}\n' tact_ref=comp.getTextFullExtrapolate(self.lL[-1],self.tL[-1],1,p,self.exP,th,case) (t_f,VInt_full)=comp.getVIntFullExtrapolate(self.lL[-1],self.tL[-1],1,p,self.exP,self.sdt,th,durEvalActi,tact_ref,case) - ´norm_full=comp.L2(VInt_full,self.sdt,self.T,self.tL[-2],False) + norm_full=comp.L2(VInt_full,self.sdt,self.T,self.tL[-2],False) for l in self.lL: block+='$\\ell='+str(l)+'$' @@ -2904,9 +2962,14 @@ class TableWriter: output_file.write(self.tab.writeExtraErrorTab(fN,nL,p,case)) output_file.write(self.tab.writeEndTable()) def writeVolumesExtraError(self,path,fN,savePath,nL): - cap='Der Fehler $\\errorLV^{j,\ell}$ bzw. $\\errorRV^{j,\ell}$ der Näherungslösungen bezüglich der Orts-Zeit-Grenzwertlösung $\\LV'+'^{\\infty,\\infty,}$ bzw.$\\RV'+'^{\\infty,\\infty,}$ in der $\\LtwonormT$-Norm auf dem biventrikulären Gebiet' + cap='Der Fehler $\\errorLV^{j,\ell}$ bzw. $\\errorRV^{j,\ell}$ der Näherungslösungen bezüglich der Orts-Zeit-Grenzwertlösung $\\LV'+'^{\\infty,\\infty,}$ bzw. $\\RV'+'^{\\infty,\\infty,}$ in der $\\LtwonormT$-Norm auf dem biventrikulären Gebiet' label ='tab:ErrorVolumes' filename=savePath +'ErrorVolumes' + with open(filename+'.tex', 'w') as output_file: + output_file.write(self.tab.writeBeginTable('h')) + output_file.write(self.tab.writeCaption(cap, label)) + output_file.write(self.tab.writeExtraErrorVolumes(fN,nL)) + output_file.write(self.tab.writeEndTable()) def writeErrorExtraVIntTab(self,path,fN,savePath,nL,threshold,case=''): for p in self.evalP: diff --git a/tools/evaluation/utility/plotting.py b/tools/evaluation/utility/plotting.py index fbf596a8a9e7a8b41de17bd26f31f803a935dec5..affeeb1751bce630f5b7215ec617d099ecb4e339 100644 --- a/tools/evaluation/utility/plotting.py +++ b/tools/evaluation/utility/plotting.py @@ -183,7 +183,6 @@ class Plot: plt.plot(t_f,VInt_full,label = labelname,linewidth=3.5,color=self.colorList[self.lL[-1]+2],linestyle='dashed') if fnfix=='Ca': - V_full=[] V_full=comp.getFullExtrapolate(self.lL[-1],self.tL[-1],self.m,p,self.sdt,self.T,path,fnfix) time_full=np.linspace(self.sdt*2**(-(self.tL[-2])), self.T, num=len(V_full)) (time_full,V_full)=self.resizeData(time_full,V_full,10,len(time_full)) @@ -245,11 +244,24 @@ class Plot: RV[i] = float(RV[i]) (time_lv,LV)=self.resizeData(time_lv,LV,n,len(time_lv)) (time_rv,RV)=self.resizeData(time_rv,RV,n,len(time_rv)) - labelname = 'LV $\\ell='+str(l)+'$' + labelname = '$\\LV$ $\\ell='+str(l)+'$' plt.plot(time_lv,LV, label = labelname,linewidth=2.5,color=self.colorList[l]) - labelname = 'RV $\\ell='+str(l)+'$' + labelname = '$\\RV$ $\\ell='+str(l)+'$' plt.plot(time_rv,RV, label = labelname,linewidth=2.5,color=self.colorList[l],linestyle='dotted') + + LV_ref=comp.getFullExtrapolate(self.lL[-1],self.tL[-1],self.m,1,self.sdt,self.T,path,'Volumes') + time_lv=np.linspace(self.sdt*2**(-(self.tL[-2])), self.T, num=len(LV_ref)) + (time_lv,LV_ref)=self.resizeData(time_lv,LV_ref,10,len(time_lv)) + labelname='$\\LV^{\\infty,\\infty}$' + plt.plot(time_lv,LV_ref,label = labelname,linewidth=2.5,color=self.colorList[self.lL[-1]+1],linestyle='dashed') + + RV_ref=comp.getFullExtrapolate(self.lL[-1],self.tL[-1],self.m,2,self.sdt,self.T,path,'Volumes') + time_rv=np.linspace(self.sdt*2**(-(self.tL[-2])), self.T, num=len(RV_ref)) + (time_rv,RV_ref)=self.resizeData(time_rv,RV_ref,10,len(time_rv)) + labelname='$\\RV^{\\infty,\\infty}$' + plt.plot(time_rv,RV_ref,label = labelname,linewidth=2.5,color=self.colorList[self.lL[-1]+1],linestyle='-.') + plotname ='SpaceVolumes'+ 'j'+str(j) self.plotDataDeutsch(False,'Volumes') self.definePositionOfLegendByPrefix('Volumes') @@ -274,7 +286,7 @@ class Plot: plotname ='TimeVolumes'+ 'l'+str(l) self.plotDataDeutsch(False,'Volumes') self.definePositionOfLegendByPrefix('Volumes') - plt.show() + #plt.show() self.saveTikz(path+'/tex/', plotname) plt.close()