cleaning and making dependencies clear

This commit is contained in:
Martin Diehl 2019-02-03 12:28:04 +01:00
parent 91992debf2
commit 2aba6faf40
2 changed files with 20 additions and 22 deletions

View File

@ -490,7 +490,7 @@ subroutine mesh_init(ip,el)
if (myDebug) write(6,'(a)') ' Counted CP sizes'; flush(6) if (myDebug) write(6,'(a)') ' Counted CP sizes'; flush(6)
call mesh_abaqus_build_elements(FILEUNIT) call mesh_abaqus_build_elements(FILEUNIT)
if (myDebug) write(6,'(a)') ' Built elements'; flush(6) if (myDebug) write(6,'(a)') ' Built elements'; flush(6)
call mesh_get_damaskOptions(FILEUNIT) call mesh_get_damaskOptions(mesh_periodic_surface,FILEUNIT)
if (myDebug) write(6,'(a)') ' Got DAMASK options'; flush(6) if (myDebug) write(6,'(a)') ' Got DAMASK options'; flush(6)
close (FILEUNIT) close (FILEUNIT)
@ -1269,7 +1269,7 @@ end subroutine mesh_abaqus_build_elements
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
!> @brief get any additional damask options from input file, sets mesh_periodicSurface !> @brief get any additional damask options from input file, sets mesh_periodicSurface
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
subroutine mesh_get_damaskOptions(fileUnit) subroutine mesh_get_damaskOptions(periodic_surface,fileUnit)
use IO, only: & use IO, only: &
IO_lc, & IO_lc, &
@ -1282,21 +1282,20 @@ use IO, only: &
integer(pInt), allocatable, dimension(:) :: chunkPos integer(pInt), allocatable, dimension(:) :: chunkPos
character(len=300) :: line character(len=300) :: line
integer :: myStat integer :: myStat
logical :: inPart integer(pInt) :: chunk, Nchunks
integer(pInt) chunk, Nchunks character(len=300) :: v
character(len=300) :: damaskOption, v logical, dimension(3) :: periodic_surface
character(len=*), parameter :: keyword = '**damask'
mesh_periodicSurface = .false.
periodic_surface = .false.
myStat = 0 myStat = 0
rewind(fileUnit) rewind(fileUnit)
do while(myStat == 0) do while(myStat == 0)
read (fileUnit,'(a300)',iostat=myStat) line read (fileUnit,'(a300)',iostat=myStat) line
chunkPos = IO_stringPos(line) chunkPos = IO_stringPos(line)
Nchunks = chunkPos(1) Nchunks = chunkPos(1)
if (IO_lc(IO_stringValue(line,chunkPos,1_pInt)) == keyword .and. Nchunks > 1_pInt) then ! found keyword for damask option and there is at least one more chunk to read if (IO_lc(IO_stringValue(line,chunkPos,1_pInt)) == '**damask' .and. Nchunks > 1_pInt) then ! found keyword for damask option and there is at least one more chunk to read
damaskOption = IO_lc(IO_stringValue(line,chunkPos,2_pInt)) select case(IO_lc(IO_stringValue(line,chunkPos,2_pInt)))
select case(damaskOption)
case('periodic') ! damask Option that allows to specify periodic fluxes case('periodic') ! damask Option that allows to specify periodic fluxes
do chunk = 3_pInt,Nchunks ! loop through chunks (skipping the keyword) do chunk = 3_pInt,Nchunks ! loop through chunks (skipping the keyword)
v = IO_lc(IO_stringValue(line,chunkPos,chunk)) ! chunk matches keyvalues x,y, or z? v = IO_lc(IO_stringValue(line,chunkPos,chunk)) ! chunk matches keyvalues x,y, or z?

View File

@ -484,8 +484,7 @@ subroutine mesh_init(ip,el)
allocate(mesh_nameElemSet(mesh_NelemSets)); mesh_nameElemSet = 'n/a' allocate(mesh_nameElemSet(mesh_NelemSets)); mesh_nameElemSet = 'n/a'
allocate(mesh_mapElemSet(1_pInt+mesh_maxNelemInSet,mesh_NelemSets),source=0_pInt) allocate(mesh_mapElemSet(1_pInt+mesh_maxNelemInSet,mesh_NelemSets),source=0_pInt)
call mesh_marc_map_elementSets(mesh_nameElemSet,mesh_mapElemSet,& call mesh_marc_map_elementSets(mesh_nameElemSet,mesh_mapElemSet,FILEUNIT)
mesh_NelemSets,mesh_maxNelemInSet,FILEUNIT)
if (myDebug) write(6,'(a)') ' Mapped element sets'; flush(6) if (myDebug) write(6,'(a)') ' Mapped element sets'; flush(6)
mesh_NcpElems = mesh_marc_count_cpElements(hypoelasticTableStyle,Marc_matNumber,fileFormatVersion,FILEUNIT) mesh_NcpElems = mesh_marc_count_cpElements(hypoelasticTableStyle,Marc_matNumber,fileFormatVersion,FILEUNIT)
@ -500,6 +499,7 @@ subroutine mesh_init(ip,el)
if (myDebug) write(6,'(a)') ' Mapped nodes'; flush(6) if (myDebug) write(6,'(a)') ' Mapped nodes'; flush(6)
call mesh_marc_build_nodes(FILEUNIT) !ToDo: don't work on global variables call mesh_marc_build_nodes(FILEUNIT) !ToDo: don't work on global variables
mesh_node = mesh_node0
if (myDebug) write(6,'(a)') ' Built nodes'; flush(6) if (myDebug) write(6,'(a)') ' Built nodes'; flush(6)
elemType = mesh_marc_count_cpSizes(FILEUNIT) elemType = mesh_marc_count_cpSizes(FILEUNIT)
@ -626,7 +626,7 @@ subroutine mesh_marc_get_tableStyles(initialcond, hypoelastic,fileUnit)
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
!> @brief Figures out material number of hypoelastic material and stores it in Marc_matNumber array !> @brief Figures out material number of hypoelastic material
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
function mesh_marc_get_matNumber(fileUnit,tableStyle) function mesh_marc_get_matNumber(fileUnit,tableStyle)
use IO, only: & use IO, only: &
@ -751,7 +751,7 @@ subroutine mesh_marc_count_nodesAndElements(nNodes, nElems, fileUnit)
!> @brief map element sets !> @brief map element sets
!! allocate globals: mesh_nameElemSet, mesh_mapElemSet !! allocate globals: mesh_nameElemSet, mesh_mapElemSet
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
subroutine mesh_marc_map_elementSets(nameElemSet,mapElemSet,NelemSets,maxNelemInSet,fileUnit) subroutine mesh_marc_map_elementSets(nameElemSet,mapElemSet,fileUnit)
use IO, only: IO_lc, & use IO, only: IO_lc, &
IO_stringValue, & IO_stringValue, &
@ -759,10 +759,10 @@ subroutine mesh_marc_map_elementSets(nameElemSet,mapElemSet,NelemSets,maxNelemIn
IO_continuousIntValues IO_continuousIntValues
implicit none implicit none
integer(pInt), intent(in) :: fileUnit,NelemSets,maxNelemInSet integer(pInt), intent(in) :: fileUnit,NelemSets
character(len=64), dimension(mesh_NelemSets), intent(out) :: & character(len=64), dimension(:), intent(out) :: &
nameElemSet nameElemSet
integer(pInt), dimension(1_pInt+maxNelemInSet,NelemSets), intent(out) :: & integer(pInt), dimension(:,:), intent(out) :: &
mapElemSet mapElemSet
integer(pInt), allocatable, dimension(:) :: chunkPos integer(pInt), allocatable, dimension(:) :: chunkPos
@ -779,7 +779,7 @@ subroutine mesh_marc_map_elementSets(nameElemSet,mapElemSet,NelemSets,maxNelemIn
(IO_lc(IO_stringValue(line,chunkPos,2_pInt)) == 'element' ) ) then (IO_lc(IO_stringValue(line,chunkPos,2_pInt)) == 'element' ) ) then
elemSet = elemSet+1_pInt elemSet = elemSet+1_pInt
nameElemSet(elemSet) = trim(IO_stringValue(line,chunkPos,4_pInt)) nameElemSet(elemSet) = trim(IO_stringValue(line,chunkPos,4_pInt))
mapElemSet(:,elemSet) = IO_continuousIntValues(fileUnit,maxNelemInSet,nameElemSet,mapElemSet,NelemSets) mapElemSet(:,elemSet) = IO_continuousIntValues(fileUnit,size(mapElemSet,1)-1,nameElemSet,mapElemSet,size(nameElemSet))
endif endif
enddo enddo
@ -860,8 +860,9 @@ subroutine mesh_marc_map_elements(fileUnit)
tmp tmp
integer(pInt), dimension (1_pInt+mesh_NcpElems) :: contInts integer(pInt), dimension (1_pInt+mesh_NcpElems) :: contInts
integer(pInt) :: i,cpElem = 0_pInt integer(pInt) :: i,cpElem
cpElem = 0_pInt
contInts = 0_pInt contInts = 0_pInt
rewind(fileUnit) rewind(fileUnit)
do do
@ -971,8 +972,6 @@ subroutine mesh_marc_build_nodes(fileUnit)
integer(pInt) :: i,j,m integer(pInt) :: i,j,m
allocate ( mesh_node0 (3,mesh_Nnodes), source=0.0_pReal) allocate ( mesh_node0 (3,mesh_Nnodes), source=0.0_pReal)
allocate ( mesh_node (3,mesh_Nnodes), source=0.0_pReal)
rewind(fileUnit) rewind(fileUnit)
do do