From 1233d01cd5341e1049b86bc94f859421508a2666 Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Thu, 10 Jan 2008 17:12:33 +0000 Subject: [PATCH] mesh_maxNsharedElems is now correct. Added check for multiple identical nodes in an element, e.g. triangular quad-element and the like. --- trunk/mesh.f90 | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/trunk/mesh.f90 b/trunk/mesh.f90 index ccbce5503..55a8e0b5d 100644 --- a/trunk/mesh.f90 +++ b/trunk/mesh.f90 @@ -373,7 +373,7 @@ candidate: do i=1,minN ! iterate over lonelyNode's shared elements END SUBROUTINE -!******************************************************************** +!!******************************************************************** ! get maximum count of nodes, IPs, IP neighbors, and shared elements ! for subsequent array allocations ! @@ -381,20 +381,24 @@ candidate: do i=1,minN ! iterate over lonelyNode's shared elements ! _maxNnodes, _maxNips, _maxNipNeighbors, _maxNsharedElems !******************************************************************** SUBROUTINE mesh_get_nodeElemDimensions (unit) - + use prec, only: pInt use IO implicit none - + integer(pInt), dimension (mesh_Nnodes) :: node_count + integer(pInt), dimension (:), allocatable :: node_seen integer(pInt) unit,i,j,n,t,e integer(pInt), dimension (133) :: pos character*300 line - + + integer(pInt) targetNode + 610 FORMAT(A300) - + node_count = 0_pInt - + allocate(node_seen(maxval(FE_Nnodes))) + rewind(unit) do read (unit,610,END=630) line @@ -410,18 +414,22 @@ candidate: do i=1,minN ! iterate over lonelyNode's shared elements mesh_maxNnodes = max(mesh_maxNnodes,FE_Nnodes(t)) mesh_maxNips = max(mesh_maxNips,FE_Nips(t)) mesh_maxNipNeighbors = max(mesh_maxNipNeighbors,FE_NipNeighbors(t)) + node_seen = 0_pInt do j=1,FE_Nnodes(t) n = mesh_FEasCP('node',IO_IntValue (line,pos,j+2)) - node_count(n) = node_count(n)+1 + if (all(node_seen /= n)) then + node_count(n) = node_count(n)+1 + end if + node_seen(j) = n end do end if end do exit end if end do - + 630 mesh_maxNsharedElems = maxval(node_count) - + return END SUBROUTINE