mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 22:26:08 -04:00
Changed element component to universes on Lattice derived type.
This commit is contained in:
parent
12e959a8eb
commit
20890a5db0
5 changed files with 13 additions and 13 deletions
|
|
@ -220,7 +220,7 @@ contains
|
|||
p % coord % lattice_x = i_x
|
||||
p % coord % lattice_y = i_y
|
||||
p % coord % lattice_z = i_z
|
||||
p % coord % universe = lat % element(i_x,i_y,i_z)
|
||||
p % coord % universe = lat % universes(i_x,i_y,i_z)
|
||||
end if
|
||||
|
||||
call find_cell(found)
|
||||
|
|
@ -613,7 +613,7 @@ contains
|
|||
end if
|
||||
else
|
||||
! Find universe for next lattice element
|
||||
p % coord % universe = lat % element(i_x, i_y, i_z)
|
||||
p % coord % universe = lat % universes(i_x, i_y, i_z)
|
||||
|
||||
! Find cell in next lattice element
|
||||
call find_cell(found)
|
||||
|
|
|
|||
|
|
@ -26,10 +26,10 @@ module geometry_header
|
|||
integer :: type ! Type of lattice (rectangular, hex, etc)
|
||||
integer :: level ! Level of lattice
|
||||
integer :: n_dimension ! Number of dimensions
|
||||
integer, allocatable :: dimension(:) ! number of cells in each direction
|
||||
real(8), allocatable :: lower_left(:) ! lower-left corner of lattice
|
||||
real(8), allocatable :: width(:) ! width of each lattice cell
|
||||
integer, allocatable :: element(:,:,:) ! specified universes
|
||||
integer, allocatable :: dimension(:) ! number of cells in each direction
|
||||
real(8), allocatable :: lower_left(:) ! lower-left corner of lattice
|
||||
real(8), allocatable :: width(:) ! width of each lattice cell
|
||||
integer, allocatable :: universes(:,:,:) ! specified universes
|
||||
end type Lattice
|
||||
|
||||
!===============================================================================
|
||||
|
|
|
|||
|
|
@ -388,12 +388,12 @@ contains
|
|||
n_z = 1
|
||||
end if
|
||||
|
||||
! Write lattice elements
|
||||
! Write lattice universes
|
||||
allocate(lattice_universes(n_x, n_y, n_z))
|
||||
do j = 1, n_x
|
||||
do k = 1, n_y
|
||||
do m = 1, n_z
|
||||
lattice_universes(j,k,m) = universes(lat % element(j,k,m)) % id
|
||||
lattice_universes(j,k,m) = universes(lat % universes(j,k,m)) % id
|
||||
end do
|
||||
end do
|
||||
end do
|
||||
|
|
|
|||
|
|
@ -502,9 +502,9 @@ contains
|
|||
do m = 1, n_z
|
||||
do k = 1, n_y
|
||||
do j = 1, n_x
|
||||
id = lat % element(j,k,m)
|
||||
id = lat % universes(j,k,m)
|
||||
if (universe_dict % has_key(id)) then
|
||||
lat % element(j,k,m) = universe_dict % get_key(id)
|
||||
lat % universes(j,k,m) = universe_dict % get_key(id)
|
||||
else
|
||||
message = "Invalid universe number " // trim(to_str(id)) &
|
||||
// " specified on lattice " // trim(to_str(lat % id))
|
||||
|
|
|
|||
|
|
@ -928,11 +928,11 @@ contains
|
|||
else
|
||||
n_z = 1
|
||||
end if
|
||||
allocate(lat % element(n_x, n_y, n_z))
|
||||
allocate(lat % universes(n_x, n_y, n_z))
|
||||
|
||||
! Check that number of universes matches size
|
||||
if (size(lattice_(i) % universes) /= n_x*n_y*n_z) then
|
||||
message = "Number of universes on <elements> does not match size of &
|
||||
message = "Number of universes on <universes> does not match size of &
|
||||
&lattice " // trim(to_str(lat % id)) // "."
|
||||
call fatal_error()
|
||||
end if
|
||||
|
|
@ -941,7 +941,7 @@ contains
|
|||
do m = 1, n_z
|
||||
do k = 0, n_y - 1
|
||||
do j = 1, n_x
|
||||
lat % element(j, n_y - k, m) = lattice_(i) % &
|
||||
lat % universes(j, n_y - k, m) = lattice_(i) % &
|
||||
universes(j + n_x*k + n_x*n_y*(m-1))
|
||||
end do
|
||||
end do
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue