mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-27 13:45:36 -04:00
Change StructuredMesh to RegularMesh. Write type as 'regular'.
This commit is contained in:
parent
36a2217487
commit
8753f23059
18 changed files with 53 additions and 55 deletions
|
|
@ -54,7 +54,7 @@ class Mesh(object):
|
|||
# Initialize Mesh class attributes
|
||||
self.id = mesh_id
|
||||
self.name = name
|
||||
self._type = 'rectangular'
|
||||
self._type = 'regular'
|
||||
self._dimension = None
|
||||
self._lower_left = None
|
||||
self._upper_right = None
|
||||
|
|
@ -156,7 +156,7 @@ class Mesh(object):
|
|||
check_type('type for mesh ID="{0}"'.format(self._id),
|
||||
meshtype, basestring)
|
||||
check_value('type for mesh ID="{0}"'.format(self._id),
|
||||
meshtype, ['rectangular', 'hexagonal'])
|
||||
meshtype, ['regular', 'hexagonal'])
|
||||
self._type = meshtype
|
||||
|
||||
@dimension.setter
|
||||
|
|
|
|||
|
|
@ -264,7 +264,7 @@ class StatePoint(object):
|
|||
for mesh_key in mesh_keys:
|
||||
# Read the user-specified Mesh ID and type
|
||||
mesh_id = self._f['{0}{1}/id'.format(base, mesh_key)].value
|
||||
mesh_type = self._f['{0}{1}/type'.format(base, mesh_key)].value
|
||||
mesh_type = self._f['{0}{1}/type'.format(base, mesh_key)].value.decode()
|
||||
|
||||
# Read the mesh dimensions, lower-left coordinates,
|
||||
# upper-right coordinates, and width of each mesh cell
|
||||
|
|
@ -275,14 +275,11 @@ class StatePoint(object):
|
|||
|
||||
# Create the Mesh and assign properties to it
|
||||
mesh = openmc.Mesh(mesh_id)
|
||||
|
||||
mesh.dimension = dimension
|
||||
mesh.width = width
|
||||
mesh.lower_left = lower_left
|
||||
mesh.upper_right = upper_right
|
||||
|
||||
#FIXME: Set the mesh type to 'rectangular' by default
|
||||
mesh.type = 'rectangular'
|
||||
mesh.type = mesh_type
|
||||
|
||||
# Add mesh to the global dictionary of all Meshes
|
||||
self._meshes[mesh_id] = mesh
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ contains
|
|||
use global, only: cmfd, n_cmfd_tallies, cmfd_tallies, meshes,&
|
||||
matching_bins
|
||||
use mesh, only: mesh_indices_to_bin
|
||||
use mesh_header, only: StructuredMesh
|
||||
use mesh_header, only: RegularMesh
|
||||
use string, only: to_str
|
||||
use tally_header, only: TallyObject
|
||||
|
||||
|
|
@ -79,8 +79,8 @@ contains
|
|||
integer :: i_filter_eout ! index for outgoing energy filter
|
||||
integer :: i_filter_surf ! index for surface filter
|
||||
real(8) :: flux ! temp variable for flux
|
||||
type(TallyObject), pointer :: t => null() ! pointer for tally object
|
||||
type(StructuredMesh), pointer :: m => null() ! pointer for mesh object
|
||||
type(TallyObject), pointer :: t ! pointer for tally object
|
||||
type(RegularMesh), pointer :: m ! pointer for mesh object
|
||||
|
||||
! Extract spatial and energy indices from object
|
||||
nx = cmfd % indices(1)
|
||||
|
|
|
|||
|
|
@ -217,7 +217,7 @@ contains
|
|||
use error, only: warning, fatal_error
|
||||
use global, only: meshes, source_bank, work, n_user_meshes, cmfd, &
|
||||
master
|
||||
use mesh_header, only: StructuredMesh
|
||||
use mesh_header, only: RegularMesh
|
||||
use mesh, only: count_bank_sites, get_mesh_indices
|
||||
use search, only: binary_search
|
||||
use string, only: to_str
|
||||
|
|
@ -239,8 +239,7 @@ contains
|
|||
integer :: n_groups ! number of energy groups
|
||||
logical :: outside ! any source sites outside mesh
|
||||
logical :: in_mesh ! source site is inside mesh
|
||||
|
||||
type(StructuredMesh), pointer :: m ! point to mesh
|
||||
type(RegularMesh), pointer :: m ! point to mesh
|
||||
|
||||
! Associate pointer
|
||||
m => meshes(n_user_meshes + 1)
|
||||
|
|
|
|||
|
|
@ -247,7 +247,7 @@ contains
|
|||
|
||||
use constants, only: MAX_LINE_LEN
|
||||
use error, only: fatal_error, warning
|
||||
use mesh_header, only: StructuredMesh
|
||||
use mesh_header, only: RegularMesh
|
||||
use string
|
||||
use tally, only: setup_active_cmfdtallies
|
||||
use tally_header, only: TallyObject, TallyFilter
|
||||
|
|
@ -264,10 +264,10 @@ contains
|
|||
integer :: i_filter_mesh ! index for mesh filter
|
||||
integer :: iarray3(3) ! temp integer array
|
||||
real(8) :: rarray3(3) ! temp double array
|
||||
type(TallyObject), pointer :: t => null()
|
||||
type(StructuredMesh), pointer :: m => null()
|
||||
type(TallyObject), pointer :: t
|
||||
type(RegularMesh), pointer :: m
|
||||
type(TallyFilter) :: filters(N_FILTER_TYPES) ! temporary filters
|
||||
type(Node), pointer :: node_mesh => null()
|
||||
type(Node), pointer :: node_mesh
|
||||
|
||||
! Set global variables if they are 0 (this can happen if there is no tally
|
||||
! file)
|
||||
|
|
|
|||
|
|
@ -327,7 +327,7 @@ module constants
|
|||
RELATIVE_ERROR = 2, &
|
||||
STANDARD_DEVIATION = 3
|
||||
|
||||
! Global tallY parameters
|
||||
! Global tally parameters
|
||||
integer, parameter :: N_GLOBAL_TALLIES = 4
|
||||
integer, parameter :: &
|
||||
K_COLLISION = 1, &
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ module eigenvalue
|
|||
use global
|
||||
use math, only: t_percentile
|
||||
use mesh, only: count_bank_sites
|
||||
use mesh_header, only: StructuredMesh
|
||||
use mesh_header, only: RegularMesh
|
||||
use particle_header, only: Particle
|
||||
use random_lcg, only: prn, set_particle_seed, prn_skip
|
||||
use search, only: binary_search
|
||||
|
|
@ -304,7 +304,7 @@ contains
|
|||
integer :: i, j, k ! index for bank sites
|
||||
integer :: n ! # of boxes in each dimension
|
||||
logical :: sites_outside ! were there sites outside entropy box?
|
||||
type(StructuredMesh), pointer :: m => null()
|
||||
type(RegularMesh), pointer :: m
|
||||
|
||||
! Get pointer to entropy mesh
|
||||
m => entropy_mesh
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ module global
|
|||
use dict_header, only: DictCharInt, DictIntInt
|
||||
use geometry_header, only: Cell, Universe, Lattice, LatticeContainer, Surface
|
||||
use material_header, only: Material
|
||||
use mesh_header, only: StructuredMesh
|
||||
use mesh_header, only: RegularMesh
|
||||
use plot_header, only: ObjectPlot
|
||||
use set_header, only: SetInt
|
||||
use source_header, only: ExtSource
|
||||
|
|
@ -90,7 +90,7 @@ module global
|
|||
! ============================================================================
|
||||
! TALLY-RELATED VARIABLES
|
||||
|
||||
type(StructuredMesh), allocatable, target :: meshes(:)
|
||||
type(RegularMesh), allocatable, target :: meshes(:)
|
||||
type(TallyObject), allocatable, target :: tallies(:)
|
||||
integer, allocatable :: matching_bins(:)
|
||||
|
||||
|
|
@ -203,11 +203,11 @@ module global
|
|||
logical :: entropy_on = .false.
|
||||
real(8), allocatable :: entropy(:) ! shannon entropy at each generation
|
||||
real(8), allocatable :: entropy_p(:,:,:,:) ! % of source sites in each cell
|
||||
type(StructuredMesh), pointer :: entropy_mesh
|
||||
type(RegularMesh), pointer :: entropy_mesh
|
||||
|
||||
! Uniform fission source weighting
|
||||
logical :: ufs = .false.
|
||||
type(StructuredMesh), pointer :: ufs_mesh => null()
|
||||
type(RegularMesh), pointer :: ufs_mesh => null()
|
||||
real(8), allocatable :: source_frac(:,:,:,:)
|
||||
|
||||
! Write source at end of simulation
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ module input_xml
|
|||
use geometry_header, only: Cell, Surface, Lattice, RectLattice, HexLattice
|
||||
use global
|
||||
use list_header, only: ListChar, ListReal
|
||||
use mesh_header, only: StructuredMesh
|
||||
use mesh_header, only: RegularMesh
|
||||
use output, only: write_message
|
||||
use plot_header
|
||||
use random_lcg, only: prn
|
||||
|
|
@ -2091,9 +2091,9 @@ contains
|
|||
character(MAX_WORD_LEN) :: temp_str
|
||||
character(MAX_WORD_LEN), allocatable :: sarray(:)
|
||||
type(DictCharInt) :: trigger_scores
|
||||
type(ElemKeyValueCI), pointer :: pair_list => null()
|
||||
type(TallyObject), pointer :: t => null()
|
||||
type(StructuredMesh), pointer :: m => null()
|
||||
type(ElemKeyValueCI), pointer :: pair_list
|
||||
type(TallyObject), pointer :: t
|
||||
type(RegularMesh), pointer :: m
|
||||
type(TallyFilter), allocatable :: filters(:) ! temporary filters
|
||||
type(Node), pointer :: doc => null()
|
||||
type(Node), pointer :: node_mesh => null()
|
||||
|
|
|
|||
14
src/mesh.F90
14
src/mesh.F90
|
|
@ -20,7 +20,7 @@ contains
|
|||
|
||||
subroutine get_mesh_bin(m, xyz, bin)
|
||||
|
||||
type(StructuredMesh), pointer :: m ! mesh pointer
|
||||
type(RegularMesh), pointer :: m ! mesh pointer
|
||||
real(8), intent(in) :: xyz(:) ! coordinates
|
||||
integer, intent(out) :: bin ! tally bin
|
||||
|
||||
|
|
@ -73,7 +73,7 @@ contains
|
|||
|
||||
subroutine get_mesh_indices(m, xyz, ijk, in_mesh)
|
||||
|
||||
type(StructuredMesh), pointer :: m
|
||||
type(RegularMesh), pointer :: m
|
||||
real(8), intent(in) :: xyz(:) ! coordinates to check
|
||||
integer, intent(out) :: ijk(:) ! indices in mesh
|
||||
logical, intent(out) :: in_mesh ! were given coords in mesh?
|
||||
|
|
@ -98,7 +98,7 @@ contains
|
|||
|
||||
function mesh_indices_to_bin(m, ijk, surface_current) result(bin)
|
||||
|
||||
type(StructuredMesh), pointer :: m
|
||||
type(RegularMesh), pointer :: m
|
||||
integer, intent(in) :: ijk(:)
|
||||
logical, optional :: surface_current
|
||||
integer :: bin
|
||||
|
|
@ -132,7 +132,7 @@ contains
|
|||
|
||||
subroutine bin_to_mesh_indices(m, bin, ijk)
|
||||
|
||||
type(StructuredMesh), pointer :: m
|
||||
type(RegularMesh), pointer :: m
|
||||
integer, intent(in) :: bin
|
||||
integer, intent(out) :: ijk(:)
|
||||
|
||||
|
|
@ -163,7 +163,7 @@ contains
|
|||
subroutine count_bank_sites(m, bank_array, cnt, energies, size_bank, &
|
||||
sites_outside)
|
||||
|
||||
type(StructuredMesh), pointer :: m ! mesh to count sites
|
||||
type(RegularMesh), pointer :: m ! mesh to count sites
|
||||
type(Bank), intent(in) :: bank_array(:) ! fission or source bank
|
||||
real(8), intent(out) :: cnt(:,:,:,:) ! weight of sites in each
|
||||
! cell and energy group
|
||||
|
|
@ -264,7 +264,7 @@ contains
|
|||
|
||||
function mesh_intersects_2d(m, xyz0, xyz1) result(intersects)
|
||||
|
||||
type(StructuredMesh), pointer :: m
|
||||
type(RegularMesh), pointer :: m
|
||||
real(8), intent(in) :: xyz0(2)
|
||||
real(8), intent(in) :: xyz1(2)
|
||||
logical :: intersects
|
||||
|
|
@ -330,7 +330,7 @@ contains
|
|||
|
||||
function mesh_intersects_3d(m, xyz0, xyz1) result(intersects)
|
||||
|
||||
type(StructuredMesh), pointer :: m
|
||||
type(RegularMesh), pointer :: m
|
||||
real(8), intent(in) :: xyz0(3)
|
||||
real(8), intent(in) :: xyz1(3)
|
||||
logical :: intersects
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ module mesh_header
|
|||
! congruent squares or cubes
|
||||
!===============================================================================
|
||||
|
||||
type StructuredMesh
|
||||
type RegularMesh
|
||||
integer :: id ! user-specified id
|
||||
integer :: type ! rectangular, hexagonal
|
||||
integer :: n_dimension ! rank of mesh
|
||||
|
|
@ -16,6 +16,6 @@ module mesh_header
|
|||
real(8), allocatable :: lower_left(:) ! lower-left corner of mesh
|
||||
real(8), allocatable :: upper_right(:) ! upper-right corner of mesh
|
||||
real(8), allocatable :: width(:) ! width of each mesh cell
|
||||
end type StructuredMesh
|
||||
end type RegularMesh
|
||||
|
||||
end module mesh_header
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ module output
|
|||
HexLattice, BASE_UNIVERSE
|
||||
use global
|
||||
use math, only: t_percentile
|
||||
use mesh_header, only: StructuredMesh
|
||||
use mesh_header, only: RegularMesh
|
||||
use mesh, only: mesh_indices_to_bin, bin_to_mesh_indices
|
||||
use particle_header, only: LocalCoord, Particle
|
||||
use plot_header
|
||||
|
|
@ -1194,7 +1194,7 @@ contains
|
|||
integer :: filter_index ! index in results array for filters
|
||||
logical :: print_ebin ! should incoming energy bin be displayed?
|
||||
character(MAX_LINE_LEN) :: string
|
||||
type(StructuredMesh), pointer :: m => null()
|
||||
type(RegularMesh), pointer :: m
|
||||
|
||||
! Get pointer to mesh
|
||||
i_filter_mesh = t % find_filter(FILTER_MESH)
|
||||
|
|
@ -1361,8 +1361,8 @@ contains
|
|||
integer, allocatable :: ijk(:) ! indices in mesh
|
||||
real(8) :: E0 ! lower bound for energy bin
|
||||
real(8) :: E1 ! upper bound for energy bin
|
||||
type(StructuredMesh), pointer :: m => null()
|
||||
type(Universe), pointer :: univ => null()
|
||||
type(RegularMesh), pointer :: m
|
||||
type(Universe), pointer :: univ
|
||||
|
||||
bin = matching_bins(i_filter)
|
||||
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ module plot
|
|||
use global
|
||||
use hdf5_interface
|
||||
use mesh, only: get_mesh_indices
|
||||
use mesh_header, only: RegularMesh
|
||||
use output, only: write_message
|
||||
use particle_header, only: Particle, LocalCoord
|
||||
use plot_header
|
||||
|
|
@ -215,7 +216,7 @@ contains
|
|||
real(8) :: xyz_ur_plot(3) ! upper right xyz of plot image
|
||||
real(8) :: xyz_ll(3) ! lower left xyz
|
||||
real(8) :: xyz_ur(3) ! upper right xyz
|
||||
type(StructuredMesh), pointer :: m => null()
|
||||
type(RegularMesh), pointer :: m
|
||||
|
||||
m => pl % meshlines_mesh
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
module plot_header
|
||||
|
||||
use constants
|
||||
use mesh_header, only: StructuredMesh
|
||||
use mesh_header, only: RegularMesh
|
||||
|
||||
implicit none
|
||||
|
||||
|
|
@ -28,7 +28,7 @@ module plot_header
|
|||
integer :: pixels(3) ! pixel width/height of plot slice
|
||||
integer :: meshlines_width ! pixel width of meshlines
|
||||
integer :: level ! universe depth to plot the cells of
|
||||
type(StructuredMesh), pointer :: meshlines_mesh => null() ! mesh to plot
|
||||
type(RegularMesh), 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
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ module state_point
|
|||
use output, only: write_message, time_stamp
|
||||
use string, only: to_str, zero_padded, count_digits
|
||||
use tally_header, only: TallyObject
|
||||
use mesh_header, only: StructuredMesh
|
||||
use mesh_header, only: RegularMesh
|
||||
use dict_header, only: ElemKeyValueII, ElemKeyValueCI
|
||||
|
||||
#ifdef MPI
|
||||
|
|
@ -54,7 +54,7 @@ contains
|
|||
character(20), allocatable :: scores(:)
|
||||
character(8), allocatable :: moment_names(:) ! names of moments (e.g, P3)
|
||||
character(MAX_FILE_LEN) :: filename
|
||||
type(StructuredMesh), pointer :: meshp
|
||||
type(RegularMesh), pointer :: meshp
|
||||
type(TallyObject), pointer :: tally
|
||||
type(ElemKeyValueII), pointer :: current
|
||||
type(ElemKeyValueII), pointer :: next
|
||||
|
|
@ -181,7 +181,7 @@ contains
|
|||
mesh_group = create_group(meshes_group, "mesh " // trim(to_str(meshp%id)))
|
||||
|
||||
call write_dataset(mesh_group, "id", meshp%id)
|
||||
call write_dataset(mesh_group, "type", meshp%type)
|
||||
call write_dataset(mesh_group, "type", "regular")
|
||||
call write_dataset(mesh_group, "n_dimension", meshp%n_dimension)
|
||||
call write_dataset(mesh_group, "dimension", meshp%dimension)
|
||||
call write_dataset(mesh_group, "lower_left", meshp%lower_left)
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ module summary
|
|||
use global
|
||||
use hdf5_interface
|
||||
use material_header, only: Material
|
||||
use mesh_header, only: StructuredMesh
|
||||
use mesh_header, only: RegularMesh
|
||||
use output, only: time_stamp
|
||||
use string, only: to_str
|
||||
use tally_header, only: TallyObject
|
||||
|
|
@ -462,7 +462,7 @@ contains
|
|||
integer(HID_T) :: tally_group
|
||||
integer(HID_T) :: filter_group
|
||||
character(20), allocatable :: scores(:)
|
||||
type(StructuredMesh), pointer :: m
|
||||
type(RegularMesh), pointer :: m
|
||||
type(TallyObject), pointer :: t
|
||||
|
||||
tallies_group = create_group(file_id, "tallies")
|
||||
|
|
@ -479,7 +479,7 @@ contains
|
|||
call write_dataset(mesh_group, "index", i)
|
||||
|
||||
! Write type and number of dimensions
|
||||
call write_dataset(mesh_group, "type", m%type)
|
||||
call write_dataset(mesh_group, "type", "regular")
|
||||
|
||||
! Write mesh information
|
||||
call write_dataset(mesh_group, "dimension", m%dimension)
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ module tally
|
|||
use mesh, only: get_mesh_bin, bin_to_mesh_indices, &
|
||||
get_mesh_indices, mesh_indices_to_bin, &
|
||||
mesh_intersects_2d, mesh_intersects_3d
|
||||
use mesh_header, only: StructuredMesh
|
||||
use mesh_header, only: RegularMesh
|
||||
use output, only: header
|
||||
use particle_header, only: LocalCoord, Particle
|
||||
use search, only: binary_search
|
||||
|
|
@ -908,7 +908,7 @@ contains
|
|||
logical :: start_in_mesh ! starting coordinates inside mesh?
|
||||
logical :: end_in_mesh ! ending coordinates inside mesh?
|
||||
type(TallyObject), pointer :: t
|
||||
type(StructuredMesh), pointer :: m
|
||||
type(RegularMesh), pointer :: m
|
||||
type(Material), pointer :: mat
|
||||
|
||||
t => tallies(i_tally)
|
||||
|
|
@ -1249,7 +1249,7 @@ contains
|
|||
integer :: offset ! offset for distribcell
|
||||
real(8) :: E ! particle energy
|
||||
type(TallyObject), pointer :: t
|
||||
type(StructuredMesh), pointer :: m
|
||||
type(RegularMesh), pointer :: m
|
||||
|
||||
found_bin = .true.
|
||||
t => tallies(i_tally)
|
||||
|
|
@ -1402,7 +1402,7 @@ contains
|
|||
logical :: y_same ! same starting/ending y index (j)
|
||||
logical :: z_same ! same starting/ending z index (k)
|
||||
type(TallyObject), pointer :: t
|
||||
type(StructuredMesh), pointer :: m
|
||||
type(RegularMesh), pointer :: m
|
||||
|
||||
TALLY_LOOP: do i = 1, active_current_tallies % size()
|
||||
! Copy starting and ending location of particle
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ module trigger
|
|||
use string, only: to_str
|
||||
use output, only: warning, write_message
|
||||
use mesh, only: mesh_indices_to_bin
|
||||
use mesh_header, only: RegularMesh
|
||||
use trigger_header, only: TriggerObject
|
||||
use tally, only: TallyObject
|
||||
|
||||
|
|
@ -315,7 +316,7 @@ contains
|
|||
real(8) :: std_dev = ZERO ! temporary standard deviration of result
|
||||
type(TallyObject), pointer :: t ! surface current tally
|
||||
type(TriggerObject) :: trigger ! surface current tally trigger
|
||||
type(StructuredMesh), pointer :: m ! surface current mesh
|
||||
type(RegularMesh), pointer :: m ! surface current mesh
|
||||
|
||||
! Get pointer to mesh
|
||||
i_filter_mesh = t % find_filter(FILTER_MESH)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue