Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SWIFTsim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
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
SWIFT
SWIFTsim
Commits
f6f80792
Commit
f6f80792
authored
7 years ago
by
Josh Borrow
Browse files
Options
Downloads
Patches
Plain Diff
Updated movie script and added it to automatically be ran after the production of snapshots
parent
69c00a44
No related branches found
No related tags found
1 merge request
!540
Add Pressure-Energy (P-U) SPH
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
examples/KelvinHelmholtz_2D/makeMovie.py
+19
-6
19 additions, 6 deletions
examples/KelvinHelmholtz_2D/makeMovie.py
examples/KelvinHelmholtz_2D/run.sh
+2
-1
2 additions, 1 deletion
examples/KelvinHelmholtz_2D/run.sh
with
21 additions
and
7 deletions
examples/KelvinHelmholtz_2D/makeMovie.py
+
19
−
6
View file @
f6f80792
...
...
@@ -9,15 +9,10 @@ Edit this file near the bottom with the number of snaps you have.
Written by Josh Borrow (joshua.borrow@durham.ac.uk)
"""
import
matplotlib
matplotlib
.
use
(
"
Agg
"
)
import
os
import
h5py
as
h5
import
numpy
as
np
import
scipy
as
sp
import
scipy.interpolate
as
si
import
matplotlib.pyplot
as
plt
def
load_and_extract
(
filename
):
...
...
@@ -67,14 +62,32 @@ def frame(n, *args):
if
__name__
==
"
__main__
"
:
import
matplotlib
matplotlib
.
use
(
"
Agg
"
)
from
tqdm
import
tqdm
from
matplotlib.animation
import
FuncAnimation
from
scipy.stats
import
gaussian_kde
import
matplotlib.pyplot
as
plt
filename
=
"
kelvinhelmholtz
"
dpi
=
512
frames
=
tqdm
(
np
.
arange
(
0
,
448
))
# Look for the number of files in the directory.
i
=
0
while
True
:
if
os
.
path
.
isfile
(
"
{}_{:04d}.hdf5
"
.
format
(
filename
,
i
)):
i
+=
1
else
:
break
if
i
>
10000
:
raise
FileNotFoundError
(
"
Could not find the snapshots in the directory
"
)
frames
=
tqdm
(
np
.
arange
(
0
,
i
))
# Creation of first frame
fig
,
ax
=
plt
.
subplots
(
1
,
1
,
figsize
=
(
1
,
1
),
frameon
=
False
)
...
...
This diff is collapsed.
Click to expand it.
examples/KelvinHelmholtz_2D/run.sh
+
2
−
1
View file @
f6f80792
...
...
@@ -8,7 +8,8 @@ then
fi
# Run SWIFT
../swift
-s
-t
1
kelvinHelmholtz.yml 2>&1 |
tee
output.log
../swift
-s
-t
4
kelvinHelmholtz.yml 2>&1 |
tee
output.log
# Plot the solution
python plotSolution.py 6
python makeMovie.py
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