Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Arepo
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
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
Volker Springel
Arepo
Commits
f278c3f0
Commit
f278c3f0
authored
4 years ago
by
Rainer Weinberger
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' of
https://gitlab.mpcdf.mpg.de/vrs/arepo
parents
20b69921
edb875fb
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
examples/wave_1d/check.py
+8
-2
8 additions, 2 deletions
examples/wave_1d/check.py
with
8 additions
and
2 deletions
examples/wave_1d/check.py
+
8
−
2
View file @
f278c3f0
...
...
@@ -49,6 +49,8 @@ uthermal_0 = pressure_0 / density_0 / gamma_minus_one
solution equals the initial conditions
"""
i_file
=
0
status
=
0
error_data
=
[]
while
True
:
"""
try to read in snapshot
"""
directory
=
simulation_directory
+
"
/output/
"
...
...
@@ -96,9 +98,12 @@ while True:
print
(
"
\t
specific internal energy: %g
"
%
L1_utherm
)
print
(
"
\t
tolerance: %g for %d cells
"
%
(
DeltaMaxAllowed
,
NumberOfCells
)
)
error_data
.
append
(
np
.
array
([
L1_dens
,
L1_vel
,
L1_utherm
],
dtype
=
FloatType
))
"""
criteria for failing the test
"""
if
L1_dens
>
DeltaMaxAllowed
or
L1_vel
>
DeltaMaxAllowed
or
L1_utherm
>
DeltaMaxAllowed
:
s
ys
.
exit
(
1
)
s
tatus
=
1
if
makeplots
and
i_file
>
0
:
if
not
os
.
path
.
exists
(
simulation_directory
+
"
/plots
"
):
...
...
@@ -134,6 +139,7 @@ while True:
f
.
savefig
(
simulation_directory
+
"
plots/velocity.pdf
"
)
i_file
+=
1
np
.
savetxt
(
simulation_directory
+
"
/error_%d.txt
"
%
NumberOfCells
,
np
.
array
(
error_data
))
"""
normal exit
"""
sys
.
exit
(
0
)
sys
.
exit
(
status
)
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