explain data layout

This commit is contained in:
Martin Diehl 2020-01-26 21:56:08 +01:00
parent 0a1bac6787
commit f044b8c42f
2 changed files with 18 additions and 13 deletions

View File

@ -395,6 +395,7 @@ pure function IPneighborhood(grid)
e = 0
do z = 0,grid(3)-1; do y = 0,grid(2)-1; do x = 0,grid(1)-1
e = e + 1
! element ID
IPneighborhood(1,1,1,e) = z * grid(1) * grid(2) &
+ y * grid(1) &
+ modulo(x+1,grid(1)) &
@ -419,13 +420,17 @@ pure function IPneighborhood(grid)
+ y * grid(1) &
+ x &
+ 1
IPneighborhood(2,1:6,1,e) = 1
IPneighborhood(3,1, 1,e) = 2
IPneighborhood(3,2, 1,e) = 1
IPneighborhood(3,3, 1,e) = 4
IPneighborhood(3,4, 1,e) = 3
IPneighborhood(3,5, 1,e) = 6
IPneighborhood(3,6, 1,e) = 5
! IP ID
IPneighborhood(2,:,1,e) = 1
! face ID
IPneighborhood(3,1,1,e) = 2
IPneighborhood(3,2,1,e) = 1
IPneighborhood(3,3,1,e) = 4
IPneighborhood(3,4,1,e) = 3
IPneighborhood(3,5,1,e) = 6
IPneighborhood(3,6,1,e) = 5
enddo; enddo; enddo
end function IPneighborhood

View File

@ -51,7 +51,7 @@ subroutine mesh_init(ip,el)
integer, intent(in) :: el, ip
real(pReal), dimension(:,:), allocatable :: &
node0_elem, & !< node x,y,z coordinates (initially!)
node0_elem, & !< node x,y,z coordinates (initially!)
node0_cell
type(tElement) :: elem
@ -65,7 +65,7 @@ subroutine mesh_init(ip,el)
real(pReal), dimension(:,:), allocatable :: &
ip_reshaped
integer,dimension(:,:,:), allocatable :: &
connectivity_cell !< cell connectivity for each element,ip/cell
connectivity_cell !< cell connectivity for each element,ip/cell
integer, dimension(:,:), allocatable :: &
connectivity_elem
real(pReal), dimension(:,:,:,:),allocatable :: &
@ -372,9 +372,9 @@ subroutine inputRead_NelemSets(nElemSets,maxNelemInSet,&
do while (.true.)
i = i + 1
chunkPos = IO_stringPos(fileContent(l+i))
elemInCurrentSet = elemInCurrentSet + chunkPos(1) - 1 ! add line's count when assuming 'c'
if(IO_lc(IO_stringValue(fileContent(l+i),chunkPos,chunkPos(1))) /= 'c') then ! line finished, read last value
elemInCurrentSet = elemInCurrentSet + 1 ! data ended
elemInCurrentSet = elemInCurrentSet + chunkPos(1) - 1 ! add line's count when assuming 'c'
if(IO_lc(IO_stringValue(fileContent(l+i),chunkPos,chunkPos(1))) /= 'c') then ! line finished, read last value
elemInCurrentSet = elemInCurrentSet + 1 ! data ended
exit
endif
enddo
@ -1046,7 +1046,7 @@ integer function mesh_FEasCP(what,myID)
lower = 1
upper = int(size(lookupMap,2),pInt)
if (lookupMap(1,lower) == myID) then ! check at bounds QUESTION is it valid to extend bounds by 1 and just do binary search w/o init check at bounds?
if (lookupMap(1,lower) == myID) then ! check at bounds QUESTION is it valid to extend bounds by 1 and just do binary search w/o init check at bounds?
mesh_FEasCP = lookupMap(2,lower)
return
elseif (lookupMap(1,upper) == myID) then