From cad6f384ae4dbfc4e6373991fa164f92570f8d24 Mon Sep 17 00:00:00 2001 From: Laura Pfeiffer <laura.pfeiffer@kit.edu> Date: Mon, 15 Jul 2024 15:10:06 +0200 Subject: [PATCH] fehlende Rechnugnen in Tabellen integriert --- tools/evaluation/thesisBiventricle.py | 57 +++++++++---------------- tools/evaluation/thesisCoupled.py | 31 +++++++++++--- tools/evaluation/utility/latexTables.py | 13 +++--- 3 files changed, 53 insertions(+), 48 deletions(-) diff --git a/tools/evaluation/thesisBiventricle.py b/tools/evaluation/thesisBiventricle.py index 27833b79f..c45fc24df 100644 --- a/tools/evaluation/thesisBiventricle.py +++ b/tools/evaluation/thesisBiventricle.py @@ -12,6 +12,10 @@ fSIICI=eP+'SIICI0004/' fGS=eP+'GS0004/theta1/' #'../../../data/biventricleTT/SimpleExcitation/GerachDiffusion/GS0004/theta1/' fGShalve=eP+'GS0004/' +nL=['\\SISVI','\\SIOC','\\SIICI','\\GPDE']#,'\\GShalve'] +fL=[fSISVI,fSIOC,fSIICI,fGS]#,fGShalve] +nL=['\\SISVI','\\SIOC','\\GPDE'] +fL=[fSISVI,fSIOC,fGS] threshold=-50.0 @@ -35,8 +39,7 @@ def DifferencePerPointTabs(case): listEvaluationPoints=[1,2,3,4,5,6,7,8,9] - nL=['\\SISVI','\\SIOC','\\SIICI','\\GPDE']#,'\\GShalve'] - fL=[fSISVI,fSIOC,fSIICI,fGS]#,fGShalve] + tabWriter = TableWriter(lL,tL,sdt,endTime,1,[fSIOC],listEvaluationPoints) savePath='../../../thesis-lindner/thesis/tables/erstmal/TTGD/' @@ -52,8 +55,6 @@ def tactValuesAndErrorPerPoint(): endTime=0.65 listEvaluationPoints=[2,3,4,5,6,7,8,9] - nL=['\\SISVI','\\SIOC','\\SIICI','\\GPDE']#,'\\GShalve'] - fL=[fSISVI,fSIOC,fSIICI,fGS]#,fGShalve] tabWriter = TableWriter(lL,tL,sdt,endTime,1,[fSIOC],listEvaluationPoints) savePath='../../../thesis-lindner/thesis/tables/erstmal/TTGD/' @@ -66,8 +67,6 @@ def ErrorExtraVInt(): endTime=0.65 listEvaluationPoints=[2,3,4,5,6,7,8,9] - nL=['\\SISVI','\\SIOC','\\SIICI','\\GPDE']#,'\\GShalve'] - fL=[fSISVI,fSIOC,fSIICI,fGS]#,fGShalve] savePath='../../../thesis-lindner/thesis/tables/erstmal/TTGD/' tabWriter = TableWriter(lL,tL,sdt,endTime,1,[fSIOC],listEvaluationPoints) @@ -83,8 +82,7 @@ def AllValueTabs(): savePath='../../../thesis-lindner/thesis/tables/erstmal/TTGD/' - nL=['\\SISVI','\\SIOC','\\SIICI','\\GPDE']#,'\\GShalve'] - fL=[fSISVI,fSIOC,fSIICI,fGS]#,fGShalve] + #read.writeDataInFile(fSISVI,lL,tL,1) #read.writeDataInFile(fSIOC,lL,tL,1) @@ -107,8 +105,6 @@ def plotSchwinger(): listEvaluationPoints=[2,3,4,5,6,7,8,9] listEvaluationPoints=[8] - nL=['\\SISVI','\\SIOC','\\SIICI','\\GPDE']#,'\\GShalve'] - fL=[fSISVI,fSIOC,fSIICI,fGS]#,fGShalve] savePath='../../../thesis-lindner/thesis/images/erstmal/' plot=Plot(lL,tL,sdt,endTime,1,listEvaluationPoints) @@ -132,10 +128,7 @@ def plotExtraError(): endTime=0.65 listEvaluationPoints=[2,3,4,5,6,7,8,9] listEvaluationPoints=[8] - - nL=['\\SISVI','\\SIOC','\\SIICI','\\GPDE'] - fL=[fSISVI,fSIOC,fSIICI,fGS] - + savePath='../../../thesis-lindner/thesis/images/erstmal/' plot=Plot(lL,tL,sdt,endTime,1,listEvaluationPoints) j=tL[-1] @@ -150,10 +143,7 @@ def plotTactErrorPerPoint(): endTime=0.65 listEvaluationPoints=[2,3,4,5,6,7,8,9] listEvaluationPoints=[8] - - nL=['\\SISVI','\\SIOC','\\SIICI','\\GPDE'] - fL=[fSISVI,fSIOC,fSIICI,fGS] - + savePath='../../../thesis-lindner/thesis/images/erstmal/' plot=Plot(lL,tL,sdt,endTime,1,listEvaluationPoints) j=tL[-1] @@ -170,8 +160,6 @@ def plotSchwinger(): listEvaluationPoints=[2,3,4,5,6,7,8,9] listEvaluationPoints=[8] - nL=['\\SISVI','\\SIOC','\\SIICI','\\GPDE'] - fL=[fSISVI,fSIOC,fSIICI,fGS] savePath='../../../thesis-lindner/thesis/images/erstmal/' plot=Plot(lL,tL,sdt,endTime,1,listEvaluationPoints) @@ -187,20 +175,17 @@ def WriteDurationPerTimeStepTab(): sdt=0.0004 endTime=0.004 eP='../../../data/biventricleTT/SimpleExcitation/GerachDiffusion/TimeTest/' - fN=['logSId','logSIOCd','logSIICId','logGStheta1d']#,'logGSAddd'] #,'logGSd' - nL=['\\SISVI','\\SIOC','\\SIICI','\\GPDE']#,'\\GShalve'] + sP='../../../thesis-lindner/thesis/tables/erstmal/TTGD/' - tabWriter = TableWriter(lL,tL,sdt,endTime,1,[fN[0]],[]) - tabWriter.writeComparisionDurationTab(eP,fN,sP,nL,5) + tabWriter = TableWriter(lL,tL,sdt,endTime,1,[fL[0]],[]) + tabWriter.writeComparisionDurationTab(eP,fL,sP,nL,5) def WorkPrecisonDiagram(case): lL=[2,3,4,5] tL=[0,1,2,3] sdt=0.0004 endTime=0.65 listEvaluationPoints=[2,3,4,5,6,7,8,9] - - nL=['\\SISVI','\\SIOC','\\SIICI','\\GPDE'] - fL=[fSISVI,fSIOC,fSIICI,fGS] + casename='' j=0 l=0 @@ -249,15 +234,15 @@ if __name__=="__main__": diffcase='VDiffInt' #DifferencePerPointTabs(diffcase) #activationTimeExtrapolateTab() - #tactValuesAndErrorPerPoint() - plotTactErrorPerPoint() - ErrorExtraVInt() + tactValuesAndErrorPerPoint() + #plotTactErrorPerPoint() + #ErrorExtraVInt() #WriteDurationPerTimeStepTab() - WorkPrecisonDiagram('') - WorkPrecisonDiagram('Grob') - WorkPrecisonDiagram('tact') - WorkPrecisonDiagram('tactGrob') + #WorkPrecisonDiagram('') + #WorkPrecisonDiagram('Grob') + #WorkPrecisonDiagram('tact') + #WorkPrecisonDiagram('tactGrob') + #plotSchwinger() + #plotExtraError() #plotSchwinger() - plotExtraError() - plotSchwinger() diff --git a/tools/evaluation/thesisCoupled.py b/tools/evaluation/thesisCoupled.py index 17cb29a86..3a6b8c669 100644 --- a/tools/evaluation/thesisCoupled.py +++ b/tools/evaluation/thesisCoupled.py @@ -51,8 +51,24 @@ def tactValuesAndErrorPerPoint(): tabWriter = TableWriter(lL,tL,sdt,endTime,1,[fSIOC],listEvaluationPoints) savePath='../../../thesis-lindner/thesis/tables/erstmal/coupled/' - tabWriter.writetactAndErrorPerPoint(fL,nL,savePath,threshold) - + tabWriter.writetactAndErrorPerPoint(fL,nL,savePath,threshold,'Coupled') + +def plotTactErrorPerPoint(): + lL=[1,2,3,4] + tL=[0,1,2,3] + sdt=0.0004 + endTime=0.6 + listEvaluationPoints=[2,3,4,5,6,7,8,9] + nL=['\\SISVI','\\SIOC','\\GPDE'] + fL=[fSISVI,fSIOC,fGS] + savePath='../../../thesis-lindner/thesis/images/erstmal/coupled/' + plot=Plot(lL,tL,sdt,endTime,1,listEvaluationPoints) + j=tL[-1] + l=lL[-1] + for p in listEvaluationPoints: + plot.tactErrorInSpace(fL,nL,threshold,p,j,savePath,fSIOC) + plot.tactErrorInTime(fL,nL,threshold,p,l,savePath,fSIOC) + def ErrorExtraVInt(case): lL=[1,2,3,4] tL=[1,2,3,4] @@ -144,9 +160,9 @@ def AllValueTabs(): #nL=['\\SIOC'] #fL=[fSIOC] - #read.writeDataInFile(fSISVI,lL,tL,1) + #read.writeDataInFile(fSISVI,[4],[1],1) #read.writeDataInFile(fSIOC,lL,[0],1) - #read.writeDataInFile(fGS,lL,tL,1) + read.writeDataInFile(fGS,[4],[4],1) @@ -269,7 +285,8 @@ if __name__=="__main__": #DifferencePerPointTabs(diffcase) diffcase='Gamma' #DifferencePerPointTabs(diffcase) - #tactValuesAndErrorPerPoint() + tactValuesAndErrorPerPoint() + plotTactErrorPerPoint() #ErrorExtraVInt('') #WorkPrecisonDiagram('') case='Ca' @@ -282,8 +299,8 @@ if __name__=="__main__": #plotGamma() - plotVolumen() - ErrorExtra('Volumes') + #plotVolumen() + #ErrorExtra('Volumes') #print(read.getActivaitionTimeFromLog(4,4,1, fSIOC, 8,threshold,False,'')) #print(read.getActivaitionTimeFromLog(4,4,1, fSIOC, 8,threshold,True,'')) diff --git a/tools/evaluation/utility/latexTables.py b/tools/evaluation/utility/latexTables.py index d2f1f2001..375b16ff6 100644 --- a/tools/evaluation/utility/latexTables.py +++ b/tools/evaluation/utility/latexTables.py @@ -2202,7 +2202,7 @@ class Table: block+='\cmidrule(lr){3-'+str(len(fL)+2)+'}\n' (t_ref,Vref)=read.getDataFromTXT(self.path,read.createFilename(L,J,1),p) - norm_ref=comp.L2(Vref,self.sdt,self.T,self.tL[-2],False) + norm_ref=comp.L2(Vref,self.sdt,self.T,J-1,False) for l in self.lL: block+='$\\ell='+str(l)+'$' for j in self.tL: @@ -3131,12 +3131,15 @@ class TableWriter: output_file.write(self.tab.writeUnterschwingerPerPoint(fL,nL,p,threshold)) output_file.write(self.tab.writeEndTable()) - def writetactAndErrorPerPoint(self,fL,nL,savePath,threshold): + def writetactAndErrorPerPoint(self,fL,nL,savePath,threshold,experiment=''): for p in self.evalP: tactRef=comp.getTextFullExtrapolate(self.tab.lL[-1],self.tab.tL[-1],1,p,self.tab.exP,threshold) - cap='Aktivierungszeiten $\\tact^{j,\ell,'+self.tab.getPointNamebyNumber(p,True) +'}$ in ms und der Fehler $\\errortact^{j,\ell,'+self.tab.getPointNamebyNumber(p,True) +'}$ bezüglich der Referenzlösung $\\tact^{\Ref,'+str(p)+'}='+str("%8.3f"%(1000.0*tactRef))+'$\,ms auf dem biventrikulären Gebiet mit der vereinfachten Anregung für verschiedene Zeitdiskretisierungsverfahren' - label='tab:TactAndErrorP'+str(p) - filename=savePath+'TactAndErrorP'+str(p) + if experiment=='Coupled': + cap='Aktivierungszeiten $\\tact^{j,\ell,'+self.tab.getPointNamebyNumber(p,True) +'}$ in ms und der Fehler $\\errortact^{j,\ell,'+self.tab.getPointNamebyNumber(p,True) +'}$ bezüglich der Referenzlösung $\\tact^{\\infty,\\infty,'+str(p)+'}='+str("%8.3f"%(1000.0*tactRef))+'$\,ms auf dem biventrikulären Gebiet mit der vereinfachten Anregung für verschiedene Zeitdiskretisierungsverfahren zur Lösung des \\emm' + else: + cap='Aktivierungszeiten $\\tact^{j,\ell,'+self.tab.getPointNamebyNumber(p,True) +'}$ in ms und der Fehler $\\errortact^{j,\ell,'+self.tab.getPointNamebyNumber(p,True) +'}$ bezüglich der Referenzlösung $\\tact^{\\infty,\\infty,'+str(p)+'}='+str("%8.3f"%(1000.0*tactRef))+'$\,ms auf dem biventrikulären Gebiet mit der vereinfachten Anregung für verschiedene Zeitdiskretisierungsverfahren' + label='tab:'+experiment+'TactAndErrorP'+str(p) + filename=savePath+experiment+'TactAndErrorP'+str(p) with open(filename+'.tex', 'w') as output_file: output_file.write(self.tab.writeBeginTable('h')) output_file.write(self.tab.writeCaption(cap, label)) -- GitLab