Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
OPAL
src
Commits
c0ad5e53
Commit
c0ad5e53
authored
Jan 04, 2017
by
frey_m
Browse files
AMR test case: Print some info when plotting.
modified: ippl/test/AMR/amr_plot_tools/field.py
parent
adffd9d7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
0 deletions
+13
-0
ippl/test/AMR/amr_plot_tools/field.py
ippl/test/AMR/amr_plot_tools/field.py
+13
-0
No files found.
ippl/test/AMR/amr_plot_tools/field.py
View file @
c0ad5e53
...
...
@@ -46,11 +46,18 @@ try:
plt
=
doGridPlot
(
i
,
j
,
val
,
"horizontal grid"
,
"vertical grid"
,
r
'$E_x$ [V/m]'
)
plt
.
savefig
(
f
+
'_slice_z_Ex.png'
)
#, bbox_inches='tight')
print
(
"max. Ex: "
,
max
(
val
))
print
(
"min. Ex: "
,
min
(
val
))
# electric field in vertical direction
val
=
np
.
extract
(
data
[:,
2
]
==
mid
,
data
[:,
4
])
plt
=
doGridPlot
(
i
,
j
,
val
,
"horizontal grid"
,
"vertical grid"
,
r
'$E_y$ [V/m]'
)
plt
.
savefig
(
f
+
'_slice_z_Ey.png'
)
#bbox_inches='tight')
print
(
"max. Ey: "
,
max
(
val
))
print
(
"min. Ey: "
,
min
(
val
))
# center in z
mid
=
int
(
0.5
*
max
(
data
[:,
0
]))
i
=
np
.
extract
(
data
[:,
0
]
==
mid
,
data
[:,
1
])
...
...
@@ -59,6 +66,9 @@ try:
plt
=
doGridPlot
(
i
,
j
,
val
,
"vertical grid"
,
"longitudinal grid"
,
r
'$E_z$ [V/m]'
)
plt
.
savefig
(
f
+
'_slice_x_Ez.png'
)
# bbox_inches='tight')
print
(
"max. Ez: "
,
max
(
val
))
print
(
"min. Ez: "
,
min
(
val
))
elif
'scalar'
in
f
:
data
=
match
(
f
,
scalar_field_pattern
)
...
...
@@ -92,6 +102,9 @@ try:
plt
=
doGridPlot
(
i
,
j
,
val
,
"horizontal grid"
,
"vertical grid"
,
clab
)
plt
.
savefig
(
f
+
'_slice_z.png'
)
# bbox_inches='tight')
print
(
"max. value (slice z): "
,
max
(
val
))
print
(
"min. value (slice z): "
,
min
(
val
))
else
:
raise
RuntimeError
(
'This type of file is not supported.'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment