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
Container registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
Peter W. Draper
SWIFTsim
Commits
701ab98d
Commit
701ab98d
authored
May 22, 2017
by
Peter W. Draper
Browse files
Options
Downloads
Patches
Plain Diff
Add new drift_gpart task, fix bug in auto ranging, sort tasks for colour reports
parent
7af1bb35
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
examples/plot_tasks.py
+8
-7
8 additions, 7 deletions
examples/plot_tasks.py
with
8 additions
and
7 deletions
examples/plot_tasks.py
+
8
−
7
View file @
701ab98d
...
...
@@ -89,9 +89,10 @@ pl.rcParams.update(PLOT_PARAMS)
# Tasks and subtypes. Indexed as in tasks.h.
TASKTYPES
=
[
"
none
"
,
"
sort
"
,
"
self
"
,
"
pair
"
,
"
sub_self
"
,
"
sub_pair
"
,
"
init_grav
"
,
"
ghost
"
,
"
extra_ghost
"
,
"
drift
"
,
"
kick1
"
,
"
kick2
"
,
"
timestep
"
,
"
send
"
,
"
recv
"
,
"
grav_top_level
"
,
"
grav_long_range
"
,
"
grav_mm
"
,
"
grav_down
"
,
"
cooling
"
,
"
sourceterms
"
,
"
count
"
]
"
init_grav
"
,
"
ghost
"
,
"
extra_ghost
"
,
"
drift_part
"
,
"
drift_gpart
"
,
"
kick1
"
,
"
kick2
"
,
"
timestep
"
,
"
send
"
,
"
recv
"
,
"
grav_top_level
"
,
"
grav_long_range
"
,
"
grav_mm
"
,
"
grav_down
"
,
"
cooling
"
,
"
sourceterms
"
,
"
count
"
]
SUBTYPES
=
[
"
none
"
,
"
density
"
,
"
gradient
"
,
"
force
"
,
"
grav
"
,
"
external_grav
"
,
"
tend
"
,
"
xv
"
,
"
rho
"
,
"
gpart
"
,
"
multipole
"
,
"
spart
"
,
"
count
"
]
...
...
@@ -108,7 +109,7 @@ FULLTYPES = ["self/force", "self/density", "self/grav", "sub_self/force",
colours
=
[
"
cyan
"
,
"
lightgray
"
,
"
darkblue
"
,
"
yellow
"
,
"
tan
"
,
"
dodgerblue
"
,
"
sienna
"
,
"
aquamarine
"
,
"
bisque
"
,
"
blue
"
,
"
green
"
,
"
brown
"
,
"
purple
"
,
"
moca
s
sin
"
,
"
olivedrab
"
,
"
chartreuse
"
,
"
darksage
"
,
"
purple
"
,
"
moc
c
asin
"
,
"
olivedrab
"
,
"
chartreuse
"
,
"
darksage
"
,
"
darkgreen
"
,
"
green
"
,
"
mediumseagreen
"
,
"
mediumaquamarine
"
,
"
darkslategrey
"
,
"
mediumturquoise
"
,
"
black
"
,
"
cadetblue
"
,
"
skyblue
"
,
"
red
"
,
"
slategray
"
,
"
gold
"
,
"
slateblue
"
,
"
blueviolet
"
,
...
...
@@ -134,9 +135,9 @@ for task in SUBTYPES:
# For fiddling with colours...
if
args
.
verbose
:
print
"
#Selected colours:
"
for
task
in
TASKCOLOURS
.
keys
():
for
task
in
sorted
(
TASKCOLOURS
.
keys
()
)
:
print
"
#
"
+
task
+
"
:
"
+
TASKCOLOURS
[
task
]
for
task
in
SUBCOLOURS
.
keys
():
for
task
in
sorted
(
SUBCOLOURS
.
keys
()
)
:
print
"
#
"
+
task
+
"
:
"
+
SUBCOLOURS
[
task
]
# Read input.
...
...
@@ -161,7 +162,7 @@ data = data[data[:,5] != 0]
# Calculate the time range, if not given.
delta_t
=
delta_t
*
CPU_CLOCK
if
delta_t
==
0
:
dt
=
max
(
data
[:,
5
])
-
min
(
data
[:,
4
])
dt
=
toc_step
-
tic_step
if
dt
>
delta_t
:
delta_t
=
dt
print
"
Data range:
"
,
delta_t
/
CPU_CLOCK
,
"
ms
"
...
...
...
...
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
sign in
to comment