changed "build_sharedElements" to use (then existing) internal element data structure instead of reading again from the input file. The data structure is already established by "build_elements"...
This commit is contained in:
parent
8cb156dc35
commit
e7247551f0
|
@ -1398,56 +1398,39 @@ subroutine mesh_get_nodeElemDimensions (unit)
|
||||||
! allocate globals:
|
! allocate globals:
|
||||||
! _sharedElem
|
! _sharedElem
|
||||||
!********************************************************************
|
!********************************************************************
|
||||||
subroutine mesh_build_sharedElems (unit)
|
subroutine mesh_build_sharedElems ()
|
||||||
|
|
||||||
use prec, only: pInt
|
use prec, only: pInt
|
||||||
use IO
|
use IO
|
||||||
implicit none
|
implicit none
|
||||||
|
|
||||||
integer(pInt), parameter :: maxNchunks = 66
|
integer(pint) e,n,j
|
||||||
integer(pint) unit,i,j,n,e
|
|
||||||
integer(pInt), dimension (1+2*maxNchunks) :: pos
|
|
||||||
integer(pInt), dimension (:), allocatable :: node_seen
|
integer(pInt), dimension (:), allocatable :: node_seen
|
||||||
character*300 line
|
|
||||||
|
|
||||||
610 FORMAT(A300)
|
|
||||||
|
|
||||||
allocate(node_seen(maxval(FE_Nnodes)))
|
allocate(node_seen(maxval(FE_Nnodes)))
|
||||||
allocate ( mesh_sharedElem( 1+mesh_maxNsharedElems,mesh_Nnodes) )
|
allocate ( mesh_sharedElem( 1+mesh_maxNsharedElems,mesh_Nnodes) )
|
||||||
mesh_sharedElem(:,:) = 0_pInt
|
mesh_sharedElem(:,:) = 0_pInt
|
||||||
|
|
||||||
rewind(unit)
|
do e = 1,mesh_NcpElems
|
||||||
do
|
node_seen = 0_pInt
|
||||||
read (unit,610,END=620) line
|
do j = 1,FE_Nnodes(mesh_element(2,e))
|
||||||
pos = IO_stringPos(line,1)
|
n = mesh_FEasCP('node',mesh_element(4+j,e))
|
||||||
if( IO_lc(IO_stringValue(line,pos,1)) == 'connectivity' ) then
|
if (all(node_seen /= n)) then
|
||||||
read (unit,610,END=620) line ! Garbage line
|
mesh_sharedElem(1,n) = mesh_sharedElem(1,n) + 1
|
||||||
do i=1,mesh_Nelems
|
mesh_sharedElem(1+mesh_sharedElem(1,n),n) = e
|
||||||
read (unit,610,END=620) line
|
endif
|
||||||
pos = IO_stringPos(line,maxNchunks) ! limit to 64 nodes max (plus ID, type)
|
node_seen(j) = n
|
||||||
e = mesh_FEasCP('elem',IO_IntValue(line,pos,1))
|
enddo
|
||||||
if (e /= 0) then ! disregard non CP elems
|
|
||||||
node_seen = 0_pInt
|
|
||||||
do j = 1,FE_Nnodes(FE_mapElemtype(IO_StringValue(line,pos,2)))
|
|
||||||
n = mesh_FEasCP('node',IO_IntValue (line,pos,j+2))
|
|
||||||
if (all(node_seen /= n)) then
|
|
||||||
mesh_sharedElem(1,n) = mesh_sharedElem(1,n) + 1
|
|
||||||
mesh_sharedElem(1+mesh_sharedElem(1,n),n) = e
|
|
||||||
endif
|
|
||||||
node_seen(j) = n
|
|
||||||
enddo
|
|
||||||
call IO_skipChunks(unit,FE_NoriginalNodes(mesh_element(2,e))-(pos(1)-2)) ! read on if FE_Nnodes exceeds node count present on current line
|
|
||||||
endif
|
|
||||||
enddo
|
|
||||||
exit
|
|
||||||
endif
|
|
||||||
enddo
|
enddo
|
||||||
|
|
||||||
620 return
|
deallocate (node_seen)
|
||||||
|
|
||||||
|
return
|
||||||
|
|
||||||
endsubroutine
|
endsubroutine
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
!***********************************************************
|
!***********************************************************
|
||||||
! build up of IP neighborhood
|
! build up of IP neighborhood
|
||||||
!
|
!
|
||||||
|
|
Loading…
Reference in New Issue