Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
LDD-for-two-phase-flow-systems
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
David Seus
LDD-for-two-phase-flow-systems
Commits
678a04ba
Commit
678a04ba
authored
Jul 7, 2020
by
David
Browse files
Options
Downloads
Patches
Plain Diff
add hilfskripte von Jim
parent
eb59234a
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
Hilfsskripte/merge_spacetime_errornorms.py
+52
-0
52 additions, 0 deletions
Hilfsskripte/merge_spacetime_errornorms.py
with
52 additions
and
0 deletions
Hilfsskripte/merge_spacetime_errornorms.py
0 → 100755
+
52
−
0
View file @
678a04ba
#!/usr/bin/python3
import
csv
isRichards
=
{
1
:
True
,
2
:
False
,
3
:
False
,
4
:
False
,
5
:
True
,
}
resolutions
=
{
1
:
5e-5
,
2
:
5e-5
,
4
:
5e-5
,
8
:
5e-5
,
16
:
4e-5
,
32
:
4e-6
,
64
:
3e-6
,
128
:
2e-6
,
256
:
1e-6
,
}
for
subdomain
,
isR
in
isRichards
.
items
():
subdomain_has_phases
=
[
"
wetting
"
]
if
not
isR
:
subdomain_has_phases
=
[
"
wetting
"
,
"
nonwetting
"
]
for
phase
in
subdomain_has_phases
:
merge_filename
=
f
"
subdomain
{
subdomain
}
"
+
\
f
"
-space-time-errornorm-
{
phase
}
-phase.csv
"
with
open
(
merge_filename
,
'
w
'
,
newline
=
''
)
as
mergefile
:
mergefile_writer
=
csv
.
writer
(
mergefile
,
delimiter
=
'
'
,)
# write header into merge five
mergefile_writer
.
writerow
(
[
'
mesh_parameter
'
,
'
mesh_h
'
,
'
Linf
'
,
'
L1
'
,
'
L2
'
]
)
for
meshrez
in
resolutions
.
keys
():
input_filename
=
f
"
subdomain
{
subdomain
}
"
+
\
f
"
-space-time-errornorm-
{
phase
}
-phase
"
+
\
f
"
_meshrez
{
meshrez
}
.csv
"
try
:
print
(
f
"
found
{
input_filename
}
"
)
with
open
(
input_filename
,
'
r
'
,
newline
=
''
)
as
inputfile
:
inputfile_reader
=
csv
.
reader
(
inputfile
,
delimiter
=
'
'
)
# skip header
next
(
inputfile_reader
)
for
row
in
inputfile_reader
:
mergefile_writer
.
writerow
(
row
)
except
IOError
:
print
(
"
File not accessible or nonexistant
"
)
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