mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-29 06:35:48 -04:00
'normal' fill type -> 'material'
This commit is contained in:
parent
01254d0b3d
commit
eecf45411b
8 changed files with 42 additions and 42 deletions
|
|
@ -31,7 +31,7 @@ The current version of the summary file format is 5.0.
|
|||
- **universe** (*int*) -- Universe assigned to the cell. If none is
|
||||
specified, the default universe (0) is assigned.
|
||||
- **fill_type** (*char[]*) -- Type of fill for the cell. Can be
|
||||
'normal', 'universe', or 'lattice'.
|
||||
'material', 'universe', or 'lattice'.
|
||||
- **material** (*int* or *int[]*) -- Unique ID of the material(s)
|
||||
assigned to the cell. This dataset is present only if fill_type is
|
||||
set to 'normal'. The value '-1' signifies void material. The data
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ class Summary(object):
|
|||
name = group['name'].value.decode()
|
||||
fill_type = group['fill_type'].value.decode()
|
||||
|
||||
if fill_type == 'normal':
|
||||
if fill_type == 'material':
|
||||
fill = group['material'].value
|
||||
elif fill_type == 'universe':
|
||||
fill = group['fill'].value
|
||||
|
|
@ -138,7 +138,7 @@ class Summary(object):
|
|||
rotation = np.asarray(rotation, dtype=np.int)
|
||||
cell._rotation = rotation
|
||||
|
||||
elif fill_type == 'normal':
|
||||
elif fill_type == 'material':
|
||||
cell.temperature = group['temperature'][...]
|
||||
|
||||
# Store Cell fill information for after Universe/Lattice creation
|
||||
|
|
@ -181,7 +181,7 @@ class Summary(object):
|
|||
# Iterate over all Cells and add fill Materials, Universes and Lattices
|
||||
for cell_id, (fill_type, fill_id) in cell_fills.items():
|
||||
# Retrieve the object corresponding to the fill type and ID
|
||||
if fill_type == 'normal':
|
||||
if fill_type == 'material':
|
||||
if isinstance(fill_id, Iterable):
|
||||
fill = [materials[mat] if mat > 0 else None
|
||||
for mat in fill_id]
|
||||
|
|
|
|||
|
|
@ -107,11 +107,11 @@ module constants
|
|||
OP_INTERSECTION = huge(0) - 3, & ! Intersection operator
|
||||
OP_UNION = huge(0) - 4 ! Union operator (^)
|
||||
|
||||
! Cell types
|
||||
! Cell fill types
|
||||
integer, parameter :: &
|
||||
CELL_NORMAL = 1, & ! Cell with a specified material
|
||||
CELL_FILL = 2, & ! Cell filled by a separate universe
|
||||
CELL_LATTICE = 3 ! Cell filled with a lattice
|
||||
FILL_MATERIAL = 1, & ! Cell with a specified material
|
||||
FILL_UNIVERSE = 2, & ! Cell filled by a separate universe
|
||||
FILL_LATTICE = 3 ! Cell filled with a lattice
|
||||
|
||||
! Void material
|
||||
integer, parameter :: MATERIAL_VOID = -1
|
||||
|
|
|
|||
|
|
@ -244,7 +244,7 @@ contains
|
|||
call write_message(" Entering cell " // trim(to_str(c % id)))
|
||||
end if
|
||||
|
||||
CELL_TYPE: if (c % type == CELL_NORMAL) then
|
||||
CELL_TYPE: if (c % type == FILL_MATERIAL) then
|
||||
! ======================================================================
|
||||
! AT LOWEST UNIVERSE, TERMINATE SEARCH
|
||||
|
||||
|
|
@ -260,10 +260,10 @@ contains
|
|||
distribcell_index = c % distribcell_index
|
||||
offset = 0
|
||||
do k = 1, p % n_coord
|
||||
if (cells(p % coord(k) % cell) % type == CELL_FILL) then
|
||||
if (cells(p % coord(k) % cell) % type == FILL_UNIVERSE) then
|
||||
offset = offset + cells(p % coord(k) % cell) % &
|
||||
offset(distribcell_index)
|
||||
elseif (cells(p % coord(k) % cell) % type == CELL_LATTICE) then
|
||||
elseif (cells(p % coord(k) % cell) % type == FILL_LATTICE) then
|
||||
if (lattices(p % coord(k + 1) % lattice) % obj &
|
||||
% are_valid_indices([&
|
||||
p % coord(k + 1) % lattice_x, &
|
||||
|
|
@ -293,7 +293,7 @@ contains
|
|||
p % sqrtkT = c % sqrtkT(1)
|
||||
end if
|
||||
|
||||
elseif (c % type == CELL_FILL) then CELL_TYPE
|
||||
elseif (c % type == FILL_UNIVERSE) then CELL_TYPE
|
||||
! ======================================================================
|
||||
! CELL CONTAINS LOWER UNIVERSE, RECURSIVELY FIND CELL
|
||||
|
||||
|
|
@ -322,7 +322,7 @@ contains
|
|||
j = p % n_coord
|
||||
if (.not. found) exit
|
||||
|
||||
elseif (c % type == CELL_LATTICE) then CELL_TYPE
|
||||
elseif (c % type == FILL_LATTICE) then CELL_TYPE
|
||||
! ======================================================================
|
||||
! CELL CONTAINS LATTICE, RECURSIVELY FIND CELL
|
||||
|
||||
|
|
@ -1116,11 +1116,11 @@ contains
|
|||
|
||||
! ====================================================================
|
||||
! AT LOWEST UNIVERSE, TERMINATE SEARCH
|
||||
if (c % type == CELL_NORMAL) then
|
||||
if (c % type == FILL_MATERIAL) then
|
||||
|
||||
! ====================================================================
|
||||
! CELL CONTAINS LOWER UNIVERSE, RECURSIVELY FIND CELL
|
||||
elseif (c % type == CELL_FILL) then
|
||||
elseif (c % type == FILL_UNIVERSE) then
|
||||
! Set offset for the cell on this level
|
||||
c % offset(map) = offset
|
||||
|
||||
|
|
@ -1134,7 +1134,7 @@ contains
|
|||
|
||||
! ====================================================================
|
||||
! CELL CONTAINS LATTICE, RECURSIVELY FIND CELL
|
||||
elseif (c % type == CELL_LATTICE) then
|
||||
elseif (c % type == FILL_LATTICE) then
|
||||
|
||||
! Set current lattice
|
||||
lat => lattices(c % fill) % obj
|
||||
|
|
@ -1232,11 +1232,11 @@ contains
|
|||
|
||||
! ====================================================================
|
||||
! AT LOWEST UNIVERSE, TERMINATE SEARCH
|
||||
if (c % type == CELL_NORMAL) then
|
||||
if (c % type == FILL_MATERIAL) then
|
||||
|
||||
! ====================================================================
|
||||
! CELL CONTAINS LOWER UNIVERSE, RECURSIVELY FIND CELL
|
||||
elseif (c % type == CELL_FILL) then
|
||||
elseif (c % type == FILL_UNIVERSE) then
|
||||
|
||||
next_univ => universes(c % fill)
|
||||
|
||||
|
|
@ -1251,7 +1251,7 @@ contains
|
|||
|
||||
! ====================================================================
|
||||
! CELL CONTAINS LATTICE, RECURSIVELY FIND CELL
|
||||
elseif (c % type == CELL_LATTICE) then
|
||||
elseif (c % type == FILL_LATTICE) then
|
||||
|
||||
! Set current lattice
|
||||
lat => lattices(c % fill) % obj
|
||||
|
|
@ -1346,11 +1346,11 @@ contains
|
|||
|
||||
! ====================================================================
|
||||
! AT LOWEST UNIVERSE, TERMINATE SEARCH
|
||||
if (c % type == CELL_NORMAL) then
|
||||
if (c % type == FILL_MATERIAL) then
|
||||
|
||||
! ====================================================================
|
||||
! CELL CONTAINS LOWER UNIVERSE, RECURSIVELY FIND CELL
|
||||
elseif (c % type == CELL_FILL) then
|
||||
elseif (c % type == FILL_UNIVERSE) then
|
||||
|
||||
next_univ => universes(c % fill)
|
||||
|
||||
|
|
@ -1359,7 +1359,7 @@ contains
|
|||
|
||||
! ====================================================================
|
||||
! CELL CONTAINS LATTICE, RECURSIVELY FIND CELL
|
||||
elseif (c % type == CELL_LATTICE) then
|
||||
elseif (c % type == FILL_LATTICE) then
|
||||
|
||||
! Set current lattice
|
||||
lat => lattices(c % fill) % obj
|
||||
|
|
@ -1428,14 +1428,14 @@ contains
|
|||
|
||||
! ====================================================================
|
||||
! CELL CONTAINS LOWER UNIVERSE, RECURSIVELY FIND CELL
|
||||
if (c % type == CELL_FILL) then
|
||||
if (c % type == FILL_UNIVERSE) then
|
||||
|
||||
next_univ => universes(c % fill)
|
||||
levels_below = max(levels_below, maximum_levels(next_univ))
|
||||
|
||||
! ====================================================================
|
||||
! CELL CONTAINS LATTICE, RECURSIVELY FIND CELL
|
||||
elseif (c % type == CELL_LATTICE) then
|
||||
elseif (c % type == FILL_LATTICE) then
|
||||
|
||||
! Set current lattice
|
||||
lat => lattices(c % fill) % obj
|
||||
|
|
|
|||
|
|
@ -560,11 +560,11 @@ contains
|
|||
if (c % material(1) == NONE) then
|
||||
id = c % fill
|
||||
if (universe_dict % has_key(id)) then
|
||||
c % type = CELL_FILL
|
||||
c % type = FILL_UNIVERSE
|
||||
c % fill = universe_dict % get_key(id)
|
||||
elseif (lattice_dict % has_key(id)) then
|
||||
lid = lattice_dict % get_key(id)
|
||||
c % type = CELL_LATTICE
|
||||
c % type = FILL_LATTICE
|
||||
c % fill = lid
|
||||
else
|
||||
call fatal_error("Specified fill " // trim(to_str(id)) // " on cell "&
|
||||
|
|
@ -575,9 +575,9 @@ contains
|
|||
do j = 1, size(c % material)
|
||||
id = c % material(j)
|
||||
if (id == MATERIAL_VOID) then
|
||||
c % type = CELL_NORMAL
|
||||
c % type = FILL_MATERIAL
|
||||
else if (material_dict % has_key(id)) then
|
||||
c % type = CELL_NORMAL
|
||||
c % type = FILL_MATERIAL
|
||||
c % material(j) = material_dict % get_key(id)
|
||||
else
|
||||
call fatal_error("Could not find material " // trim(to_str(id)) &
|
||||
|
|
@ -934,7 +934,7 @@ contains
|
|||
|
||||
! Allocate offset table for fill cells
|
||||
do i = 1, n_cells
|
||||
if (cells(i) % type /= CELL_NORMAL) then
|
||||
if (cells(i) % type /= FILL_MATERIAL) then
|
||||
allocate(cells(i) % offset(n_maps))
|
||||
end if
|
||||
end do
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ contains
|
|||
if (pl % color_by == PLOT_COLOR_MATS) then
|
||||
! Assign color based on material
|
||||
associate (c => cells(p % coord(j) % cell))
|
||||
if (c % type == CELL_FILL) then
|
||||
if (c % type == FILL_UNIVERSE) then
|
||||
! If we stopped on a middle universe level, treat as if not found
|
||||
rgb = pl % not_found % rgb
|
||||
id = -1
|
||||
|
|
|
|||
|
|
@ -156,8 +156,8 @@ contains
|
|||
|
||||
! Write information on what fills this cell
|
||||
select case (c%type)
|
||||
case (CELL_NORMAL)
|
||||
call write_dataset(cell_group, "fill_type", "normal")
|
||||
case (FILL_MATERIAL)
|
||||
call write_dataset(cell_group, "fill_type", "material")
|
||||
|
||||
if (size(c % material) == 1) then
|
||||
if (c % material(1) == MATERIAL_VOID) then
|
||||
|
|
@ -185,7 +185,7 @@ contains
|
|||
call write_dataset(cell_group, "temperature", cell_temperatures)
|
||||
deallocate(cell_temperatures)
|
||||
|
||||
case (CELL_FILL)
|
||||
case (FILL_UNIVERSE)
|
||||
call write_dataset(cell_group, "fill_type", "universe")
|
||||
call write_dataset(cell_group, "fill", universes(c%fill)%id)
|
||||
if (allocated(c%offset)) then
|
||||
|
|
@ -201,7 +201,7 @@ contains
|
|||
call write_dataset(cell_group, "rotation", c%rotation)
|
||||
end if
|
||||
|
||||
case (CELL_LATTICE)
|
||||
case (FILL_LATTICE)
|
||||
call write_dataset(cell_group, "fill_type", "lattice")
|
||||
call write_dataset(cell_group, "lattice", lattices(c%fill)%obj%id)
|
||||
end select
|
||||
|
|
|
|||
|
|
@ -716,10 +716,10 @@ contains
|
|||
distribcell_index = cells(this % cell) % distribcell_index
|
||||
offset = 0
|
||||
do i = 1, p % n_coord
|
||||
if (cells(p % coord(i) % cell) % type == CELL_FILL) then
|
||||
if (cells(p % coord(i) % cell) % type == FILL_UNIVERSE) then
|
||||
offset = offset + cells(p % coord(i) % cell) % &
|
||||
offset(distribcell_index)
|
||||
elseif (cells(p % coord(i) % cell) % type == CELL_LATTICE) then
|
||||
elseif (cells(p % coord(i) % cell) % type == FILL_LATTICE) then
|
||||
if (lattices(p % coord(i + 1) % lattice) % obj &
|
||||
% are_valid_indices([&
|
||||
p % coord(i + 1) % lattice_x, &
|
||||
|
|
@ -1421,7 +1421,7 @@ contains
|
|||
c => cells(cell_index)
|
||||
|
||||
! Skip normal cells which do not have offsets
|
||||
if (c % type == CELL_NORMAL) then
|
||||
if (c % type == FILL_MATERIAL) then
|
||||
cycle
|
||||
end if
|
||||
|
||||
|
|
@ -1430,13 +1430,13 @@ contains
|
|||
end do
|
||||
|
||||
! Ensure we didn't just end the loop by iteration
|
||||
if (c % type /= CELL_NORMAL) then
|
||||
if (c % type /= FILL_MATERIAL) then
|
||||
|
||||
! There are more cells in this universe that it could be in
|
||||
later_cell = .true.
|
||||
|
||||
! Two cases, lattice or fill cell
|
||||
if (c % type == CELL_FILL) then
|
||||
if (c % type == FILL_UNIVERSE) then
|
||||
temp_offset = c % offset(map)
|
||||
|
||||
! Get the offset of the first lattice location
|
||||
|
|
@ -1453,7 +1453,7 @@ contains
|
|||
end if
|
||||
end if
|
||||
|
||||
if (n == 1 .and. c % type /= CELL_NORMAL) then
|
||||
if (n == 1 .and. c % type /= FILL_MATERIAL) then
|
||||
this_cell = .true.
|
||||
end if
|
||||
|
||||
|
|
@ -1471,7 +1471,7 @@ contains
|
|||
|
||||
! ====================================================================
|
||||
! CELL CONTAINS LOWER UNIVERSE, RECURSIVELY FIND CELL
|
||||
if (c % type == CELL_FILL) then
|
||||
if (c % type == FILL_UNIVERSE) then
|
||||
|
||||
! Enter this cell to update the current offset
|
||||
offset = c % offset(map) + offset
|
||||
|
|
@ -1482,7 +1482,7 @@ contains
|
|||
|
||||
! ====================================================================
|
||||
! CELL CONTAINS LATTICE, RECURSIVELY FIND CELL
|
||||
elseif (c % type == CELL_LATTICE) then
|
||||
elseif (c % type == FILL_LATTICE) then
|
||||
|
||||
! Set current lattice
|
||||
lat => lattices(c % fill) % obj
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue