Implement Hilbert space filling curve for 3D.

This commit is contained in:
Grzegorz Kowal 2009-10-03 20:11:03 -03:00
parent 3747646780
commit 7bd227afda
2 changed files with 60 additions and 40 deletions

View File

@ -987,7 +987,7 @@ module blocks
! set corresponding configuration of the new blocks
!
select case(pblock%config)
case(0) ! 'Z'
case(0)
#if NDIMS == 2
config(:) = (/ 0, 0, 0, 0 /)
@ -998,70 +998,90 @@ module blocks
order (:) = (/ 1, 2, 3, 4, 5, 6, 7, 8 /)
#endif /* NDIMS == 3 */
case(1) ! 'N'
case(12)
#if NDIMS == 2
config(:) = (/ 2, 1, 1, 3 /)
order (:) = (/ 1, 3, 4, 2 /)
config(:) = (/ 13, 12, 12, 42 /)
order (:) = (/ 1, 3, 4, 2 /)
#endif /* NDIMS == 2 */
#if NDIMS == 3
config(:) = (/ 0, 0, 0, 0, 0, 0, 0, 0 /)
order (:) = (/ 1, 2, 3, 4, 5, 6, 7, 8 /)
config(:) = (/ 13, 15, 15, 78, 78, 62, 62, 42 /)
order (:) = (/ 1, 3, 7, 5, 6, 8, 4, 2 /)
#endif /* NDIMS == 3 */
case(2) ! 'D'
case(13)
#if NDIMS == 2
config(:) = (/ 1, 2, 2, 4 /)
order (:) = (/ 1, 2, 4, 3 /)
config(:) = (/ 12, 13, 13, 43 /)
order (:) = (/ 1, 2, 4, 3 /)
#endif /* NDIMS == 2 */
#if NDIMS == 3
config(:) = (/ 0, 0, 0, 0, 0, 0, 0, 0 /)
order (:) = (/ 1, 2, 3, 4, 5, 6, 7, 8 /)
config(:) = (/ 15, 12, 12, 68, 68, 43, 43, 73 /)
order (:) = (/ 1, 5, 6, 2, 4, 8, 7, 3 /)
case(15)
config(:) = (/ 12, 13, 13, 48, 48, 75, 75, 65 /)
order (:) = (/ 1, 2, 4, 3, 7, 8, 6, 5 /)
#endif /* NDIMS == 3 */
case(3) ! 'C'
case(42)
#if NDIMS == 2
config(:) = (/ 4, 3, 3, 1 /)
order (:) = (/ 4, 3, 1, 2 /)
config(:) = (/ 43, 42, 42, 12 /)
order (:) = (/ 4, 3, 1, 2 /)
#endif /* NDIMS == 2 */
#if NDIMS == 3
config(:) = (/ 0, 0, 0, 0, 0, 0, 0, 0 /)
order (:) = (/ 1, 2, 3, 4, 5, 6, 7, 8 /)
config(:) = (/ 48, 43, 43, 75, 75, 12, 12, 62 /)
order (:) = (/ 4, 8, 7, 3, 1, 5, 6, 2 /)
#endif /* NDIMS == 3 */
case(4) ! 'U'
case(43)
#if NDIMS == 2
config(:) = (/ 3, 4, 4, 2 /)
order (:) = (/ 4, 2, 1, 3 /)
config(:) = (/ 42, 43, 43, 13 /)
order (:) = (/ 4, 2, 1, 3 /)
#endif /* NDIMS == 2 */
#if NDIMS == 3
config(:) = (/ 0, 0, 0, 0, 0, 0, 0, 0 /)
order (:) = (/ 1, 2, 3, 4, 5, 6, 7, 8 /)
config(:) = (/ 42, 48, 48, 65, 65, 73, 73, 13 /)
order (:) = (/ 4, 2, 6, 8, 7, 5, 1, 3 /)
#endif /* NDIMS == 3 */
#if NDIMS == 3
case(5)
case(48)
config(:) = (/ 0, 0, 0, 0, 0, 0, 0, 0 /)
order (:) = (/ 1, 2, 3, 4, 5, 6, 7, 8 /)
config(:) = (/ 43, 42, 42, 15, 15, 68, 68, 78 /)
order (:) = (/ 4, 3, 1, 2, 6, 5, 7, 8 /)
case(6)
case(62)
config(:) = (/ 0, 0, 0, 0, 0, 0, 0, 0 /)
order (:) = (/ 1, 2, 3, 4, 5, 6, 7, 8 /)
config(:) = (/ 65, 68, 68, 73, 73, 42, 42, 12 /)
order (:) = (/ 6, 5, 7, 8, 4, 3, 1, 2 /)
case(7)
case(65)
config(:) = (/ 0, 0, 0, 0, 0, 0, 0, 0 /)
order (:) = (/ 1, 2, 3, 4, 5, 6, 7, 8 /)
config(:) = (/ 68, 62, 62, 43, 43, 15, 15, 75 /)
order (:) = (/ 6, 8, 4, 2, 1, 3, 7, 5 /)
case(8)
case(68)
config(:) = (/ 0, 0, 0, 0, 0, 0, 0, 0 /)
order (:) = (/ 1, 2, 3, 4, 5, 6, 7, 8 /)
config(:) = (/ 62, 65, 65, 13, 13, 78, 78, 48 /)
order (:) = (/ 6, 2, 1, 5, 7, 3, 4 , 8 /)
case(73)
config(:) = (/ 78, 75, 75, 62, 62, 13, 13, 43 /)
order (:) = (/ 7, 8, 6, 5, 1, 2, 4, 3 /)
case(75)
config(:) = (/ 73, 78, 78, 42, 42, 65, 65, 15 /)
order (:) = (/ 7, 3, 4, 8, 6, 2, 1, 5 /)
case(78)
config(:) = (/ 75, 73, 73, 12, 12, 48, 48, 68 /)
order (:) = (/ 7, 5, 1, 3, 4, 2, 6, 8 /)
#endif /* NDIMS == 3 */
end select

View File

@ -171,7 +171,7 @@ module problem
! set block config flag
!
call metablock_setconfig(pmeta, 1)
call metablock_setconfig(pmeta, 12)
! set block level
!
@ -278,12 +278,12 @@ module problem
! set block config flag
!
call metablock_setconfig(block_array(1,1)%ptr, 1)
call metablock_setconfig(block_array(2,1)%ptr, 2)
call metablock_setconfig(block_array(2,2)%ptr, 2)
call metablock_setconfig(block_array(1,2)%ptr, 4)
call metablock_setconfig(block_array(1,3)%ptr, 1)
call metablock_setconfig(block_array(2,3)%ptr, 1)
call metablock_setconfig(block_array(1,1)%ptr, 12)
call metablock_setconfig(block_array(2,1)%ptr, 13)
call metablock_setconfig(block_array(2,2)%ptr, 13)
call metablock_setconfig(block_array(1,2)%ptr, 43)
call metablock_setconfig(block_array(1,3)%ptr, 12)
call metablock_setconfig(block_array(2,3)%ptr, 12)
! set block level
!