2012-08-25 17:16:36 +05:30
|
|
|
!--------------------------------------------------------------------------------------------------
|
|
|
|
!> @author Franz Roters, Max-Planck-Institut für Eisenforschung GmbH
|
|
|
|
!> Philip Eisenlohr, Max-Planck-Institut für Eisenforschung GmbH
|
2013-02-27 00:31:31 +05:30
|
|
|
!> @brief triggering reading in of restart information when doing a restart
|
2013-06-11 22:05:04 +05:30
|
|
|
!> @todo Descriptions for public variables needed
|
2012-08-25 17:16:36 +05:30
|
|
|
!--------------------------------------------------------------------------------------------------
|
2012-03-09 01:55:28 +05:30
|
|
|
module FEsolving
|
2012-03-20 23:31:31 +05:30
|
|
|
use prec, only: &
|
|
|
|
pInt, &
|
|
|
|
pReal
|
2012-03-09 01:55:28 +05:30
|
|
|
|
2008-03-15 03:02:57 +05:30
|
|
|
implicit none
|
2012-03-20 23:31:31 +05:30
|
|
|
private
|
2016-01-17 18:59:42 +05:30
|
|
|
integer(pInt), public :: &
|
|
|
|
restartInc = 1_pInt !< needs description
|
2013-06-11 22:05:04 +05:30
|
|
|
|
2012-03-20 23:31:31 +05:30
|
|
|
logical, public :: &
|
2016-01-17 18:59:42 +05:30
|
|
|
symmetricSolver = .false., & !< use a symmetric FEM solver
|
2012-08-25 17:16:36 +05:30
|
|
|
restartWrite = .false., & !< write current state to enable restart
|
|
|
|
restartRead = .false., & !< restart information to continue calculation from saved state
|
2016-01-17 18:59:42 +05:30
|
|
|
terminallyIll = .false. !< at least one material point is terminally ill
|
2012-03-20 23:31:31 +05:30
|
|
|
|
|
|
|
integer(pInt), dimension(:,:), allocatable, public :: &
|
2014-05-22 20:54:12 +05:30
|
|
|
FEsolving_execIP !< for ping-pong scheme always range to max IP, otherwise one specific IP
|
2012-03-09 01:55:28 +05:30
|
|
|
|
2012-03-20 23:31:31 +05:30
|
|
|
integer(pInt), dimension(2), public :: &
|
2014-05-22 20:54:12 +05:30
|
|
|
FEsolving_execElem !< for ping-pong scheme always whole range, otherwise one specific element
|
2012-03-09 01:55:28 +05:30
|
|
|
|
2012-03-20 23:31:31 +05:30
|
|
|
character(len=1024), public :: &
|
2013-06-11 22:05:04 +05:30
|
|
|
modelName !< needs description
|
2012-03-09 01:55:28 +05:30
|
|
|
|
2012-03-20 23:31:31 +05:30
|
|
|
logical, dimension(:,:), allocatable, public :: &
|
2015-11-26 02:25:17 +05:30
|
|
|
calcMode !< do calculation or simply collect when using ping pong scheme
|
2012-03-21 23:34:52 +05:30
|
|
|
|
2012-03-09 01:55:28 +05:30
|
|
|
public :: FE_init
|
2008-03-15 03:02:57 +05:30
|
|
|
|
2012-03-09 01:55:28 +05:30
|
|
|
contains
|
2009-01-20 00:40:58 +05:30
|
|
|
|
2013-02-11 15:14:17 +05:30
|
|
|
|
2012-08-25 17:16:36 +05:30
|
|
|
!--------------------------------------------------------------------------------------------------
|
|
|
|
!> @brief determine whether a symmetric solver is used and whether restart is requested
|
2013-02-27 00:31:31 +05:30
|
|
|
!> @details restart information is found in input file in case of FEM solvers, in case of spectal
|
|
|
|
!> solver the information is provided by the interface module
|
2012-08-25 17:16:36 +05:30
|
|
|
!--------------------------------------------------------------------------------------------------
|
2012-03-09 01:55:28 +05:30
|
|
|
subroutine FE_init
|
2012-03-20 23:31:31 +05:30
|
|
|
use debug, only: &
|
2012-07-05 15:24:50 +05:30
|
|
|
debug_level, &
|
2012-03-20 23:31:31 +05:30
|
|
|
debug_FEsolving, &
|
|
|
|
debug_levelBasic
|
|
|
|
use IO, only: &
|
|
|
|
IO_stringPos, &
|
|
|
|
IO_stringValue, &
|
|
|
|
IO_intValue, &
|
|
|
|
IO_lc, &
|
2014-10-13 14:14:49 +05:30
|
|
|
#if defined(Marc4DAMASK) || defined(Abaqus)
|
2012-06-15 21:40:21 +05:30
|
|
|
IO_open_inputFile, &
|
2012-03-20 23:31:31 +05:30
|
|
|
IO_open_logFile, &
|
2012-06-15 21:40:21 +05:30
|
|
|
#endif
|
2019-03-12 04:37:44 +05:30
|
|
|
IO_warning
|
2011-11-04 01:02:11 +05:30
|
|
|
use DAMASK_interface
|
2009-01-20 00:40:58 +05:30
|
|
|
|
2012-03-09 01:55:28 +05:30
|
|
|
implicit none
|
2014-10-13 14:14:49 +05:30
|
|
|
#if defined(Marc4DAMASK) || defined(Abaqus)
|
2012-03-20 23:31:31 +05:30
|
|
|
integer(pInt), parameter :: &
|
2015-08-28 13:08:48 +05:30
|
|
|
FILEUNIT = 222_pInt
|
2012-02-14 17:47:47 +05:30
|
|
|
integer(pInt) :: j
|
2015-08-28 13:08:48 +05:30
|
|
|
character(len=65536) :: tag, line
|
|
|
|
integer(pInt), allocatable, dimension(:) :: chunkPos
|
2012-06-15 21:40:21 +05:30
|
|
|
#endif
|
2013-02-11 15:14:17 +05:30
|
|
|
|
2016-06-29 20:29:22 +05:30
|
|
|
write(6,'(/,a)') ' <<<+- FEsolving init -+>>>'
|
2012-03-09 01:55:28 +05:30
|
|
|
|
2012-06-15 21:40:21 +05:30
|
|
|
modelName = getSolverJobName()
|
2018-02-17 03:11:07 +05:30
|
|
|
|
2019-03-23 13:57:58 +05:30
|
|
|
#if defined(Grid) || defined(FEM)
|
2018-08-20 19:29:13 +05:30
|
|
|
restartInc = interface_RestartInc
|
2018-02-17 03:11:07 +05:30
|
|
|
|
|
|
|
if(restartInc < 0_pInt) then
|
2014-06-06 06:08:29 +05:30
|
|
|
call IO_warning(warning_ID=34_pInt)
|
2018-02-17 03:11:07 +05:30
|
|
|
restartInc = 0_pInt
|
2014-06-06 06:08:29 +05:30
|
|
|
endif
|
2018-02-17 03:11:07 +05:30
|
|
|
restartRead = restartInc > 0_pInt ! only read in if "true" restart requested
|
2012-06-15 21:40:21 +05:30
|
|
|
#else
|
2013-12-11 22:19:20 +05:30
|
|
|
call IO_open_inputFile(FILEUNIT,modelName)
|
|
|
|
rewind(FILEUNIT)
|
2012-06-15 21:40:21 +05:30
|
|
|
do
|
2013-12-11 22:19:20 +05:30
|
|
|
read (FILEUNIT,'(a1024)',END=100) line
|
2015-08-28 13:08:48 +05:30
|
|
|
chunkPos = IO_stringPos(line)
|
|
|
|
tag = IO_lc(IO_stringValue(line,chunkPos,1_pInt)) ! extract key
|
2012-06-15 21:40:21 +05:30
|
|
|
select case(tag)
|
|
|
|
case ('solver')
|
2013-12-11 22:19:20 +05:30
|
|
|
read (FILEUNIT,'(a1024)',END=100) line ! next line
|
2015-08-28 13:08:48 +05:30
|
|
|
chunkPos = IO_stringPos(line)
|
|
|
|
symmetricSolver = (IO_intValue(line,chunkPos,2_pInt) /= 1_pInt)
|
2012-06-15 21:40:21 +05:30
|
|
|
case ('restart')
|
2013-12-11 22:19:20 +05:30
|
|
|
read (FILEUNIT,'(a1024)',END=100) line ! next line
|
2015-08-28 13:08:48 +05:30
|
|
|
chunkPos = IO_stringPos(line)
|
|
|
|
restartWrite = iand(IO_intValue(line,chunkPos,1_pInt),1_pInt) > 0_pInt
|
|
|
|
restartRead = iand(IO_intValue(line,chunkPos,1_pInt),2_pInt) > 0_pInt
|
2012-06-15 21:40:21 +05:30
|
|
|
case ('*restart')
|
2015-08-28 13:08:48 +05:30
|
|
|
do j=2_pInt,chunkPos(1)
|
|
|
|
restartWrite = (IO_lc(IO_StringValue(line,chunkPos,j)) == 'write') .or. restartWrite
|
|
|
|
restartRead = (IO_lc(IO_StringValue(line,chunkPos,j)) == 'read') .or. restartRead
|
2012-06-15 21:40:21 +05:30
|
|
|
enddo
|
|
|
|
if(restartWrite) then
|
2015-08-28 13:08:48 +05:30
|
|
|
do j=2_pInt,chunkPos(1)
|
|
|
|
restartWrite = (IO_lc(IO_StringValue(line,chunkPos,j)) /= 'frequency=0') .and. restartWrite
|
2012-02-13 23:11:27 +05:30
|
|
|
enddo
|
2012-06-15 21:40:21 +05:30
|
|
|
endif
|
|
|
|
end select
|
|
|
|
enddo
|
2013-12-11 22:19:20 +05:30
|
|
|
100 close(FILEUNIT)
|
2012-06-15 21:40:21 +05:30
|
|
|
|
2011-05-28 15:14:43 +05:30
|
|
|
if (restartRead) then
|
2013-04-30 15:19:30 +05:30
|
|
|
#ifdef Marc4DAMASK
|
2013-12-11 22:19:20 +05:30
|
|
|
call IO_open_logFile(FILEUNIT)
|
|
|
|
rewind(FILEUNIT)
|
2012-06-15 21:40:21 +05:30
|
|
|
do
|
2013-12-11 22:19:20 +05:30
|
|
|
read (FILEUNIT,'(a1024)',END=200) line
|
2015-08-28 13:08:48 +05:30
|
|
|
chunkPos = IO_stringPos(line)
|
2018-02-17 03:11:07 +05:30
|
|
|
if ( IO_lc(IO_stringValue(line,chunkPos,1_pInt)) == 'restart' &
|
|
|
|
.and. IO_lc(IO_stringValue(line,chunkPos,2_pInt)) == 'file' &
|
|
|
|
.and. IO_lc(IO_stringValue(line,chunkPos,3_pInt)) == 'job' &
|
|
|
|
.and. IO_lc(IO_stringValue(line,chunkPos,4_pInt)) == 'id' ) &
|
2015-08-28 13:08:48 +05:30
|
|
|
modelName = IO_StringValue(line,chunkPos,6_pInt)
|
2012-06-15 21:40:21 +05:30
|
|
|
enddo
|
2018-02-17 03:11:07 +05:30
|
|
|
#else ! QUESTION: is this meaningful for the spectral/FEM case?
|
2013-12-11 22:19:20 +05:30
|
|
|
call IO_open_inputFile(FILEUNIT,modelName)
|
|
|
|
rewind(FILEUNIT)
|
2012-06-15 21:40:21 +05:30
|
|
|
do
|
2013-12-11 22:19:20 +05:30
|
|
|
read (FILEUNIT,'(a1024)',END=200) line
|
2015-08-28 13:08:48 +05:30
|
|
|
chunkPos = IO_stringPos(line)
|
2018-02-17 03:11:07 +05:30
|
|
|
if (IO_lc(IO_stringValue(line,chunkPos,1_pInt))=='*heading') then
|
2013-12-11 22:19:20 +05:30
|
|
|
read (FILEUNIT,'(a1024)',END=200) line
|
2015-08-28 13:08:48 +05:30
|
|
|
chunkPos = IO_stringPos(line)
|
|
|
|
modelName = IO_StringValue(line,chunkPos,1_pInt)
|
2012-06-15 21:40:21 +05:30
|
|
|
endif
|
|
|
|
enddo
|
|
|
|
#endif
|
2013-12-11 22:19:20 +05:30
|
|
|
200 close(FILEUNIT)
|
2010-11-03 20:09:18 +05:30
|
|
|
endif
|
2013-02-11 15:14:17 +05:30
|
|
|
|
2012-06-15 21:40:21 +05:30
|
|
|
#endif
|
2012-07-05 15:24:50 +05:30
|
|
|
if (iand(debug_level(debug_FEsolving),debug_levelBasic) /= 0_pInt) then
|
2016-01-25 02:35:36 +05:30
|
|
|
write(6,'(a21,l1)') ' restart writing: ', restartWrite
|
|
|
|
write(6,'(a21,l1)') ' restart reading: ', restartRead
|
|
|
|
if (restartRead) write(6,'(a,/)') ' restart Job: '//trim(modelName)
|
2011-03-21 16:01:17 +05:30
|
|
|
endif
|
2009-01-20 00:40:58 +05:30
|
|
|
|
2012-03-09 01:55:28 +05:30
|
|
|
end subroutine FE_init
|
2008-03-15 03:02:57 +05:30
|
|
|
|
2012-03-09 01:55:28 +05:30
|
|
|
end module FEsolving
|