diff --git a/tools/evaluation/thesisCoupled.py b/tools/evaluation/thesisCoupled.py index 505957d0fe37a836bb75b592a65a675e8795e53b..b232973ee14a9ca3ed1833de746fbab973b50d60 100644 --- a/tools/evaluation/thesisCoupled.py +++ b/tools/evaluation/thesisCoupled.py @@ -209,34 +209,77 @@ def plotSchwinger(): plot.Unterschwinger(fL,nL,threshold,p,j,savePath) plot.Oberschwinger(fL,nL,threshold,p,j,savePath) - -def MechTimeStepTestTable(): +def PlottingForAdaptive(): lL=[2] tL=[0,1,2] sdt=0.0004 endTime=0.6 listEvaluationPoints=[2,3,4,5,6,7,8,9] - nL=['${\\vartriangle}t^{\\mathrm{m}}={\\vartriangle}t^{\\mathrm{e}}$ ','${\\vartriangle}t^{\\mathrm{m}}=0.0008$\, s','${\\vartriangle}t^{\\mathrm{m}}=0.0016$\, s'] - fL=[fSISVI,fMech0008,fMech0016] + l=2 - #read.writeVolumeDataInFile(fMechAdaptive,lL,[2],1) + read.writeVolumeDataInFile(fMechAdaptive,lL,[0],1) + read.writeGammaDataInFile(fMechAdaptive,lL,[0],1,len(listEvaluationPoints),True) lvRvLabel=["LV volume", "RV volume"] - #vol, dataTime, dataStep = read.VolumeDataFromLog(fMechAdaptive, read.createFilename(l,0,1)) - #for i in range(len(vol)): - #plt.plot(dataTime, vol[i], label ='j=0'+ lvRvLabel[i]+', $\ell='+str(l)+'$',linewidth=2.5) + vol, dataTime, dataStep = read.VolumeDataFromLog(fMechAdaptive, read.createFilename(l,0,1)) + for i in range(len(vol)): + plt.plot(dataTime, vol[i], label ='j=0'+ lvRvLabel[i]+', $\ell='+str(l)+'$',linewidth=2.5) + + stepSize=[] + for i in range(len(dataTime)-1): + stepSize.append(100000*(dataTime[i+1]-dataTime[i])) + + plt.plot(dataTime[:-1],stepSize,label='Time j=0',linewidth=2.5) #vol, dataTime, dataStep = read.VolumeDataFromLog(fMechAdaptive, read.createFilename(l,2,1)) #for i in range(len(vol)): #plt.plot(dataTime, vol[i], label ='j=2'+ lvRvLabel[i]+', $\ell='+str(l)+'$',linewidth=2.5) - + #stepSize=[] + #for i in range(len(dataTime)-1): + # stepSize.append(100000*(dataTime[i+1]-dataTime[i])) + #plt.plot(dataTime[:-1],stepSize,label='Time j=2',linewidth=2.5) + vol, dataTime, dataStep = read.VolumeDataFromLog(fMech0016, read.createFilename(l,0,1)) #for i in range(len(vol)): #plt.plot(dataTime, vol[i], label = 'MechDT=0.0016 j=0 '+lvRvLabel[i]+', $\ell='+str(l)+'$',linewidth=2.5) vol_full, dataTime_full, dataStep = read.VolumeDataFromLog(fSISVI, read.createFilename(l,0,1)) - #for i in range(len(vol)): - #plt.plot(dataTime_full, vol_full[i], label = 'Full j=0 '+lvRvLabel[i]+', $\ell='+str(l)+'$',linewidth=2.5,linestyle='dotted') + for i in range(len(vol)): + plt.plot(dataTime_full, vol_full[i], label = 'Full j=0 '+lvRvLabel[i]+', $\ell='+str(l)+'$',linewidth=2.5,linestyle='dotted') + + (time,V)= read.getDataFromTXT(fMechAdaptive,read.createFilename(l,0,1)+'Gamma',10) + steigung=[] + for i in range(len(V)-1): + #print(V[i]-V[i+1],abs(V[i]-V[i+1])) + steigung.append(10*abs(V[i]-V[i+1])/abs(time[i]-time[i+1])) + + plt.plot(time[1:],steigung, label = 'steigung in j='+str(0),linewidth=2.5) + for i in range(len(V)): + V[i]*=100 + plt.plot(time,V, label = 'gamma in j='+str(0),linewidth=2.5) + + #(time,V)= read.getDataFromTXT(fMechAdaptive,read.createFilename(l,2,1)+'Gamma',10) + #steigung=[] + #for i in range(len(V)-1): + #print(V[i]-V[i+1],abs(V[i]-V[i+1])) + #steigung.append(10*abs(V[i]-V[i+1])/abs(time[i]-time[i+1])) + + #plt.plot(time[1:],steigung, label = 'steigung in j='+str(2),linewidth=2.5) + #for i in range(len(V)): + #V[i]*=100 + #plt.plot(time,V, label = 'gamma in j='+str(2),linewidth=2.5) + + (time,V)= read.getDataFromTXT(fSISVI,read.createFilename(l,0,1)+'Gamma',10) + steigung=[] + for i in range(len(V)-1): + #print(V[i]-V[i+1],abs(V[i]-V[i+1])) + steigung.append(10*abs(V[i]-V[i+1])/abs(time[i]-time[i+1])) + + plt.plot(time[1:],steigung, label = 'SISVI steigung in j='+str(0),linewidth=2.5) + for i in range(len(V)): + V[i]*=100 + plt.plot(time,V, label = 'SISVI gamma in j='+str(0),linewidth=2.5) + diff =[] n=int((len(vol_full[0])-1)/(len(vol[0])-1)) #print(len(vol_full[0]),len(vol[0]),n) @@ -247,7 +290,17 @@ def MechTimeStepTestTable(): plt.legend(bbox_to_anchor=(1.05,1.00), loc="upper left") plt.xlabel('Zeit (s)') plt.ylabel('Volumen (ml)') - #plt.show() + plt.show() + +def MechTimeStepTestTable(): + lL=[2] + tL=[0,1,2] + sdt=0.0004 + endTime=0.6 + listEvaluationPoints=[2,3,4,5,6,7,8,9] + nL=['${\\vartriangle}t^{\\mathrm{m}}={\\vartriangle}t^{\\mathrm{e}}$ ','${\\vartriangle}t^{\\mathrm{m}}=0.0008$\, s','${\\vartriangle}t^{\\mathrm{m}}=0.0016$\, s'] + fL=[fSISVI,fMech0008,fMech0016] + #read.writeVolumeDataInFile(fMech0016,lL,tL,1) #read.writeDataInFile(fMech0008,lL,tL,1) #read.writeDataInFile(fMech0016,lL,tL,1) @@ -524,7 +577,8 @@ if __name__=="__main__": ################################ #MechTimeStep listEvaluationPoints ################################## - MechTimeStepTestTable() + #MechTimeStepTestTable() + PlottingForAdaptive() ###################################### diff --git a/tools/solving/CoupledHoreka.py b/tools/solving/CoupledHoreka.py index e9b6c5d96278689ecb1e39113b317e444b5c7fc4..be2abf3303dff9604fa07dea118e2e0fdf500037 100644 --- a/tools/solving/CoupledHoreka.py +++ b/tools/solving/CoupledHoreka.py @@ -211,10 +211,11 @@ def startAll(): def startAdaptiveTimeStep(): lL=[2] - tL=[0] + tL=[0,1,2] nL=['SI'] sdt=0.0004 - startJobs(lL,tL,nL,sdt,'adaptive/',{'Mesh':'TestBiventricleSimpleExcitation_smooth','ElphyProblem':'DeformedBiventricleCoarse','EndTime':0.15,'MechDeltaTime':0.0016,'AdaptiveTimeStepForMech':'true','MaximalGammaInf':0.3,'FactorMaximalGammaInf':0.8}) + startJobs(lL,tL,nL,sdt,'adaptive16/',{'Mesh':'TestBiventricleSimpleExcitation_smooth','ElphyProblem':'DeformedBiventricleCoarse','EndTime':0.6,'MechDeltaTime':0.0016,'AdaptiveTimeStepForMech':'true','MaximalGammaInf':0.3,'FactorMaximalGammaInf':0.8}) + startJobs(lL,tL,nL,sdt,'adaptive32/',{'Mesh':'TestBiventricleSimpleExcitation_smooth','ElphyProblem':'DeformedBiventricleCoarse','EndTime':0.6,'MechDeltaTime':0.0032,'AdaptiveTimeStepForMech':'true','MaximalGammaInf':0.3,'FactorMaximalGammaInf':0.8}) def startFixedMechTimeStep(): lL=[2] @@ -223,14 +224,14 @@ def startFixedMechTimeStep(): sdt=0.0004 #startJobs(lL,tL,nL,sdt,'Mech00016/',{'Mesh':'TestBiventricleSimpleExcitation_smooth','ElphyProblem':'DeformedBiventricleCoarse','EndTime':0.6,'MechDeltaTime':0.0016}) tL=[2] - startJobs(lL,tL,nL,sdt,'Mech00008/',{'Mesh':'TestBiventricleSimpleExcitation_smooth','ElphyProblem':'DeformedBiventricleCoarse','EndTime':0.6,'MechDeltaTime':0.0008}) + startJobs(lL,tL,nL,sdt,'Mech000032/',{'Mesh':'TestBiventricleSimpleExcitation_smooth','ElphyProblem':'DeformedBiventricleCoarse','EndTime':0.6,'MechDeltaTime':0.0032}) if __name__=="__main__": #startSIOC() #startSI() #startGS() #startAll() - #startFixedMechTimeStep() + startFixedMechTimeStep() startAdaptiveTimeStep()