mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 14:15:42 -04:00
added ability to specify filename for plot output ppm
This commit is contained in:
parent
c639961c9f
commit
41b40e58dd
5 changed files with 11 additions and 3 deletions
|
|
@ -180,6 +180,8 @@ physics.o: search.o
|
|||
physics.o: string.o
|
||||
physics.o: tally.o
|
||||
|
||||
plot_header.o: constants.o
|
||||
|
||||
plot.o: constants.o
|
||||
plot.o: error.o
|
||||
plot.o: geometry.o
|
||||
|
|
|
|||
|
|
@ -1127,6 +1127,10 @@ contains
|
|||
pl % id = plot_(i) % id
|
||||
pl % aspect = plot_(i) % aspect
|
||||
|
||||
! Set output file path
|
||||
pl % path_plot = trim(path_input) // trim(to_str(pl % id)) // &
|
||||
"_" // trim(plot_(i) % filename) // ".ppm"
|
||||
|
||||
! Copy plot pixel size
|
||||
if (size(plot_(i) % pixels) == 2) then
|
||||
pl % pixels = plot_(i) % pixels
|
||||
|
|
|
|||
|
|
@ -151,10 +151,8 @@ contains
|
|||
type(Image), intent(in) :: img
|
||||
|
||||
integer :: i, j
|
||||
character(MAX_LINE_LEN) :: path_plot ! unit for binary plot file
|
||||
|
||||
path_plot = trim(path_input) // "slice" // trim(to_str(pl % id)) // ".ppm"
|
||||
open(UNIT=UNIT_PLOT, FILE=path_plot)
|
||||
open(UNIT=UNIT_PLOT, FILE=pl % path_plot)
|
||||
|
||||
write(UNIT_PLOT, '(A2)') 'P6'
|
||||
write(UNIT_PLOT, '(I0,'' '',I0)') img%width, img%height
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
module plot_header
|
||||
|
||||
use constants
|
||||
|
||||
implicit none
|
||||
|
||||
!===============================================================================
|
||||
|
|
@ -16,6 +18,7 @@ module plot_header
|
|||
|
||||
type Plot
|
||||
integer :: id ! Unique ID
|
||||
character(MAX_LINE_LEN) :: path_plot ! path for plot file
|
||||
integer :: type ! Type
|
||||
integer :: color_by ! quantity to color regions by
|
||||
real(8) :: origin(3) ! xyz center of plot location
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@
|
|||
|
||||
<typedef name="plot_xml">
|
||||
<component name="id" type="integer" />
|
||||
<component name="filename" type="word" length="50" default="'plot'" />
|
||||
<component name="type" type="word" length="10" default="'slice'"/>
|
||||
<component name="color" type="word" length="10" default="'cell'"/>
|
||||
<component name="origin" type="double-array" />
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue