further cleaning
This commit is contained in:
parent
ceecea418e
commit
9379d1884e
259
src/CPFEM2.f90
259
src/CPFEM2.f90
|
@ -22,6 +22,9 @@ module CPFEM2
|
||||||
use homogenization
|
use homogenization
|
||||||
use constitutive
|
use constitutive
|
||||||
use crystallite
|
use crystallite
|
||||||
|
#ifdef FEM
|
||||||
|
use FEM_Zoo
|
||||||
|
#endif
|
||||||
|
|
||||||
implicit none
|
implicit none
|
||||||
private
|
private
|
||||||
|
@ -37,33 +40,29 @@ contains
|
||||||
!--------------------------------------------------------------------------------------------------
|
!--------------------------------------------------------------------------------------------------
|
||||||
!> @brief call (thread safe) all module initializations
|
!> @brief call (thread safe) all module initializations
|
||||||
!--------------------------------------------------------------------------------------------------
|
!--------------------------------------------------------------------------------------------------
|
||||||
subroutine CPFEM_initAll()
|
subroutine CPFEM_initAll
|
||||||
#ifdef FEM
|
|
||||||
use FEM_Zoo, only: &
|
|
||||||
FEM_Zoo_init
|
|
||||||
#endif
|
|
||||||
|
|
||||||
call DAMASK_interface_init ! Spectral and FEM interface to commandline
|
call DAMASK_interface_init ! Spectral and FEM interface to commandline
|
||||||
call prec_init
|
call prec_init
|
||||||
call IO_init
|
call IO_init
|
||||||
#ifdef FEM
|
#ifdef FEM
|
||||||
call FEM_Zoo_init
|
call FEM_Zoo_init
|
||||||
#endif
|
#endif
|
||||||
call numerics_init
|
call numerics_init
|
||||||
call debug_init
|
call debug_init
|
||||||
call config_init
|
call config_init
|
||||||
call math_init
|
call math_init
|
||||||
call FE_init
|
call FE_init
|
||||||
call mesh_init
|
call mesh_init
|
||||||
call lattice_init
|
call lattice_init
|
||||||
call HDF5_utilities_init
|
call HDF5_utilities_init
|
||||||
call results_init
|
call results_init
|
||||||
call material_init
|
call material_init
|
||||||
call constitutive_init
|
call constitutive_init
|
||||||
call crystallite_init
|
call crystallite_init
|
||||||
call homogenization_init
|
call homogenization_init
|
||||||
call materialpoint_postResults
|
call materialpoint_postResults
|
||||||
call CPFEM_init
|
call CPFEM_init
|
||||||
|
|
||||||
end subroutine CPFEM_initAll
|
end subroutine CPFEM_initAll
|
||||||
|
|
||||||
|
@ -72,50 +71,50 @@ end subroutine CPFEM_initAll
|
||||||
!--------------------------------------------------------------------------------------------------
|
!--------------------------------------------------------------------------------------------------
|
||||||
subroutine CPFEM_init
|
subroutine CPFEM_init
|
||||||
|
|
||||||
integer :: ph,homog
|
integer :: ph,homog
|
||||||
character(len=1024) :: rankStr, PlasticItem, HomogItem
|
character(len=1024) :: rankStr, PlasticItem, HomogItem
|
||||||
integer(HID_T) :: fileHandle, groupPlasticID, groupHomogID
|
integer(HID_T) :: fileHandle, groupPlasticID, groupHomogID
|
||||||
|
|
||||||
write(6,'(/,a)') ' <<<+- CPFEM init -+>>>'
|
write(6,'(/,a)') ' <<<+- CPFEM init -+>>>'
|
||||||
flush(6)
|
flush(6)
|
||||||
|
|
||||||
! *** restore the last converged values of each essential variable from the binary file
|
! *** restore the last converged values of each essential variable from the binary file
|
||||||
if (restartRead) then
|
if (restartRead) then
|
||||||
if (iand(debug_level(debug_CPFEM), debug_levelExtensive) /= 0) then
|
if (iand(debug_level(debug_CPFEM), debug_levelExtensive) /= 0) then
|
||||||
write(6,'(a)') '<< CPFEM >> restored state variables of last converged step from hdf5 file'
|
write(6,'(a)') '<< CPFEM >> restored state variables of last converged step from hdf5 file'
|
||||||
flush(6)
|
flush(6)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
write(rankStr,'(a1,i0)')'_',worldrank
|
write(rankStr,'(a1,i0)')'_',worldrank
|
||||||
|
|
||||||
fileHandle = HDF5_openFile(trim(getSolverJobName())//trim(rankStr)//'.hdf5')
|
fileHandle = HDF5_openFile(trim(getSolverJobName())//trim(rankStr)//'.hdf5')
|
||||||
|
|
||||||
call HDF5_read(fileHandle,material_phase, 'recordedPhase')
|
|
||||||
call HDF5_read(fileHandle,crystallite_F0, 'convergedF')
|
|
||||||
call HDF5_read(fileHandle,crystallite_Fp0, 'convergedFp')
|
|
||||||
call HDF5_read(fileHandle,crystallite_Fi0, 'convergedFi')
|
|
||||||
call HDF5_read(fileHandle,crystallite_Lp0, 'convergedLp')
|
|
||||||
call HDF5_read(fileHandle,crystallite_Li0, 'convergedLi')
|
|
||||||
call HDF5_read(fileHandle,crystallite_S0, 'convergedS')
|
|
||||||
|
|
||||||
groupPlasticID = HDF5_openGroup(fileHandle,'PlasticPhases')
|
call HDF5_read(fileHandle,material_phase, 'recordedPhase')
|
||||||
do ph = 1,size(phase_plasticity)
|
call HDF5_read(fileHandle,crystallite_F0, 'convergedF')
|
||||||
write(PlasticItem,*) ph,'_'
|
call HDF5_read(fileHandle,crystallite_Fp0, 'convergedFp')
|
||||||
call HDF5_read(groupPlasticID,plasticState(ph)%state0,trim(PlasticItem)//'convergedStateConst')
|
call HDF5_read(fileHandle,crystallite_Fi0, 'convergedFi')
|
||||||
enddo
|
call HDF5_read(fileHandle,crystallite_Lp0, 'convergedLp')
|
||||||
call HDF5_closeGroup(groupPlasticID)
|
call HDF5_read(fileHandle,crystallite_Li0, 'convergedLi')
|
||||||
|
call HDF5_read(fileHandle,crystallite_S0, 'convergedS')
|
||||||
groupHomogID = HDF5_openGroup(fileHandle,'HomogStates')
|
|
||||||
do homog = 1, material_Nhomogenization
|
groupPlasticID = HDF5_openGroup(fileHandle,'PlasticPhases')
|
||||||
write(HomogItem,*) homog,'_'
|
do ph = 1,size(phase_plasticity)
|
||||||
call HDF5_read(groupHomogID,homogState(homog)%state0, trim(HomogItem)//'convergedStateHomog')
|
write(PlasticItem,*) ph,'_'
|
||||||
enddo
|
call HDF5_read(groupPlasticID,plasticState(ph)%state0,trim(PlasticItem)//'convergedStateConst')
|
||||||
call HDF5_closeGroup(groupHomogID)
|
enddo
|
||||||
|
call HDF5_closeGroup(groupPlasticID)
|
||||||
|
|
||||||
|
groupHomogID = HDF5_openGroup(fileHandle,'HomogStates')
|
||||||
|
do homog = 1, material_Nhomogenization
|
||||||
|
write(HomogItem,*) homog,'_'
|
||||||
|
call HDF5_read(groupHomogID,homogState(homog)%state0, trim(HomogItem)//'convergedStateHomog')
|
||||||
|
enddo
|
||||||
|
call HDF5_closeGroup(groupHomogID)
|
||||||
|
|
||||||
call HDF5_closeFile(fileHandle)
|
call HDF5_closeFile(fileHandle)
|
||||||
|
|
||||||
restartRead = .false.
|
restartRead = .false.
|
||||||
endif
|
endif
|
||||||
|
|
||||||
end subroutine CPFEM_init
|
end subroutine CPFEM_init
|
||||||
|
|
||||||
|
@ -125,68 +124,68 @@ end subroutine CPFEM_init
|
||||||
!--------------------------------------------------------------------------------------------------
|
!--------------------------------------------------------------------------------------------------
|
||||||
subroutine CPFEM_age
|
subroutine CPFEM_age
|
||||||
|
|
||||||
integer :: i, ph, homog, mySource
|
integer :: i, ph, homog, mySource
|
||||||
character(len=32) :: rankStr, PlasticItem, HomogItem
|
character(len=32) :: rankStr, PlasticItem, HomogItem
|
||||||
integer(HID_T) :: fileHandle, groupPlastic, groupHomog
|
integer(HID_T) :: fileHandle, groupPlastic, groupHomog
|
||||||
|
|
||||||
if (iand(debug_level(debug_CPFEM), debug_levelBasic) /= 0) &
|
if (iand(debug_level(debug_CPFEM), debug_levelBasic) /= 0) &
|
||||||
write(6,'(a)') '<< CPFEM >> aging states'
|
write(6,'(a)') '<< CPFEM >> aging states'
|
||||||
|
|
||||||
crystallite_F0 = crystallite_partionedF
|
crystallite_F0 = crystallite_partionedF
|
||||||
crystallite_Fp0 = crystallite_Fp
|
crystallite_Fp0 = crystallite_Fp
|
||||||
crystallite_Lp0 = crystallite_Lp
|
crystallite_Lp0 = crystallite_Lp
|
||||||
crystallite_Fi0 = crystallite_Fi
|
crystallite_Fi0 = crystallite_Fi
|
||||||
crystallite_Li0 = crystallite_Li
|
crystallite_Li0 = crystallite_Li
|
||||||
crystallite_S0 = crystallite_S
|
crystallite_S0 = crystallite_S
|
||||||
|
|
||||||
do i = 1, size(plasticState)
|
do i = 1, size(plasticState)
|
||||||
plasticState(i)%state0 = plasticState(i)%state
|
plasticState(i)%state0 = plasticState(i)%state
|
||||||
enddo
|
enddo
|
||||||
do i = 1, size(sourceState)
|
do i = 1, size(sourceState)
|
||||||
do mySource = 1,phase_Nsources(i)
|
do mySource = 1,phase_Nsources(i)
|
||||||
sourceState(i)%p(mySource)%state0 = sourceState(i)%p(mySource)%state
|
sourceState(i)%p(mySource)%state0 = sourceState(i)%p(mySource)%state
|
||||||
enddo; enddo
|
enddo; enddo
|
||||||
do homog = 1, material_Nhomogenization
|
do homog = 1, material_Nhomogenization
|
||||||
homogState (homog)%state0 = homogState (homog)%state
|
homogState (homog)%state0 = homogState (homog)%state
|
||||||
thermalState (homog)%state0 = thermalState (homog)%state
|
thermalState (homog)%state0 = thermalState (homog)%state
|
||||||
damageState (homog)%state0 = damageState (homog)%state
|
damageState (homog)%state0 = damageState (homog)%state
|
||||||
enddo
|
enddo
|
||||||
|
|
||||||
if (restartWrite) then
|
if (restartWrite) then
|
||||||
if (iand(debug_level(debug_CPFEM), debug_levelBasic) /= 0) &
|
if (iand(debug_level(debug_CPFEM), debug_levelBasic) /= 0) &
|
||||||
write(6,'(a)') '<< CPFEM >> writing restart variables of last converged step to hdf5 file'
|
write(6,'(a)') '<< CPFEM >> writing restart variables of last converged step to hdf5 file'
|
||||||
|
|
||||||
write(rankStr,'(a1,i0)')'_',worldrank
|
write(rankStr,'(a1,i0)')'_',worldrank
|
||||||
fileHandle = HDF5_openFile(trim(getSolverJobName())//trim(rankStr)//'.hdf5','a')
|
fileHandle = HDF5_openFile(trim(getSolverJobName())//trim(rankStr)//'.hdf5','a')
|
||||||
|
|
||||||
call HDF5_write(fileHandle,material_phase, 'recordedPhase')
|
call HDF5_write(fileHandle,material_phase, 'recordedPhase')
|
||||||
call HDF5_write(fileHandle,crystallite_F0, 'convergedF')
|
call HDF5_write(fileHandle,crystallite_F0, 'convergedF')
|
||||||
call HDF5_write(fileHandle,crystallite_Fp0, 'convergedFp')
|
call HDF5_write(fileHandle,crystallite_Fp0, 'convergedFp')
|
||||||
call HDF5_write(fileHandle,crystallite_Fi0, 'convergedFi')
|
call HDF5_write(fileHandle,crystallite_Fi0, 'convergedFi')
|
||||||
call HDF5_write(fileHandle,crystallite_Lp0, 'convergedLp')
|
call HDF5_write(fileHandle,crystallite_Lp0, 'convergedLp')
|
||||||
call HDF5_write(fileHandle,crystallite_Li0, 'convergedLi')
|
call HDF5_write(fileHandle,crystallite_Li0, 'convergedLi')
|
||||||
call HDF5_write(fileHandle,crystallite_S0, 'convergedS')
|
call HDF5_write(fileHandle,crystallite_S0, 'convergedS')
|
||||||
|
|
||||||
groupPlastic = HDF5_addGroup(fileHandle,'PlasticPhases')
|
groupPlastic = HDF5_addGroup(fileHandle,'PlasticPhases')
|
||||||
do ph = 1,size(phase_plasticity)
|
do ph = 1,size(phase_plasticity)
|
||||||
write(PlasticItem,*) ph,'_'
|
write(PlasticItem,*) ph,'_'
|
||||||
call HDF5_write(groupPlastic,plasticState(ph)%state0,trim(PlasticItem)//'convergedStateConst')
|
call HDF5_write(groupPlastic,plasticState(ph)%state0,trim(PlasticItem)//'convergedStateConst')
|
||||||
enddo
|
enddo
|
||||||
call HDF5_closeGroup(groupPlastic)
|
call HDF5_closeGroup(groupPlastic)
|
||||||
|
|
||||||
groupHomog = HDF5_addGroup(fileHandle,'HomogStates')
|
groupHomog = HDF5_addGroup(fileHandle,'HomogStates')
|
||||||
do homog = 1, material_Nhomogenization
|
do homog = 1, material_Nhomogenization
|
||||||
write(HomogItem,*) homog,'_'
|
write(HomogItem,*) homog,'_'
|
||||||
call HDF5_write(groupHomog,homogState(homog)%state0,trim(HomogItem)//'convergedStateHomog')
|
call HDF5_write(groupHomog,homogState(homog)%state0,trim(HomogItem)//'convergedStateHomog')
|
||||||
enddo
|
enddo
|
||||||
call HDF5_closeGroup(groupHomog)
|
call HDF5_closeGroup(groupHomog)
|
||||||
|
|
||||||
call HDF5_closeFile(fileHandle)
|
call HDF5_closeFile(fileHandle)
|
||||||
restartWrite = .false.
|
restartWrite = .false.
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if (iand(debug_level(debug_CPFEM), debug_levelBasic) /= 0) &
|
if (iand(debug_level(debug_CPFEM), debug_levelBasic) /= 0) &
|
||||||
write(6,'(a)') '<< CPFEM >> done aging states'
|
write(6,'(a)') '<< CPFEM >> done aging states'
|
||||||
|
|
||||||
end subroutine CPFEM_age
|
end subroutine CPFEM_age
|
||||||
|
|
||||||
|
@ -196,17 +195,17 @@ end subroutine CPFEM_age
|
||||||
!--------------------------------------------------------------------------------------------------
|
!--------------------------------------------------------------------------------------------------
|
||||||
subroutine CPFEM_results(inc,time)
|
subroutine CPFEM_results(inc,time)
|
||||||
|
|
||||||
integer, intent(in) :: inc
|
integer, intent(in) :: inc
|
||||||
real(pReal), intent(in) :: time
|
real(pReal), intent(in) :: time
|
||||||
|
|
||||||
call results_openJobFile
|
call results_openJobFile
|
||||||
call results_addIncrement(inc,time)
|
call results_addIncrement(inc,time)
|
||||||
call constitutive_results
|
call constitutive_results
|
||||||
call crystallite_results
|
call crystallite_results
|
||||||
call homogenization_results
|
call homogenization_results
|
||||||
call discretization_results
|
call discretization_results
|
||||||
call results_removeLink('current') ! ToDo: put this into closeJobFile
|
call results_removeLink('current') ! ToDo: put this into closeJobFile
|
||||||
call results_closeJobFile
|
call results_closeJobFile
|
||||||
|
|
||||||
end subroutine CPFEM_results
|
end subroutine CPFEM_results
|
||||||
|
|
||||||
|
|
|
@ -5,32 +5,35 @@
|
||||||
!> @todo Descriptions for public variables needed
|
!> @todo Descriptions for public variables needed
|
||||||
!--------------------------------------------------------------------------------------------------
|
!--------------------------------------------------------------------------------------------------
|
||||||
module FEsolving
|
module FEsolving
|
||||||
use prec
|
use prec
|
||||||
|
use debug
|
||||||
implicit none
|
use IO
|
||||||
private
|
use DAMASK_interface
|
||||||
integer, public :: &
|
|
||||||
restartInc = 1 !< needs description
|
|
||||||
|
|
||||||
logical, public :: &
|
|
||||||
symmetricSolver = .false., & !< use a symmetric FEM solver
|
|
||||||
restartWrite = .false., & !< write current state to enable restart
|
|
||||||
restartRead = .false., & !< restart information to continue calculation from saved state
|
|
||||||
terminallyIll = .false. !< at least one material point is terminally ill
|
|
||||||
|
|
||||||
integer, dimension(:,:), allocatable, public :: &
|
|
||||||
FEsolving_execIP !< for ping-pong scheme always range to max IP, otherwise one specific IP
|
|
||||||
|
|
||||||
integer, dimension(2), public :: &
|
implicit none
|
||||||
FEsolving_execElem !< for ping-pong scheme always whole range, otherwise one specific element
|
private
|
||||||
|
integer, public :: &
|
||||||
character(len=1024), public :: &
|
restartInc = 1 !< needs description
|
||||||
modelName !< needs description
|
|
||||||
|
|
||||||
logical, dimension(:,:), allocatable, public :: &
|
|
||||||
calcMode !< do calculation or simply collect when using ping pong scheme
|
|
||||||
|
|
||||||
public :: FE_init
|
logical, public :: &
|
||||||
|
symmetricSolver = .false., & !< use a symmetric FEM solver
|
||||||
|
restartWrite = .false., & !< write current state to enable restart
|
||||||
|
restartRead = .false., & !< restart information to continue calculation from saved state
|
||||||
|
terminallyIll = .false. !< at least one material point is terminally ill
|
||||||
|
|
||||||
|
integer, dimension(:,:), allocatable, public :: &
|
||||||
|
FEsolving_execIP !< for ping-pong scheme always range to max IP, otherwise one specific IP
|
||||||
|
|
||||||
|
integer, dimension(2), public :: &
|
||||||
|
FEsolving_execElem !< for ping-pong scheme always whole range, otherwise one specific element
|
||||||
|
|
||||||
|
character(len=1024), public :: &
|
||||||
|
modelName !< needs description
|
||||||
|
|
||||||
|
logical, dimension(:,:), allocatable, public :: &
|
||||||
|
calcMode !< do calculation or simply collect when using ping pong scheme
|
||||||
|
|
||||||
|
public :: FE_init
|
||||||
|
|
||||||
contains
|
contains
|
||||||
|
|
||||||
|
@ -41,108 +44,93 @@ contains
|
||||||
!> solver the information is provided by the interface module
|
!> solver the information is provided by the interface module
|
||||||
!--------------------------------------------------------------------------------------------------
|
!--------------------------------------------------------------------------------------------------
|
||||||
subroutine FE_init
|
subroutine FE_init
|
||||||
use debug, only: &
|
|
||||||
debug_level, &
|
|
||||||
debug_FEsolving, &
|
|
||||||
debug_levelBasic
|
|
||||||
use IO, only: &
|
|
||||||
IO_stringPos, &
|
|
||||||
IO_stringValue, &
|
|
||||||
IO_intValue, &
|
|
||||||
IO_lc, &
|
|
||||||
#if defined(Marc4DAMASK) || defined(Abaqus)
|
|
||||||
IO_open_inputFile, &
|
|
||||||
IO_open_logFile, &
|
|
||||||
#endif
|
|
||||||
IO_warning
|
|
||||||
use DAMASK_interface
|
|
||||||
|
|
||||||
#if defined(Marc4DAMASK) || defined(Abaqus)
|
#if defined(Marc4DAMASK) || defined(Abaqus)
|
||||||
integer, parameter :: &
|
integer, parameter :: &
|
||||||
FILEUNIT = 222
|
FILEUNIT = 222
|
||||||
integer :: j
|
integer :: j
|
||||||
character(len=65536) :: tag, line
|
character(len=65536) :: tag, line
|
||||||
integer, allocatable, dimension(:) :: chunkPos
|
integer, allocatable, dimension(:) :: chunkPos
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
write(6,'(/,a)') ' <<<+- FEsolving init -+>>>'
|
write(6,'(/,a)') ' <<<+- FEsolving init -+>>>'
|
||||||
|
|
||||||
modelName = getSolverJobName()
|
modelName = getSolverJobName()
|
||||||
|
|
||||||
#if defined(Grid) || defined(FEM)
|
#if defined(Grid) || defined(FEM)
|
||||||
restartInc = interface_RestartInc
|
restartInc = interface_RestartInc
|
||||||
|
|
||||||
if(restartInc < 0) then
|
if(restartInc < 0) then
|
||||||
call IO_warning(warning_ID=34)
|
call IO_warning(warning_ID=34)
|
||||||
restartInc = 0
|
restartInc = 0
|
||||||
endif
|
endif
|
||||||
restartRead = restartInc > 0 ! only read in if "true" restart requested
|
restartRead = restartInc > 0 ! only read in if "true" restart requested
|
||||||
#else
|
#else
|
||||||
call IO_open_inputFile(FILEUNIT,modelName)
|
call IO_open_inputFile(FILEUNIT,modelName)
|
||||||
rewind(FILEUNIT)
|
rewind(FILEUNIT)
|
||||||
do
|
do
|
||||||
read (FILEUNIT,'(a1024)',END=100) line
|
read (FILEUNIT,'(a1024)',END=100) line
|
||||||
chunkPos = IO_stringPos(line)
|
chunkPos = IO_stringPos(line)
|
||||||
tag = IO_lc(IO_stringValue(line,chunkPos,1)) ! extract key
|
tag = IO_lc(IO_stringValue(line,chunkPos,1)) ! extract key
|
||||||
select case(tag)
|
select case(tag)
|
||||||
case ('solver')
|
case ('solver')
|
||||||
read (FILEUNIT,'(a1024)',END=100) line ! next line
|
read (FILEUNIT,'(a1024)',END=100) line ! next line
|
||||||
chunkPos = IO_stringPos(line)
|
chunkPos = IO_stringPos(line)
|
||||||
symmetricSolver = (IO_intValue(line,chunkPos,2) /= 1)
|
symmetricSolver = (IO_intValue(line,chunkPos,2) /= 1)
|
||||||
case ('restart')
|
case ('restart')
|
||||||
read (FILEUNIT,'(a1024)',END=100) line ! next line
|
read (FILEUNIT,'(a1024)',END=100) line ! next line
|
||||||
chunkPos = IO_stringPos(line)
|
chunkPos = IO_stringPos(line)
|
||||||
restartWrite = iand(IO_intValue(line,chunkPos,1),1) > 0
|
restartWrite = iand(IO_intValue(line,chunkPos,1),1) > 0
|
||||||
restartRead = iand(IO_intValue(line,chunkPos,1),2) > 0
|
restartRead = iand(IO_intValue(line,chunkPos,1),2) > 0
|
||||||
case ('*restart')
|
case ('*restart')
|
||||||
do j=2,chunkPos(1)
|
do j=2,chunkPos(1)
|
||||||
restartWrite = (IO_lc(IO_StringValue(line,chunkPos,j)) == 'write') .or. restartWrite
|
restartWrite = (IO_lc(IO_StringValue(line,chunkPos,j)) == 'write') .or. restartWrite
|
||||||
restartRead = (IO_lc(IO_StringValue(line,chunkPos,j)) == 'read') .or. restartRead
|
restartRead = (IO_lc(IO_StringValue(line,chunkPos,j)) == 'read') .or. restartRead
|
||||||
enddo
|
enddo
|
||||||
if(restartWrite) then
|
if(restartWrite) then
|
||||||
do j=2,chunkPos(1)
|
do j=2,chunkPos(1)
|
||||||
restartWrite = (IO_lc(IO_StringValue(line,chunkPos,j)) /= 'frequency=0') .and. restartWrite
|
restartWrite = (IO_lc(IO_StringValue(line,chunkPos,j)) /= 'frequency=0') .and. restartWrite
|
||||||
enddo
|
enddo
|
||||||
endif
|
endif
|
||||||
end select
|
end select
|
||||||
enddo
|
enddo
|
||||||
100 close(FILEUNIT)
|
100 close(FILEUNIT)
|
||||||
|
|
||||||
if (restartRead) then
|
if (restartRead) then
|
||||||
#ifdef Marc4DAMASK
|
#ifdef Marc4DAMASK
|
||||||
call IO_open_logFile(FILEUNIT)
|
call IO_open_logFile(FILEUNIT)
|
||||||
rewind(FILEUNIT)
|
rewind(FILEUNIT)
|
||||||
do
|
do
|
||||||
read (FILEUNIT,'(a1024)',END=200) line
|
read (FILEUNIT,'(a1024)',END=200) line
|
||||||
chunkPos = IO_stringPos(line)
|
chunkPos = IO_stringPos(line)
|
||||||
if ( IO_lc(IO_stringValue(line,chunkPos,1)) == 'restart' &
|
if ( IO_lc(IO_stringValue(line,chunkPos,1)) == 'restart' &
|
||||||
.and. IO_lc(IO_stringValue(line,chunkPos,2)) == 'file' &
|
.and. IO_lc(IO_stringValue(line,chunkPos,2)) == 'file' &
|
||||||
.and. IO_lc(IO_stringValue(line,chunkPos,3)) == 'job' &
|
.and. IO_lc(IO_stringValue(line,chunkPos,3)) == 'job' &
|
||||||
.and. IO_lc(IO_stringValue(line,chunkPos,4)) == 'id' ) &
|
.and. IO_lc(IO_stringValue(line,chunkPos,4)) == 'id' ) &
|
||||||
modelName = IO_StringValue(line,chunkPos,6)
|
modelName = IO_StringValue(line,chunkPos,6)
|
||||||
enddo
|
enddo
|
||||||
#else ! QUESTION: is this meaningful for the spectral/FEM case?
|
#else
|
||||||
call IO_open_inputFile(FILEUNIT,modelName)
|
call IO_open_inputFile(FILEUNIT,modelName)
|
||||||
rewind(FILEUNIT)
|
rewind(FILEUNIT)
|
||||||
do
|
do
|
||||||
read (FILEUNIT,'(a1024)',END=200) line
|
read (FILEUNIT,'(a1024)',END=200) line
|
||||||
chunkPos = IO_stringPos(line)
|
chunkPos = IO_stringPos(line)
|
||||||
if (IO_lc(IO_stringValue(line,chunkPos,1))=='*heading') then
|
if (IO_lc(IO_stringValue(line,chunkPos,1))=='*heading') then
|
||||||
read (FILEUNIT,'(a1024)',END=200) line
|
read (FILEUNIT,'(a1024)',END=200) line
|
||||||
chunkPos = IO_stringPos(line)
|
chunkPos = IO_stringPos(line)
|
||||||
modelName = IO_StringValue(line,chunkPos,1)
|
modelName = IO_StringValue(line,chunkPos,1)
|
||||||
endif
|
endif
|
||||||
enddo
|
enddo
|
||||||
#endif
|
#endif
|
||||||
200 close(FILEUNIT)
|
200 close(FILEUNIT)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
if (iand(debug_level(debug_FEsolving),debug_levelBasic) /= 0) then
|
if (iand(debug_level(debug_FEsolving),debug_levelBasic) /= 0) then
|
||||||
write(6,'(a21,l1)') ' restart writing: ', restartWrite
|
write(6,'(a21,l1)') ' restart writing: ', restartWrite
|
||||||
write(6,'(a21,l1)') ' restart reading: ', restartRead
|
write(6,'(a21,l1)') ' restart reading: ', restartRead
|
||||||
if (restartRead) write(6,'(a,/)') ' restart Job: '//trim(modelName)
|
if (restartRead) write(6,'(a,/)') ' restart Job: '//trim(modelName)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
end subroutine FE_init
|
end subroutine FE_init
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
!--------------------------------------------------------------------------------------------------
|
!--------------------------------------------------------------------------------------------------
|
||||||
module element
|
module element
|
||||||
use prec
|
use prec
|
||||||
|
use IO
|
||||||
|
|
||||||
implicit none
|
implicit none
|
||||||
private
|
private
|
||||||
|
@ -805,8 +806,6 @@ module element
|
||||||
contains
|
contains
|
||||||
|
|
||||||
subroutine tElement_init(self,elemType)
|
subroutine tElement_init(self,elemType)
|
||||||
use IO, only: &
|
|
||||||
IO_error
|
|
||||||
|
|
||||||
class(tElement) :: self
|
class(tElement) :: self
|
||||||
integer, intent(in) :: elemType
|
integer, intent(in) :: elemType
|
||||||
|
|
|
@ -5,6 +5,13 @@
|
||||||
!--------------------------------------------------------------------------------------------------
|
!--------------------------------------------------------------------------------------------------
|
||||||
module numerics
|
module numerics
|
||||||
use prec
|
use prec
|
||||||
|
use IO
|
||||||
|
|
||||||
|
#ifdef PETSc
|
||||||
|
#include <petsc/finclude/petscsys.h>
|
||||||
|
use petscsys
|
||||||
|
#endif
|
||||||
|
!$ use OMP_LIB
|
||||||
|
|
||||||
implicit none
|
implicit none
|
||||||
private
|
private
|
||||||
|
@ -113,21 +120,6 @@ contains
|
||||||
! a sanity check
|
! a sanity check
|
||||||
!--------------------------------------------------------------------------------------------------
|
!--------------------------------------------------------------------------------------------------
|
||||||
subroutine numerics_init
|
subroutine numerics_init
|
||||||
use IO, only: &
|
|
||||||
IO_read_ASCII, &
|
|
||||||
IO_error, &
|
|
||||||
IO_isBlank, &
|
|
||||||
IO_stringPos, &
|
|
||||||
IO_stringValue, &
|
|
||||||
IO_lc, &
|
|
||||||
IO_floatValue, &
|
|
||||||
IO_intValue, &
|
|
||||||
IO_warning
|
|
||||||
#ifdef PETSc
|
|
||||||
#include <petsc/finclude/petscsys.h>
|
|
||||||
use petscsys
|
|
||||||
#endif
|
|
||||||
!$ use OMP_LIB, only: omp_set_num_threads
|
|
||||||
!$ integer :: gotDAMASK_NUM_THREADS = 1
|
!$ integer :: gotDAMASK_NUM_THREADS = 1
|
||||||
integer :: i,j, ierr
|
integer :: i,j, ierr
|
||||||
integer, allocatable, dimension(:) :: chunkPos
|
integer, allocatable, dimension(:) :: chunkPos
|
||||||
|
|
|
@ -3,48 +3,45 @@
|
||||||
!> @brief material subroutine for isothermal temperature field
|
!> @brief material subroutine for isothermal temperature field
|
||||||
!--------------------------------------------------------------------------------------------------
|
!--------------------------------------------------------------------------------------------------
|
||||||
module thermal_isothermal
|
module thermal_isothermal
|
||||||
|
use prec
|
||||||
|
use config
|
||||||
|
use material
|
||||||
|
|
||||||
implicit none
|
implicit none
|
||||||
private
|
private
|
||||||
|
|
||||||
public :: &
|
public :: &
|
||||||
thermal_isothermal_init
|
thermal_isothermal_init
|
||||||
|
|
||||||
contains
|
contains
|
||||||
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
!--------------------------------------------------------------------------------------------------
|
||||||
!> @brief allocates all neccessary fields, reads information from material configuration file
|
!> @brief allocates all neccessary fields, reads information from material configuration file
|
||||||
!--------------------------------------------------------------------------------------------------
|
!--------------------------------------------------------------------------------------------------
|
||||||
subroutine thermal_isothermal_init()
|
subroutine thermal_isothermal_init
|
||||||
use prec, only: &
|
|
||||||
pReal
|
|
||||||
use config, only: &
|
|
||||||
material_Nhomogenization
|
|
||||||
use material
|
|
||||||
|
|
||||||
integer :: &
|
integer :: &
|
||||||
homog, &
|
homog, &
|
||||||
NofMyHomog
|
NofMyHomog
|
||||||
|
|
||||||
write(6,'(/,a)') ' <<<+- thermal_'//THERMAL_isothermal_label//' init -+>>>'
|
write(6,'(/,a)') ' <<<+- thermal_'//THERMAL_isothermal_label//' init -+>>>'
|
||||||
|
|
||||||
initializeInstances: do homog = 1, material_Nhomogenization
|
initializeInstances: do homog = 1, material_Nhomogenization
|
||||||
|
|
||||||
if (thermal_type(homog) /= THERMAL_isothermal_ID) cycle
|
if (thermal_type(homog) /= THERMAL_isothermal_ID) cycle
|
||||||
NofMyHomog = count(material_homogenizationAt == homog)
|
NofMyHomog = count(material_homogenizationAt == homog)
|
||||||
thermalState(homog)%sizeState = 0
|
thermalState(homog)%sizeState = 0
|
||||||
thermalState(homog)%sizePostResults = 0
|
thermalState(homog)%sizePostResults = 0
|
||||||
allocate(thermalState(homog)%state0 (0,NofMyHomog), source=0.0_pReal)
|
allocate(thermalState(homog)%state0 (0,NofMyHomog), source=0.0_pReal)
|
||||||
allocate(thermalState(homog)%subState0(0,NofMyHomog), source=0.0_pReal)
|
allocate(thermalState(homog)%subState0(0,NofMyHomog), source=0.0_pReal)
|
||||||
allocate(thermalState(homog)%state (0,NofMyHomog), source=0.0_pReal)
|
allocate(thermalState(homog)%state (0,NofMyHomog), source=0.0_pReal)
|
||||||
|
|
||||||
deallocate(temperature (homog)%p)
|
deallocate(temperature (homog)%p)
|
||||||
allocate (temperature (homog)%p(1), source=thermal_initialT(homog))
|
allocate (temperature (homog)%p(1), source=thermal_initialT(homog))
|
||||||
deallocate(temperatureRate(homog)%p)
|
deallocate(temperatureRate(homog)%p)
|
||||||
allocate (temperatureRate(homog)%p(1), source=0.0_pReal)
|
allocate (temperatureRate(homog)%p(1), source=0.0_pReal)
|
||||||
|
|
||||||
enddo initializeInstances
|
|
||||||
|
|
||||||
|
enddo initializeInstances
|
||||||
|
|
||||||
end subroutine thermal_isothermal_init
|
end subroutine thermal_isothermal_init
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue