added full description of element type 2

This commit is contained in:
Philip Eisenlohr 2009-01-16 17:36:37 +00:00
parent 8788cc4f8a
commit 4b67529aaf
1 changed files with 631 additions and 713 deletions

View File

@ -34,11 +34,13 @@
! _ipNeighbor : +x,-x,+y,-y,+z,-z list of intra-element IPs and ! _ipNeighbor : +x,-x,+y,-y,+z,-z list of intra-element IPs and
! (negative) neighbor faces per own IP in a specific type of element ! (negative) neighbor faces per own IP in a specific type of element
! _NfaceNodes : # nodes per face in a specific type of element ! _NfaceNodes : # nodes per face in a specific type of element
! _nodeOnFace : list of node indices on each face of a specific type of element ! _nodeOnFace : list of node indices on each face of a specific type of element
! _ipAtNode : map node index to IP index in a specific type of element ! _ipAtNode : map node index to IP index in a specific type of element
! _nodeAtIP : map IP index to node index in a specific type of element ! _nodeAtIP : map IP index to node index in a specific type of element
! _ipNeighborhood : 6 or less neighboring IPs as [element_num, IP_index] ! _ipNeighborhood : 6 or less neighboring IPs as [element_num, IP_index]
! _NsubNodes : # subnodes required to fully define all IP volumes ! _NsubNodes : # subnodes required to fully define all IP volumes
! order is +x,-x,+y,-y,+z,-z but meaning strongly depends on Elemtype ! order is +x,-x,+y,-y,+z,-z but meaning strongly depends on Elemtype
! --------------------------- ! ---------------------------
integer(pInt) mesh_Nelems,mesh_NcpElems,mesh_NelemSets,mesh_maxNelemInSet integer(pInt) mesh_Nelems,mesh_NcpElems,mesh_NelemSets,mesh_maxNelemInSet
@ -391,10 +393,10 @@
0, 0, 0, 0, & 0, 0, 0, 0, &
0, 0, 0, 0, & 0, 0, 0, 0, &
0, 0, 0, 0, & 0, 0, 0, 0, &
0, 0, 0, 0, & ! element 134 1, 3, 2, 0, & ! element 134
0, 0, 0, 0, & 1, 2, 4, 0, &
0, 0, 0, 0, & 2, 3, 4, 0, &
0, 0, 0, 0, & 1, 4, 3, 0, &
0, 0, 0, 0, & 0, 0, 0, 0, &
0, 0, 0, 0, & 0, 0, 0, 0, &
0, 0, 0, 0, & ! 0, 0, 0, 0, & !
@ -670,19 +672,16 @@
! function mesh_build_ipNeighorhood() ! function mesh_build_ipNeighorhood()
! --------------------------- ! ---------------------------
!*********************************************************** !***********************************************************
! initialization ! initialization
!*********************************************************** !***********************************************************
SUBROUTINE mesh_init () SUBROUTINE mesh_init ()
use prec, only: pInt use prec, only: pInt
use IO, only: IO_error,IO_open_InputFile use IO, only: IO_error,IO_open_InputFile
use FEsolving, only: FE_get_solverSymmetry use FEsolving, only: FE_get_solverSymmetry
implicit none implicit none
integer(pInt), parameter :: fileUnit = 222 integer(pInt), parameter :: fileUnit = 222
mesh_Nelems = 0_pInt mesh_Nelems = 0_pInt
mesh_NcpElems = 0_pInt mesh_NcpElems = 0_pInt
mesh_Nnodes = 0_pInt mesh_Nnodes = 0_pInt
@ -694,8 +693,6 @@
mesh_NelemSets = 0_pInt mesh_NelemSets = 0_pInt
mesh_maxNelemInSet = 0_pInt mesh_maxNelemInSet = 0_pInt
! call to various subroutines to parse the stuff from the input file... ! call to various subroutines to parse the stuff from the input file...
if (IO_open_inputFile(fileUnit)) then if (IO_open_inputFile(fileUnit)) then
call FE_get_solverSymmetry(fileUnit) call FE_get_solverSymmetry(fileUnit)
@ -720,12 +717,10 @@
END SUBROUTINE END SUBROUTINE
!*********************************************************** !***********************************************************
! mapping of FE element types to internal representation ! mapping of FE element types to internal representation
!*********************************************************** !***********************************************************
FUNCTION FE_mapElemtype(what) FUNCTION FE_mapElemtype(what)
implicit none implicit none
character(len=*), intent(in) :: what character(len=*), intent(in) :: what
@ -747,11 +742,8 @@
case default case default
FE_mapElemtype = 0 ! unknown element --> should raise an error upstream..! FE_mapElemtype = 0 ! unknown element --> should raise an error upstream..!
end select end select
END FUNCTION END FUNCTION
!*********************************************************** !***********************************************************
! FE to CP id mapping by binary search thru lookup array ! FE to CP id mapping by binary search thru lookup array
! !
@ -806,15 +798,12 @@
END FUNCTION END FUNCTION
!*********************************************************** !***********************************************************
! find face-matching element of same type ! find face-matching element of same type
!!*********************************************************** !!***********************************************************
FUNCTION mesh_faceMatch(face,elem) FUNCTION mesh_faceMatch(face,elem)
use prec, only: pInt use prec, only: pInt
implicit none implicit none
integer(pInt) face,elem integer(pInt) face,elem
integer(pInt) mesh_faceMatch integer(pInt) mesh_faceMatch
integer(pInt), dimension(FE_NfaceNodes(face,mesh_element(2,elem))) :: nodeMap integer(pInt), dimension(FE_NfaceNodes(face,mesh_element(2,elem))) :: nodeMap
@ -823,7 +812,6 @@
minN = mesh_maxNsharedElems+1 ! init to worst case minN = mesh_maxNsharedElems+1 ! init to worst case
mesh_faceMatch = 0_pInt ! intialize to "no match found" mesh_faceMatch = 0_pInt ! intialize to "no match found"
t = mesh_element(2,elem) ! figure elemType t = mesh_element(2,elem) ! figure elemType
do faceNode=1,FE_NfaceNodes(face,t) ! loop over nodes on face do faceNode=1,FE_NfaceNodes(face,t) ! loop over nodes on face
nodeMap(faceNode) = mesh_FEasCP('node',mesh_element(4+FE_nodeOnFace(faceNode,face,t),elem)) ! CP id of face node nodeMap(faceNode) = mesh_FEasCP('node',mesh_element(4+FE_nodeOnFace(faceNode,face,t),elem)) ! CP id of face node
NsharedElems = mesh_sharedElem(1,nodeMap(faceNode)) ! figure # shared elements for this node NsharedElems = mesh_sharedElem(1,nodeMap(faceNode)) ! figure # shared elements for this node
@ -853,7 +841,6 @@ candidate: do i=1,minN ! iterate over lonelyNode's shared elements
END FUNCTION END FUNCTION
!******************************************************************** !********************************************************************
! get count of elements, nodes, and cp elements in mesh ! get count of elements, nodes, and cp elements in mesh
! for subsequent array allocations ! for subsequent array allocations
@ -862,21 +849,16 @@ candidate: do i=1,minN ! iterate over lonelyNode's shared elements
! _Nelems, _Nnodes, _NcpElems ! _Nelems, _Nnodes, _NcpElems
!******************************************************************** !********************************************************************
SUBROUTINE mesh_get_meshDimensions (unit) SUBROUTINE mesh_get_meshDimensions (unit)
use prec, only: pInt use prec, only: pInt
use IO use IO
implicit none implicit none
integer(pInt) unit,i,pos(41) integer(pInt) unit,i,pos(41)
character*300 line character*300 line
610 FORMAT(A300) 610 FORMAT(A300)
rewind(unit) rewind(unit)
do do
read (unit,610,END=620) line read (unit,610,END=620) line
pos = IO_stringPos(line,20) pos = IO_stringPos(line,20)
select case ( IO_lc(IO_StringValue(line,pos,1))) select case ( IO_lc(IO_StringValue(line,pos,1)))
case('table') case('table')
if (pos(1) == 6) then if (pos(1) == 6) then
@ -898,14 +880,11 @@ candidate: do i=1,minN ! iterate over lonelyNode's shared elements
end do end do
mesh_NcpElems = mesh_NcpElems + IO_countContinousIntValues(unit) mesh_NcpElems = mesh_NcpElems + IO_countContinousIntValues(unit)
end select end select
end do end do
620 return 620 return
END SUBROUTINE END SUBROUTINE
!!******************************************************************** !!********************************************************************
! get maximum count of nodes, IPs, IP neighbors, and shared elements ! get maximum count of nodes, IPs, IP neighbors, and shared elements
! for subsequent array allocations ! for subsequent array allocations
@ -971,22 +950,16 @@ candidate: do i=1,minN ! iterate over lonelyNode's shared elements
! allocate globals: mesh_nameElemSet, mesh_mapElemSet ! allocate globals: mesh_nameElemSet, mesh_mapElemSet
!******************************************************************** !********************************************************************
SUBROUTINE mesh_build_elemSetMapping (unit) SUBROUTINE mesh_build_elemSetMapping (unit)
use prec, only: pInt use prec, only: pInt
use IO use IO
implicit none implicit none
integer unit, elem_set integer unit, elem_set
character*300 line character*300 line
integer(pInt), dimension (9) :: pos ! count plus 4 entities on a line integer(pInt), dimension (9) :: pos ! count plus 4 entities on a line
610 FORMAT(A300) 610 FORMAT(A300)
allocate (mesh_nameElemSet(mesh_NelemSets)) allocate (mesh_nameElemSet(mesh_NelemSets))
allocate (mesh_mapElemSet(1+mesh_maxNelemInSet,mesh_NelemSets)) ; mesh_mapElemSet = 0_pInt allocate (mesh_mapElemSet(1+mesh_maxNelemInSet,mesh_NelemSets)) ; mesh_mapElemSet = 0_pInt
elem_set = 0_pInt elem_set = 0_pInt
rewind(unit) rewind(unit)
do do
read (unit,610,END=620) line read (unit,610,END=620) line
@ -998,11 +971,9 @@ candidate: do i=1,minN ! iterate over lonelyNode's shared elements
mesh_mapElemSet(:,elem_set) = IO_continousIntValues(unit,mesh_maxNelemInSet,mesh_nameElemSet,mesh_mapElemSet,mesh_NelemSets) mesh_mapElemSet(:,elem_set) = IO_continousIntValues(unit,mesh_maxNelemInSet,mesh_nameElemSet,mesh_mapElemSet,mesh_NelemSets)
end if end if
end do end do
620 return 620 return
END SUBROUTINE END SUBROUTINE
!******************************************************************** !********************************************************************
! Build node mapping from FEM to CP ! Build node mapping from FEM to CP
! !
@ -1010,22 +981,17 @@ candidate: do i=1,minN ! iterate over lonelyNode's shared elements
! _mapFEtoCPnode ! _mapFEtoCPnode
!******************************************************************** !********************************************************************
SUBROUTINE mesh_build_nodeMapping (unit) SUBROUTINE mesh_build_nodeMapping (unit)
use prec, only: pInt use prec, only: pInt
use math, only: qsort use math, only: qsort
use IO use IO
implicit none implicit none
integer(pInt), dimension (mesh_Nnodes) :: node_count integer(pInt), dimension (mesh_Nnodes) :: node_count
integer(pInt) unit,i integer(pInt) unit,i
integer(pInt), dimension (133) :: pos integer(pInt), dimension (133) :: pos
character*300 line character*300 line
610 FORMAT(A300) 610 FORMAT(A300)
allocate (mesh_mapFEtoCPnode(2,mesh_Nnodes)) ; mesh_mapFEtoCPnode = 0_pInt allocate (mesh_mapFEtoCPnode(2,mesh_Nnodes)) ; mesh_mapFEtoCPnode = 0_pInt
node_count(:) = 0_pInt node_count(:) = 0_pInt
rewind(unit) rewind(unit)
do do
read (unit,610,END=620) line read (unit,610,END=620) line
@ -1040,13 +1006,10 @@ candidate: do i=1,minN ! iterate over lonelyNode's shared elements
exit exit
end if end if
end do end do
620 call qsort(mesh_mapFEtoCPnode,1,size(mesh_mapFEtoCPnode,2)) 620 call qsort(mesh_mapFEtoCPnode,1,size(mesh_mapFEtoCPnode,2))
return return
END SUBROUTINE END SUBROUTINE
!******************************************************************** !********************************************************************
! Build element mapping from FEM to CP ! Build element mapping from FEM to CP
! !
@ -1054,24 +1017,18 @@ candidate: do i=1,minN ! iterate over lonelyNode's shared elements
! _mapFEtoCPelem ! _mapFEtoCPelem
!******************************************************************** !********************************************************************
SUBROUTINE mesh_build_elemMapping (unit) SUBROUTINE mesh_build_elemMapping (unit)
use prec, only: pInt use prec, only: pInt
use math, only: qsort use math, only: qsort
use IO use IO
implicit none implicit none
integer unit, i,CP_elem integer unit, i,CP_elem
character*300 line character*300 line
integer(pInt), dimension (3) :: pos integer(pInt), dimension (3) :: pos
integer(pInt), dimension (1+mesh_NcpElems) :: contInts integer(pInt), dimension (1+mesh_NcpElems) :: contInts
610 FORMAT(A300) 610 FORMAT(A300)
allocate (mesh_mapFEtoCPelem(2,mesh_NcpElems)) ; mesh_mapFEtoCPelem = 0_pInt allocate (mesh_mapFEtoCPelem(2,mesh_NcpElems)) ; mesh_mapFEtoCPelem = 0_pInt
CP_elem = 0_pInt CP_elem = 0_pInt
rewind(unit) rewind(unit)
do do
read (unit,610,END=620) line read (unit,610,END=620) line
@ -1088,13 +1045,10 @@ candidate: do i=1,minN ! iterate over lonelyNode's shared elements
enddo enddo
end if end if
end do end do
620 call qsort(mesh_mapFEtoCPelem,1,size(mesh_mapFEtoCPelem,2)) ! should be mesh_NcpElems 620 call qsort(mesh_mapFEtoCPelem,1,size(mesh_mapFEtoCPelem,2)) ! should be mesh_NcpElems
return return
END SUBROUTINE END SUBROUTINE
!******************************************************************** !********************************************************************
! store x,y,z coordinates of all nodes in mesh ! store x,y,z coordinates of all nodes in mesh
! !
@ -1102,21 +1056,16 @@ candidate: do i=1,minN ! iterate over lonelyNode's shared elements
! _node ! _node
!******************************************************************** !********************************************************************
SUBROUTINE mesh_build_nodes (unit) SUBROUTINE mesh_build_nodes (unit)
use prec, only: pInt use prec, only: pInt
use IO use IO
implicit none implicit none
integer unit,i,j,m integer unit,i,j,m
integer(pInt), dimension(3) :: pos integer(pInt), dimension(3) :: pos
integer(pInt), dimension(5), parameter :: node_ends = (/0,10,30,50,70/) integer(pInt), dimension(5), parameter :: node_ends = (/0,10,30,50,70/)
character*300 line character*300 line
allocate ( mesh_node (3,mesh_Nnodes) ) allocate ( mesh_node (3,mesh_Nnodes) )
mesh_node(:,:) = 0_pInt mesh_node(:,:) = 0_pInt
610 FORMAT(A300) 610 FORMAT(A300)
rewind(unit) rewind(unit)
do do
read (unit,610,END=620) line read (unit,610,END=620) line
@ -1133,12 +1082,9 @@ candidate: do i=1,minN ! iterate over lonelyNode's shared elements
exit exit
end if end if
end do end do
620 return 620 return
END SUBROUTINE END SUBROUTINE
!******************************************************************** !********************************************************************
! store FEid, type, mat, tex, and node list per element ! store FEid, type, mat, tex, and node list per element
! !
@ -1146,21 +1092,16 @@ candidate: do i=1,minN ! iterate over lonelyNode's shared elements
! _element ! _element
!******************************************************************** !********************************************************************
SUBROUTINE mesh_build_elements (unit) SUBROUTINE mesh_build_elements (unit)
use prec, only: pInt use prec, only: pInt
use IO use IO
implicit none implicit none
integer unit,i,j,sv,val,CP_elem integer unit,i,j,sv,val,CP_elem
integer(pInt), dimension(133) :: pos integer(pInt), dimension(133) :: pos
integer(pInt), dimension(1+mesh_NcpElems) :: contInts integer(pInt), dimension(1+mesh_NcpElems) :: contInts
character*300 line character*300 line
allocate (mesh_element (4+mesh_maxNnodes,mesh_NcpElems)) ; mesh_element = 0_pInt allocate (mesh_element (4+mesh_maxNnodes,mesh_NcpElems)) ; mesh_element = 0_pInt
610 FORMAT(A300) 610 FORMAT(A300)
rewind(unit) rewind(unit)
do do
read (unit,610,END=620) line read (unit,610,END=620) line
@ -1217,12 +1158,9 @@ candidate: do i=1,minN ! iterate over lonelyNode's shared elements
read (unit,610,END=620) line read (unit,610,END=620) line
endif endif
enddo enddo
620 return 620 return
END SUBROUTINE END SUBROUTINE
!******************************************************************** !********************************************************************
! build list of elements shared by each node in mesh ! build list of elements shared by each node in mesh
! !
@ -1230,22 +1168,17 @@ candidate: do i=1,minN ! iterate over lonelyNode's shared elements
! _sharedElem ! _sharedElem
!******************************************************************** !********************************************************************
SUBROUTINE mesh_build_sharedElems (unit) SUBROUTINE mesh_build_sharedElems (unit)
use prec, only: pInt use prec, only: pInt
use IO use IO
implicit none implicit none
integer(pint) unit,i,j,n,e integer(pint) unit,i,j,n,e
integer(pInt), dimension (133) :: pos integer(pInt), dimension (133) :: pos
integer(pInt), dimension (:), allocatable :: node_seen integer(pInt), dimension (:), allocatable :: node_seen
character*300 line character*300 line
610 FORMAT(A300) 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) rewind(unit)
do do
read (unit,610,END=620) line read (unit,610,END=620) line
@ -1271,12 +1204,9 @@ candidate: do i=1,minN ! iterate over lonelyNode's shared elements
exit exit
end if end if
end do end do
620 return 620 return
END SUBROUTINE END SUBROUTINE
!*********************************************************** !***********************************************************
! build up of IP neighborhood ! build up of IP neighborhood
! !
@ -1290,7 +1220,6 @@ candidate: do i=1,minN ! iterate over lonelyNode's shared elements
integer(pInt) e,t,i,j,k,n integer(pInt) e,t,i,j,k,n
integer(pInt) neighbor,neighboringElem,neighboringIP,matchingElem,faceNode,linkingNode integer(pInt) neighbor,neighboringElem,neighboringIP,matchingElem,faceNode,linkingNode
allocate(mesh_ipNeighborhood(2,mesh_maxNipNeighbors,mesh_maxNips,mesh_NcpElems)) ; mesh_ipNeighborhood = 0_pInt allocate(mesh_ipNeighborhood(2,mesh_maxNipNeighbors,mesh_maxNips,mesh_NcpElems)) ; mesh_ipNeighborhood = 0_pInt
do e = 1,mesh_NcpElems ! loop over cpElems do e = 1,mesh_NcpElems ! loop over cpElems
@ -1482,24 +1411,16 @@ matchFace: do j = 1,FE_NfaceNodes(-neighbor,t) ! count over nodes on matc
! !
!*********************************************************** !***********************************************************
SUBROUTINE mesh_tell_statistics() SUBROUTINE mesh_tell_statistics()
use prec, only: pInt use prec, only: pInt
use IO, only: IO_error use IO, only: IO_error
implicit none implicit none
integer(pInt), dimension (:,:), allocatable :: mesh_MatTex integer(pInt), dimension (:,:), allocatable :: mesh_MatTex
character(len=64) fmt character(len=64) fmt
integer(pInt) i integer(pInt) i
if (mesh_maxValStateVar(1) == 0) call IO_error(110) ! no materials specified if (mesh_maxValStateVar(1) == 0) call IO_error(110) ! no materials specified
if (mesh_maxValStateVar(2) == 0) call IO_error(120) ! no textures specified if (mesh_maxValStateVar(2) == 0) call IO_error(120) ! no textures specified
allocate (mesh_MatTex(mesh_maxValStateVar(1),mesh_maxValStateVar(2))) allocate (mesh_MatTex(mesh_maxValStateVar(1),mesh_maxValStateVar(2)))
mesh_MatTex = 0_pInt mesh_MatTex = 0_pInt
do i=1,mesh_NcpElems do i=1,mesh_NcpElems
@ -1508,7 +1429,6 @@ matchFace: do j = 1,FE_NfaceNodes(-neighbor,t) ! count over nodes on matc
enddo enddo
!$OMP CRITICAL (write2out) !$OMP CRITICAL (write2out)
write (6,*) write (6,*)
write (6,*) "Input Parser: STATISTICS" write (6,*) "Input Parser: STATISTICS"
write (6,*) write (6,*)
@ -1526,7 +1446,6 @@ matchFace: do j = 1,FE_NfaceNodes(-neighbor,t) ! count over nodes on matc
write (6,*) mesh_maxValStateVar(1), " : maximum material index" write (6,*) mesh_maxValStateVar(1), " : maximum material index"
write (6,*) mesh_maxValStateVar(2), " : maximum texture index" write (6,*) mesh_maxValStateVar(2), " : maximum texture index"
write (6,*) write (6,*)
write (fmt,"(a,i3,a)") "(i8,x,a1,x,",mesh_maxValStateVar(2),"(i8))" write (fmt,"(a,i3,a)") "(i8,x,a1,x,",mesh_maxValStateVar(2),"(i8))"
do i=1,mesh_maxValStateVar(1) ! loop over all (possibly assigned) materials do i=1,mesh_maxValStateVar(1) ! loop over all (possibly assigned) materials
write (6,fmt) i,"|",mesh_MatTex(i,:) ! loop over all (possibly assigned) textures write (6,fmt) i,"|",mesh_MatTex(i,:) ! loop over all (possibly assigned) textures
@ -1534,7 +1453,6 @@ matchFace: do j = 1,FE_NfaceNodes(-neighbor,t) ! count over nodes on matc
write (6,*) write (6,*)
!$OMP END CRITICAL (write2out) !$OMP END CRITICAL (write2out)
return return
END SUBROUTINE END SUBROUTINE