Switched to pointer for plot mesh

This commit is contained in:
Nick Horelik 2014-08-30 03:01:47 -04:00
parent 20ad38e528
commit f108e75be4
3 changed files with 13 additions and 11 deletions

View file

@ -2682,8 +2682,9 @@ contains
subroutine read_plots_xml()
integer i, j
integer n_cols, col_id, n_comp, n_masks, n_meshlines
integer :: i, j
integer :: n_cols, col_id, n_comp, n_masks, n_meshlines
integer :: meshid
integer, allocatable :: iarray(:)
logical :: file_exists ! does plots.xml file exist?
character(MAX_LINE_LEN) :: filename ! absolute path to plots.xml
@ -2973,7 +2974,7 @@ contains
! Ensure that there is a mesh id for this meshlines specification
if (check_for_node(node_meshlines, "mesh")) then
call get_node_value(node_meshlines, "mesh", pl % meshlines_id)
call get_node_value(node_meshlines, "mesh", meshid)
else
message = "Must specify a mesh id for meshlines " // &
"specification in plot " // trim(to_str(pl % id))
@ -3009,16 +3010,16 @@ contains
end if
! Check if the specified tally mesh exists
if (mesh_dict % has_key(pl % meshlines_id)) then
pl % meshlines_id = mesh_dict % get_key(pl % meshlines_id)
if (meshes(pl % meshlines_id) % type /= LATTICE_RECT) then
if (mesh_dict % has_key(meshid)) then
pl % meshlines_mesh => meshes(mesh_dict % get_key(meshid))
if (meshes(meshid) % type /= LATTICE_RECT) then
message = "Non-rectangular mesh specified in meshlines for" // &
" plot " // trim(to_str(pl % id))
call fatal_error()
end if
else
message = "Could not find tally mesh " // &
trim(to_str(pl % meshlines_id)) // &
message = "Could not find mesh " // &
trim(to_str(meshid)) // &
" specified in meshlines for plot " // &
trim(to_str(pl % id))
call fatal_error()

View file

@ -168,7 +168,7 @@ contains
end do
! Draw tally mesh boundaries on the image if requested
if (pl % meshlines_id > 0) call draw_mesh_lines(pl, img)
if (associated(pl % meshlines_mesh)) call draw_mesh_lines(pl, img)
! Write out the ppm to a file
call output_ppm(pl,img)
@ -206,7 +206,7 @@ contains
real(8) :: xyz_ur(3) ! upper right xyz
type(StructuredMesh), pointer :: m => null()
m => meshes(pl % meshlines_id)
m => pl % meshlines_mesh
r = pl % meshlines_color % rgb(1)
g = pl % meshlines_color % rgb(2)

View file

@ -1,6 +1,7 @@
module plot_header
use constants
use mesh_header, only: StructuredMesh
implicit none
@ -25,8 +26,8 @@ module plot_header
real(8) :: width(3) ! xyz widths of plot
integer :: basis ! direction of plot slice
integer :: pixels(3) ! pixel width/height of plot slice
integer :: meshlines_id = -1 ! id of the mesh to plot lines of
integer :: meshlines_width ! pixel width of meshlines
type(StructuredMesh), pointer :: meshlines_mesh => null() ! mesh to plot
type(ObjectColor) :: meshlines_color ! Color for meshlines
type(ObjectColor) :: not_found ! color for positions where no cell found
type(ObjectColor), allocatable :: colors(:) ! colors of cells/mats