diff --git a/src/mesh_grid.f90 b/src/mesh_grid.f90 index 0e5071d9e..b1ba6b590 100644 --- a/src/mesh_grid.f90 +++ b/src/mesh_grid.f90 @@ -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 diff --git a/src/mesh_marc.f90 b/src/mesh_marc.f90 index 7542e976e..c15c4f31f 100644 --- a/src/mesh_marc.f90 +++ b/src/mesh_marc.f90 @@ -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