Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
CardMech
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
KIT
Mpp
CardMech
Commits
e979c427
Commit
e979c427
authored
7 months ago
by
Laura Lindner
Browse files
Options
Downloads
Patches
Plain Diff
start adaptive
parent
dce684df
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!273
fixed hopefully problem with computing displacement by depending mechassamble...
Pipeline
#359387
failed
7 months ago
Stage: build
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
tools/evaluation/thesisCoupled.py
+67
-13
67 additions, 13 deletions
tools/evaluation/thesisCoupled.py
tools/solving/CoupledHoreka.py
+5
-4
5 additions, 4 deletions
tools/solving/CoupledHoreka.py
with
72 additions
and
17 deletions
tools/evaluation/thesisCoupled.py
+
67
−
13
View file @
e979c427
...
...
@@ -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
()
######################################
...
...
This diff is collapsed.
Click to expand it.
tools/solving/CoupledHoreka.py
+
5
−
4
View file @
e979c427
...
...
@@ -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
,
'
Mech0000
8
/
'
,{
'
Mesh
'
:
'
TestBiventricleSimpleExcitation_smooth
'
,
'
ElphyProblem
'
:
'
DeformedBiventricleCoarse
'
,
'
EndTime
'
:
0.6
,
'
MechDeltaTime
'
:
0.00
08
})
startJobs
(
lL
,
tL
,
nL
,
sdt
,
'
Mech0000
32
/
'
,{
'
Mesh
'
:
'
TestBiventricleSimpleExcitation_smooth
'
,
'
ElphyProblem
'
:
'
DeformedBiventricleCoarse
'
,
'
EndTime
'
:
0.6
,
'
MechDeltaTime
'
:
0.00
32
})
if
__name__
==
"
__main__
"
:
#startSIOC()
#startSI()
#startGS()
#startAll()
#
startFixedMechTimeStep()
startFixedMechTimeStep
()
startAdaptiveTimeStep
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment