From 8483b3fc2a6f8a8a3141dd5de6e5d03b2f9c3e1b Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Wed, 4 Jan 2012 19:45:31 -0500 Subject: [PATCH 1/3] Removed recalculate attribute from NuclideMicroXS. --- src/ace_header.F90 | 1 - src/cross_section.F90 | 12 +++--------- src/physics.F90 | 7 ------- 3 files changed, 3 insertions(+), 17 deletions(-) diff --git a/src/ace_header.F90 b/src/ace_header.F90 index 0b838fb8c9..3caa5eb563 100644 --- a/src/ace_header.F90 +++ b/src/ace_header.F90 @@ -197,7 +197,6 @@ module ace_header ! Information for URR probability table use logical :: use_ptable ! in URR range with probability tables? - logical :: recalculate ! indicate whether we need to recalculate ptables end type NuclideMicroXS !=============================================================================== diff --git a/src/cross_section.F90 b/src/cross_section.F90 index fbec5221ee..18706fe1e8 100644 --- a/src/cross_section.F90 +++ b/src/cross_section.F90 @@ -168,11 +168,9 @@ contains ! probability tables, we need to determine cross sections from the table if (urr_ptables_on .and. nuc % urr_present) then - if (micro_xs(index_nuclide) % recalculate) then - if (p % E > nuc % urr_data % energy(1) .and. & - p % E < nuc % urr_data % energy(nuc % urr_data % n_energy)) then - call calculate_urr_xs(p, index_nuclide) - end if + if (p % E > nuc % urr_data % energy(1) .and. & + p % E < nuc % urr_data % energy(nuc % urr_data % n_energy)) then + call calculate_urr_xs(p, index_nuclide) end if end if @@ -365,10 +363,6 @@ contains micro_xs(index_nuclide) % fission end if - ! As long as the energy of the neutron doesn't change, we don't need to - ! recalculate probability table data - micro_xs(index_nuclide) % recalculate = .false. - end subroutine calculate_urr_xs !=============================================================================== diff --git a/src/physics.F90 b/src/physics.F90 index 27312d72bb..767dcc2aa5 100644 --- a/src/physics.F90 +++ b/src/physics.F90 @@ -66,9 +66,6 @@ contains ! Initialize number of events to zero n_event = 0 - ! Set recalculate ptables to true by default - micro_xs(:) % recalculate = .true. - ! find energy index, interpolation factor do while (p % alive) @@ -200,10 +197,6 @@ contains ! Reset number of particles banked during collision p % n_bank = 0 - ! Since a collision has occurred, we need to recalculate probability tables - ! for any nuclide - micro_xs(:) % recalculate = .true. - end subroutine collision !=============================================================================== From cff7a565251ee8ac0e68b20cecd152e19685c6ef Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Thu, 5 Jan 2012 22:03:14 -0500 Subject: [PATCH 2/3] Added core map plotting capability. --- src/utils/plot_map.py | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100755 src/utils/plot_map.py diff --git a/src/utils/plot_map.py b/src/utils/plot_map.py new file mode 100755 index 0000000000..de73335f43 --- /dev/null +++ b/src/utils/plot_map.py @@ -0,0 +1,35 @@ +#!/usr/bin/env python + +import sys + +import numpy as np +import matplotlib.pyplot as pyplot + +axial_level = 10 + +# Get filename and file object +filename = sys.argv[1] +fh = open(filename,'r') + +# Read size of mesh +words = fh.readline().split() +nx, ny, nz = [int(item) for item in words] + +# Read values +value_dict = {} +for line in fh: + words = line.split() + i, j, k = [int(item) for item in words[:3]] + value = float(words[3]) + value_dict[i,j,k] = value + +# Set up matrix +matrix = np.array([[value_dict[i+1,j+1,axial_level] for i in range(nx)] + for j in range(ny)]) + +# Make figure +pyplot.pcolor(matrix) +pyplot.colorbar() +pyplot.xticks([]) +pyplot.yticks([]) +pyplot.show() From b4844ee9f803dee231edd1f8a5a7b04acefe131b Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Fri, 6 Jan 2012 12:49:06 -0500 Subject: [PATCH 3/3] Small changes to core map script. --- src/utils/{plot_map.py => core_map.py} | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) rename src/utils/{plot_map.py => core_map.py} (90%) diff --git a/src/utils/plot_map.py b/src/utils/core_map.py similarity index 90% rename from src/utils/plot_map.py rename to src/utils/core_map.py index de73335f43..4b5e7f7b8a 100755 --- a/src/utils/plot_map.py +++ b/src/utils/core_map.py @@ -5,10 +5,9 @@ import sys import numpy as np import matplotlib.pyplot as pyplot -axial_level = 10 - # Get filename and file object filename = sys.argv[1] +axial_level = int(sys.argv[2]) fh = open(filename,'r') # Read size of mesh @@ -30,6 +29,8 @@ matrix = np.array([[value_dict[i+1,j+1,axial_level] for i in range(nx)] # Make figure pyplot.pcolor(matrix) pyplot.colorbar() +pyplot.xlim([0,nx]) +pyplot.ylim([0,ny]) pyplot.xticks([]) pyplot.yticks([]) pyplot.show()