almost no shared functionality

This commit is contained in:
Martin Diehl 2019-10-12 19:24:03 +02:00
parent d8d99f3694
commit e6d25bfdab
1 changed files with 40 additions and 16 deletions

View File

@ -92,7 +92,6 @@ integer, dimension(:,:), allocatable :: &
mesh_ipNeighborhood2 !< 6 or less neighboring IPs as [element_num, IP_index, neighbor_index that points to me] mesh_ipNeighborhood2 !< 6 or less neighboring IPs as [element_num, IP_index, neighbor_index that points to me]
public :: & public :: &
mesh_init, & mesh_init, &
mesh_build_cellnodes, & mesh_build_cellnodes, &
@ -163,7 +162,8 @@ subroutine mesh_init(ip,el)
allocate(homogenizationAt(theMesh%nElems), source=0) allocate(homogenizationAt(theMesh%nElems), source=0)
allocate(mesh_FEnodes(theMesh%elem%nNodes,theMesh%nElems), source=0) allocate(mesh_FEnodes(theMesh%elem%nNodes,theMesh%nElems), source=0)
call mesh_marc_buildElements(microstructureAt,homogenizationAt, & call mesh_marc_buildElements(mesh_nElems,theMesh%elem%nNodes,FILEUNIT)
call mesh_marc_buildElements2(microstructureAt,homogenizationAt, &
mesh_nElems,theMesh%elem%nNodes,initialcondTableStyle,FILEUNIT) mesh_nElems,theMesh%elem%nNodes,initialcondTableStyle,FILEUNIT)
if (myDebug) write(6,'(a)') ' Built elements'; flush(6) if (myDebug) write(6,'(a)') ' Built elements'; flush(6)
close (FILEUNIT) close (FILEUNIT)
@ -625,18 +625,13 @@ end function mapElemtype
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
!> @brief Stores node IDs and homogenization and microstructure ID !> @brief Stores node IDs
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
subroutine mesh_marc_buildElements(microstructureAt,homogenizationAt, & subroutine mesh_marc_buildElements(nElem,nNodes,fileUnit)
nElem,nNodes,initialcondTableStyle,fileUnit)
integer, dimension(:), intent(out) :: &
microstructureAt, &
homogenizationAt
integer, intent(in) :: & integer, intent(in) :: &
nElem, & nElem, &
nNodes, & !< number of nodes per element nNodes, & !< number of nodes per element
initialcondTableStyle, &
fileUnit fileUnit
integer, allocatable, dimension(:) :: chunkPos integer, allocatable, dimension(:) :: chunkPos
@ -674,7 +669,7 @@ subroutine mesh_marc_buildElements(microstructureAt,homogenizationAt, &
exit exit
endif endif
enddo enddo
620 rewind(fileUnit) ! just in case "initial state" appears before "connectivity" 620 rewind(fileUnit)
#if defined(DAMASK_HDF5) #if defined(DAMASK_HDF5)
call results_openJobFile call results_openJobFile
@ -686,6 +681,30 @@ subroutine mesh_marc_buildElements(microstructureAt,homogenizationAt, &
call buildCells(theMesh,theMesh%elem,mesh_FEnodes) call buildCells(theMesh,theMesh%elem,mesh_FEnodes)
end subroutine mesh_marc_buildElements
!--------------------------------------------------------------------------------------------------
!> @brief Stores homogenization and microstructure ID
!--------------------------------------------------------------------------------------------------
subroutine mesh_marc_buildElements2(microstructureAt,homogenizationAt, &
nElem,nNodes,initialcondTableStyle,fileUnit)
integer, dimension(:), intent(out) :: &
microstructureAt, &
homogenizationAt
integer, intent(in) :: &
nElem, &
nNodes, & !< number of nodes per element
initialcondTableStyle, &
fileUnit
integer, allocatable, dimension(:) :: chunkPos
character(len=300) line
integer, dimension(1+nElem) :: contInts
integer :: i,j,t,sv,myVal,e,nNodesAlreadyRead
read (fileUnit,'(A300)',END=630) line read (fileUnit,'(A300)',END=630) line
do do
chunkPos = IO_stringPos(line) chunkPos = IO_stringPos(line)
@ -721,7 +740,7 @@ subroutine mesh_marc_buildElements(microstructureAt,homogenizationAt, &
endif endif
enddo enddo
630 end subroutine mesh_marc_buildElements 630 end subroutine mesh_marc_buildElements2
subroutine buildCells(thisMesh,elem,connectivity_elem) subroutine buildCells(thisMesh,elem,connectivity_elem)
@ -1006,7 +1025,7 @@ function mesh_build_cellnodes()
end function mesh_build_cellnodes end function mesh_build_cellnodes
!-------------------------------------------------------------------------------------------------- !---------------------------------------------------------------------------------------------------
!> @brief Calculates IP volume. !> @brief Calculates IP volume.
!> @details The IP volume is calculated differently depending on the cell type. !> @details The IP volume is calculated differently depending on the cell type.
!> 2D cells assume an element depth of one in order to calculate the volume. !> 2D cells assume an element depth of one in order to calculate the volume.
@ -1014,7 +1033,7 @@ end function mesh_build_cellnodes
!> shape with a cell face as basis and the central ip at the tip. This subvolume is !> shape with a cell face as basis and the central ip at the tip. This subvolume is
!> calculated as an average of four tetrahedals with three corners on the cell face !> calculated as an average of four tetrahedals with three corners on the cell face
!> and one corner at the central ip. !> and one corner at the central ip.
!-------------------------------------------------------------------------------------------------- !---------------------------------------------------------------------------------------------------
function IPvolume() function IPvolume()
real(pReal), dimension(theMesh%elem%nIPs,theMesh%nElems) :: IPvolume real(pReal), dimension(theMesh%elem%nIPs,theMesh%nElems) :: IPvolume
@ -1068,12 +1087,16 @@ function IPvolume()
end function IPvolume end function IPvolume
!---------------------------------------------------------------------------------------------------
!> @brief cell neighborhood
!---------------------------------------------------------------------------------------------------
subroutine IP_neighborhood2 subroutine IP_neighborhood2
integer, dimension(:,:), allocatable :: faces integer, dimension(:,:), allocatable :: faces
integer, dimension(:), allocatable :: face integer, dimension(:), allocatable :: face
integer :: e,i,f,c,m,n,j,k,l,p, current, next,i2,e2,n2,k2 integer :: e,i,f,c,m,n,j,k,l,p, current, next,i2,e2,n2,k2
logical :: match logical :: match
allocate(faces(size(theMesh%elem%cellface,1)+3,size(theMesh%elem%cellface,2)*theMesh%elem%nIPs*theMesh%Nelems)) allocate(faces(size(theMesh%elem%cellface,1)+3,size(theMesh%elem%cellface,2)*theMesh%elem%nIPs*theMesh%Nelems))
! store cell face definitions ! store cell face definitions
@ -1140,6 +1163,7 @@ subroutine IP_neighborhood2
end subroutine IP_neighborhood2 end subroutine IP_neighborhood2
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
!> @brief Calculates IP Coordinates. !> @brief Calculates IP Coordinates.
! Marc however only provides nodal displacements, ! Marc however only provides nodal displacements,