documented utilities and structured, worked on the restart capabilities of the new basic solver

This commit is contained in:
Martin Diehl 2012-10-24 11:31:40 +00:00
parent aefe8d7e32
commit 13b55275b1
7 changed files with 592 additions and 462 deletions

View File

@ -209,7 +209,7 @@ subroutine CPFEM_init
!$OMP CRITICAL (write2out)
write(6,*)
write(6,*) '<<<+- cpfem init -+>>>'
write(6,*) '<<<+- CPFEM init -+>>>'
write(6,*) '$Id$'
#include "compilation_info.f90"
if (iand(debug_level(debug_CPFEM), debug_levelBasic) /= 0) then

View File

@ -238,15 +238,9 @@ program DAMASK_spectral
complex(pReal), dimension(:,:,:), pointer :: scalarField_real
complex(pReal), dimension(:,:,:), pointer :: scalarField_fourier
integer(pInt) :: row, column
!##################################################################################################
! reading of information from load case file and geometry file
!##################################################################################################
#ifdef PETSC
integer :: ierr_psc
call PetscInitialize(PETSC_NULL_CHARACTER, ierr_psc)
#endif
!--------------------------------------------------------------------------------------------------
! initialization of all related DAMASK modules (e.g. mesh.f90 reads in geometry)
call CPFEM_initAll(temperature = 300.0_pReal, element = 1_pInt, IP= 1_pInt)
@ -393,13 +387,13 @@ program DAMASK_spectral
else
write(6,'(a)')'deformation gradient rate:'
endif
write (6,'(3(3(f12.7,1x)/))',advance='no') merge(math_transpose33(bc(loadcase)%deformation),&
write(6,'(3(3(f12.7,1x)/))',advance='no') merge(math_transpose33(bc(loadcase)%deformation),&
reshape(spread(DAMASK_NaN,1,9),[ 3,3]),transpose(bc(loadcase)%maskDeformation))
write (6,'(a,/,3(3(f12.7,1x)/))',advance='no') ' stress / GPa:',&
write(6,'(a,/,3(3(f12.7,1x)/))',advance='no') ' stress / GPa:',&
1e-9_pReal*merge(math_transpose33(bc(loadcase)%stress),&
reshape(spread(DAMASK_NaN,1,9),[ 3,3]),transpose(bc(loadcase)%maskStress))
if (any(bc(loadcase)%rotation /= math_I3)) &
write (6,'(a,/,3(3(f12.7,1x)/))',advance='no') ' rotation of loadframe:',&
write(6,'(a,/,3(3(f12.7,1x)/))',advance='no') ' rotation of loadframe:',&
math_transpose33(bc(loadcase)%rotation)
write(6,'(a,f12.6)') 'temperature:', bc(loadcase)%temperature
write(6,'(a,f12.6)') 'time: ', bc(loadcase)%time
@ -539,7 +533,7 @@ program DAMASK_spectral
enddo; enddo; enddo
if (debugGeneral) write(6,'(a)') 'First call to CPFEM finished'
C = C * wgt
!--------------------------------------------------------------------------------------------------
! calculation of discrete angular frequencies, ordered as in FFTW (wrap around)
@ -805,7 +799,7 @@ program DAMASK_spectral
P_av_lab = real(P_fourier(1,1,1,1:3,1:3),pReal)*wgt
P_av = math_rotate_forward33(P_av_lab,bc(loadcase)%rotation)
write (6,'(a,/,3(3(f12.7,1x)/))',advance='no') 'Piola-Kirchhoff stress / MPa =',&
write(6,'(a,/,3(3(f12.7,1x)/))',advance='no') 'Piola-Kirchhoff stress / MPa =',&
math_transpose33(P_av)/1.e6_pReal
!--------------------------------------------------------------------------------------------------
@ -1051,7 +1045,7 @@ program DAMASK_spectral
if (mod(inc,bc(loadcase)%outputFrequency) == 0_pInt) then ! at output frequency
write(6,'(a)') ''
write(6,'(a)') '... writing results to file ......................................'
write(538) materialpoint_results(1_pInt:materialpoint_sizeResults,1,1_pInt:mesh_NcpElems) ! write result to file
write(538) materialpoint_results(1_pInt:materialpoint_sizeResults,1,1_pInt:mesh_NcpElems) ! write result to file
flush(538)
endif

View File

@ -1,5 +1,5 @@
!--------------------------------------------------------------------------------------------------
!* $Id$
! $Id$
!--------------------------------------------------------------------------------------------------
!> @author Pratheek Shanthraj, Max-Planck-Institut für Eisenforschung GmbH
!> @author Martin Diehl, Max-Planck-Institut für Eisenforschung GmbH
@ -15,12 +15,10 @@ program DAMASK_spectral_Driver
getSolverWorkingDirectoryName, &
getSolverJobName, &
appendToOutFile
use prec, only: &
pInt, &
pReal, &
DAMASK_NaN
use IO, only: &
IO_isBlank, &
IO_open_file, &
@ -33,36 +31,28 @@ program DAMASK_spectral_Driver
IO_read_jobBinaryFile, &
IO_write_jobBinaryFile, &
IO_intOut
use math
use math ! need to include the whole module for FFTW
use mesh, only : &
res, &
geomdim, &
mesh_NcpElems
use CPFEM, only: &
CPFEM_initAll
use FEsolving, only: &
restartWrite, &
restartInc
use numerics, only: &
maxCutBack, &
rotation_tol, &
mySpectralSolver
use homogenization, only: &
materialpoint_sizeResults, &
materialpoint_results
use DAMASK_spectral_Utilities, only: &
tBoundaryCondition, &
tSolutionState, &
debugGeneral, &
cutBack
use DAMASK_spectral_SolverBasic
#ifdef PETSc
use DAMASK_spectral_SolverBasicPETSC
@ -96,12 +86,11 @@ program DAMASK_spectral_Driver
N_l = 0_pInt, &
N_t = 0_pInt, &
N_n = 0_pInt, &
N_Fdot = 0_pInt, & ! number of Fourier points
N_Fdot = 0_pInt, & !
myUnit = 234_pInt
character(len=1024) :: &
line
!--------------------------------------------------------------------------------------------------
! loop variables, convergence etc.
real(pReal), dimension(3,3), parameter :: ones = 1.0_pReal, zeros = 0.0_pReal
@ -120,11 +109,11 @@ program DAMASK_spectral_Driver
!--------------------------------------------------------------------------------------------------
! init DAMASK (all modules)
call CPFEM_initAll(temperature = 300.0_pReal, element = 1_pInt, IP= 1_pInt)
write(6,'(a)') ''
write(6,'(a)') ' <<<+- DAMASK_spectral_driver init -+>>>'
write(6,'(a)') ' $Id$'
#include "compilation_info.f90"
!--------------------------------------------------------------------------------------------------
! reading basic information from load case file and allocate data structure containing load cases
call IO_open_file(myUnit,trim(loadCaseFile))
@ -147,12 +136,12 @@ program DAMASK_spectral_Driver
enddo ! count all identifiers to allocate memory and do sanity check
enddo
100 if ((N_l + N_Fdot /= N_n) .or. (N_n /= N_t)) & ! sanity check
call IO_error(error_ID=837_pInt,ext_msg = trim(loadCaseFile)) ! error message for incomplete loadcase
100 if ((N_l + N_Fdot /= N_n) .or. (N_n /= N_t)) & ! sanity check
call IO_error(error_ID=837_pInt,ext_msg = trim(loadCaseFile)) ! error message for incomplete loadcase
allocate (loadCases(N_n))
loadCases%P%myType='p'
!--------------------------------------------------------------------------------------------------
!--------------------------------------------------------------------------------------------------
! reading the load case and assign values to the allocated data structure
rewind(myUnit)
do
@ -163,7 +152,7 @@ program DAMASK_spectral_Driver
do i = 1_pInt,maxNchunksLoadcase
select case (IO_lc(IO_stringValue(line,positions,i)))
case('fdot','dotf','l','velocitygrad','velgrad','velocitygradient') ! assign values for the deformation BC matrix
if (IO_lc(IO_stringValue(line,positions,i)) == 'l'.or. & ! in case of given L, set flag to true
if (IO_lc(IO_stringValue(line,positions,i)) == 'l'.or. & ! in case of given L, set flag to true
IO_lc(IO_stringValue(line,positions,i)) == 'velocitygrad'.or.&
IO_lc(IO_stringValue(line,positions,i)) == 'velgrad'.or.&
IO_lc(IO_stringValue(line,positions,i)) == 'velocitygradient') then
@ -203,7 +192,7 @@ program DAMASK_spectral_Driver
case('r','restart','restartwrite') ! frequency of writing restart information
loadCases(currentLoadCase)%restartfrequency = max(0_pInt,IO_intValue(line,positions,i+1_pInt))
case('guessreset','dropguessing')
loadCases(currentLoadCase)%followFormerTrajectory = .false. ! do not continue to predict deformation along former trajectory
loadCases(currentLoadCase)%followFormerTrajectory = .false. ! do not continue to predict deformation along former trajectory
case('euler') ! rotation of currentLoadCase given in euler angles
l = 0_pInt ! assuming values given in degrees
k = 0_pInt ! assuming keyword indicating degree/radians
@ -228,58 +217,65 @@ program DAMASK_spectral_Driver
!--------------------------------------------------------------------------------------------------
! consistency checks and output of load case
loadCases(1)%followFormerTrajectory = .false. ! cannot guess along trajectory for first inc of first currentLoadCase
loadCases(1)%followFormerTrajectory = .false. ! cannot guess along trajectory for first inc of first currentLoadCase
errorID = 0_pInt
checkLoadcases: do currentLoadCase = 1_pInt, size(loadCases)
write (loadcase_string, '(i6)' ) currentLoadCase
write(6,'(1x,a,i6)') 'load case: ', currentLoadCase
if (.not. loadCases(currentLoadCase)%followFormerTrajectory) write(6,'(2x,a)') 'drop guessing along trajectory'
if (.not. loadCases(currentLoadCase)%followFormerTrajectory) &
write(6,'(2x,a)') 'drop guessing along trajectory'
if (loadCases(currentLoadCase)%deformation%myType=='l') then
do j = 1_pInt, 3_pInt
if (any(loadCases(currentLoadCase)%deformation%maskLogical(j,1:3) .eqv. .true.) .and. &
any(loadCases(currentLoadCase)%deformation%maskLogical(j,1:3) .eqv. .false.)) errorID = 832_pInt ! each row should be either fully or not at all defined
any(loadCases(currentLoadCase)%deformation%maskLogical(j,1:3) .eqv. .false.)) &
errorID = 832_pInt ! each row should be either fully or not at all defined
enddo
write(6,'(2x,a)') 'velocity gradient:'
else
write(6,'(2x,a)') 'deformation gradient rate:'
endif
write(6,'(3(3(3x,f12.7,1x)/))',advance='no') merge(math_transpose33(loadCases(currentLoadCase)%deformation%values),&
reshape(spread(huge(1.0_pReal),1,9),[ 3,3]),transpose(loadCases(currentLoadCase)%deformation%maskLogical))
write(6,'(3(3(3x,f12.7,1x)/))',advance='no') &
merge(math_transpose33(loadCases(currentLoadCase)%deformation%values), &
reshape(spread(huge(1.0_pReal),1,9),[ 3,3]), &
transpose(loadCases(currentLoadCase)%deformation%maskLogical))
if (any(loadCases(currentLoadCase)%P%maskLogical .eqv. &
loadCases(currentLoadCase)%deformation%maskLogical)) errorID = 831_pInt ! exclusive or masking only
if (any(loadCases(currentLoadCase)%P%maskLogical .and. &
transpose(loadCases(currentLoadCase)%P%maskLogical) .and. &
reshape([ .false.,.true.,.true.,.true.,.false.,.true.,.true.,.true.,.false.],[ 3,3]))) &
errorID = 838_pInt ! no rotation is allowed by stress BC
write(6,'(2x,a,/,3(3(3x,f12.7,1x)/))',advance='no') 'stress / GPa:',&
1e-9_pReal*merge(math_transpose33(loadCases(currentLoadCase)%P%values),&
reshape(spread(huge(1.0_pReal),1,9),[ 3,3]),transpose(loadCases(currentLoadCase)%P%maskLogical))
1e-9_pReal*merge(math_transpose33(loadCases(currentLoadCase)%P%values),&
reshape(spread(huge(1.0_pReal),1,9),[ 3,3]),&
transpose(loadCases(currentLoadCase)%P%maskLogical))
if (any(abs(math_mul33x33(loadCases(currentLoadCase)%rotation, &
math_transpose33(loadCases(currentLoadCase)%rotation))-math_I3) >&
reshape(spread(rotation_tol,1,9),[ 3,3]))&
.or. abs(math_det33(loadCases(currentLoadCase)%rotation)) > &
1.0_pReal + rotation_tol) errorID = 846_pInt ! given rotation matrix contains strain
if (any(loadCases(currentLoadCase)%rotation /= math_I3)) &
write(6,'(2x,a,/,3(3(3x,f12.7,1x)/))',advance='no') 'rotation of loadframe:',&
math_transpose33(loadCases(currentLoadCase)%rotation)
math_transpose33(loadCases(currentLoadCase)%rotation)
write(6,'(2x,a,f12.6)') 'temperature:', loadCases(currentLoadCase)%temperature
if (loadCases(currentLoadCase)%time < 0.0_pReal) errorID = 834_pInt ! negative time increment
write(6,'(2x,a,f12.6)') 'time: ', loadCases(currentLoadCase)%time
if (loadCases(currentLoadCase)%incs < 1_pInt) errorID = 835_pInt ! non-positive incs count
write(6,'(2x,a,i5)') 'increments: ', loadCases(currentLoadCase)%incs
write(6,'(2x,a,i5)') 'output frequency: ', loadCases(currentLoadCase)%outputfrequency
write(6,'(2x,a,i5,/)') 'restart frequency: ', loadCases(currentLoadCase)%restartfrequency
if (any(loadCases(currentLoadCase)%P%maskLogical .eqv. loadCases(currentLoadCase)%deformation%maskLogical)) errorID = 831_pInt ! exclusive or masking only
if (any(loadCases(currentLoadCase)%P%maskLogical .and. transpose(loadCases(currentLoadCase)%P%maskLogical) .and. &
reshape([ .false.,.true.,.true.,.true.,.false.,.true.,.true.,.true.,.false.],[ 3,3]))) &
errorID = 838_pInt ! no rotation is allowed by stress BC
if (any(abs(math_mul33x33(loadCases(currentLoadCase)%rotation,math_transpose33(loadCases(currentLoadCase)%rotation))&
-math_I3) > reshape(spread(rotation_tol,1,9),[ 3,3]))&
.or. abs(math_det33(loadCases(currentLoadCase)%rotation)) > 1.0_pReal + rotation_tol)&
errorID = 846_pInt ! given rotation matrix contains strain
if (loadCases(currentLoadCase)%time < 0.0_pReal) errorID = 834_pInt ! negative time increment
if (loadCases(currentLoadCase)%incs < 1_pInt) errorID = 835_pInt ! non-positive incs count
if (loadCases(currentLoadCase)%outputfrequency < 1_pInt) errorID = 836_pInt ! non-positive result frequency
if (loadCases(currentLoadCase)%outputfrequency < 1_pInt) errorID = 836_pInt ! non-positive result frequency
write(6,'(2x,a,i5)') 'output frequency: ', &
loadCases(currentLoadCase)%outputfrequency
write(6,'(2x,a,i5,/)') 'restart frequency: ', &
loadCases(currentLoadCase)%restartfrequency
if (errorID > 0_pInt) call IO_error(error_ID = errorID, ext_msg = loadcase_string)
enddo checkLoadcases
select case (myspectralsolver)
case (DAMASK_spectral_SolverBasic_label)
call basic_init()
#ifdef PETSc
case (DAMASK_spectral_SolverBasicPETSc_label)
call basicPETSc_init()
case (DAMASK_spectral_SolverAL_label)
call AL_init()
#endif
@ -291,14 +287,12 @@ program DAMASK_spectral_Driver
! write header of output file
if (appendToOutFile) then
open(newunit=resUnit,file=trim(getSolverWorkingDirectoryName())//trim(getSolverJobName())//&
'.spectralOut',form='UNFORMATTED', position='APPEND', status='OLD')
'.spectralOut',form='UNFORMATTED', position='APPEND', status='OLD')
open(newunit=statUnit,file=trim(getSolverWorkingDirectoryName())//trim(getSolverJobName())//&
'.sta',form='FORMATTED', position='APPEND', status='OLD')
'.sta',form='FORMATTED', position='APPEND', status='OLD')
else
open(newunit=resUnit,file=trim(getSolverWorkingDirectoryName())//trim(getSolverJobName())//&
'.spectralOut',form='UNFORMATTED',status='REPLACE')
open(newunit=statUnit,file=trim(getSolverWorkingDirectoryName())//trim(getSolverJobName())//&
'.sta',form='FORMATTED',status='REPLACE')
'.spectralOut',form='UNFORMATTED',status='REPLACE')
write(resUnit) 'load', trim(loadCaseFile)
write(resUnit) 'workingdir', trim(getSolverWorkingDirectoryName())
write(resUnit) 'geometry', trim(geometryFile)
@ -306,16 +300,18 @@ program DAMASK_spectral_Driver
write(resUnit) 'dimension', geomdim
write(resUnit) 'materialpoint_sizeResults', materialpoint_sizeResults
write(resUnit) 'loadcases', size(loadCases)
write(resUnit) 'frequencies', loadCases%outputfrequency ! one entry per currentLoadCase
write(resUnit) 'times', loadCases%time ! one entry per currentLoadCase
write(resUnit) 'frequencies', loadCases%outputfrequency ! one entry per currentLoadCase
write(resUnit) 'times', loadCases%time ! one entry per currentLoadCase
write(resUnit) 'logscales', loadCases%logscale
write(resUnit) 'increments', loadCases%incs ! one entry per currentLoadCase
write(resUnit) 'startingIncrement', restartInc - 1_pInt ! start with writing out the previous inc
write(resUnit) 'eoh' ! end of header
write(resUnit) materialpoint_results(1_pInt:materialpoint_sizeResults,1,1_pInt:mesh_NcpElems) ! initial (non-deformed or read-in) results
write(resUnit) 'increments', loadCases%incs ! one entry per currentLoadCase
write(resUnit) 'startingIncrement', restartInc - 1_pInt ! start with writing out the previous inc
write(resUnit) 'eoh' ! end of header
write(resUnit) materialpoint_results(1_pInt:materialpoint_sizeResults,1,1_pInt:mesh_NcpElems) ! initial (non-deformed or read-in) results
open(newunit=statUnit,file=trim(getSolverWorkingDirectoryName())//trim(getSolverJobName())//&
'.sta',form='FORMATTED',status='REPLACE')
write(statUnit,'(a)') 'Increment Time CutbackLevel Converged IterationsNeeded'
if (debugGeneral) write(6,'(a)') 'Header of result file written out'
endif
!--------------------------------------------------------------------------------------------------
! loopping over loadcases
loadCaseLooping: do currentLoadCase = 1_pInt, size(loadCases)
@ -344,10 +340,10 @@ program DAMASK_spectral_Driver
timeinc = loadCases(1)%time*(2.0_pReal**real(inc-1_pInt-loadCases(1)%incs ,pReal))
endif
else ! not-1st currentLoadCase of logarithmic scale
timeinc = time0 *( (1.0_pReal + loadCases(currentLoadCase)%time/time0 )**(real( inc,pReal)/&
real(loadCases(currentLoadCase)%incs ,pReal))&
-(1.0_pReal + loadCases(currentLoadCase)%time/time0 )**(real( (inc-1_pInt),pReal)/&
real(loadCases(currentLoadCase)%incs ,pReal)) )
timeinc = time0 *( (1.0_pReal + loadCases(currentLoadCase)%time/time0 )**(real( inc,pReal)/&
real(loadCases(currentLoadCase)%incs ,pReal))&
-(1.0_pReal + loadCases(currentLoadCase)%time/time0 )**(real( (inc-1_pInt),pReal)/&
real(loadCases(currentLoadCase)%incs ,pReal)) )
endif
endif
timeinc = timeinc / 2.0_pReal**real(cutBackLevel,pReal)
@ -364,12 +360,12 @@ program DAMASK_spectral_Driver
',a,'//IO_intOut(inc)//',a,'//IO_intOut(loadCases(currentLoadCase)%incs)//&
',a,'//IO_intOut(stepFraction)//',a,'//IO_intOut(2_pInt**cutBackLevel)//&
',a,'//IO_intOut(currentLoadCase)//',a,'//IO_intOut(size(loadCases))//')') &
'Time', time, &
's: Increment ', inc, '/', loadCases(currentLoadCase)%incs,&
'-', stepFraction, '/', 2_pInt**cutBackLevel,&
' of load case ', currentLoadCase,'/',size(loadCases)
'Time', time, &
's: Increment ', inc, '/', loadCases(currentLoadCase)%incs,&
'-', stepFraction, '/', 2_pInt**cutBackLevel,&
' of load case ', currentLoadCase,'/',size(loadCases)
write(incInfo,'(a,'//IO_intOut(totalIncsCounter)//',a,'//IO_intOut(sum(loadCases(:)%incs))//&
',a,'//IO_intOut(stepFraction)//',a,'//IO_intOut(2_pInt**cutBackLevel)//')') &
',a,'//IO_intOut(stepFraction)//',a,'//IO_intOut(2_pInt**cutBackLevel)//')') &
'Inc. ',totalIncsCounter,'/',sum(loadCases(:)%incs),&
'-',stepFraction, '/', 2_pInt**cutBackLevel
select case(myspectralsolver)
@ -435,8 +431,13 @@ program DAMASK_spectral_Driver
write(6,'(1/,a)') '... writing results to file ......................................'
write(resUnit) materialpoint_results ! write result to file
endif
if( loadCases(currentLoadCase)%restartFrequency > 0_pInt .and. &
mod(inc,loadCases(currentLoadCase)%restartFrequency) == 0_pInt) then ! at frequency of writing restart information set restart parameter for FEsolving (first call to CPFEM_general will write ToDo: true?)
restartWrite = .true.
endif
else !just time forwarding
time = time + timeinc
time = time + timeinc
guessmode = 1.0_pReal
endif ! end calculation/forwarding
enddo incLooping

View File

@ -208,7 +208,7 @@ subroutine AL_init()
close (777)
endif
call Utilities_updateGamma(C)
call Utilities_updateGamma(C,.True.)
C_scale = C
S_scale = math_invSym3333(C)
@ -328,7 +328,7 @@ else
!--------------------------------------------------------------------------------------------------
! update stiffness (and gamma operator)
S = Utilities_maskedCompliance(rotation_BC,P_BC%maskLogical,C)
if (update_gamma) call Utilities_updateGamma(C)
if (update_gamma) call Utilities_updateGamma(C,restartWrite)
ForwardData = .True.
mask_stress = P_BC%maskFloat

View File

@ -33,7 +33,8 @@ module DAMASK_spectral_SolverBasic
! stress, stiffness and compliance average etc.
real(pReal), private, dimension(3,3) :: &
F_aim = math_I3, &
F_aim_lastInc = math_I3
F_aim_lastInc = math_I3, &
F_aimDot = 0.0_pReal
real(pReal), private,dimension(3,3,3,3) :: &
C = 0.0_pReal, C_lastInc = 0.0_pReal
@ -69,8 +70,9 @@ subroutine basic_init()
implicit none
integer(pInt) :: i,j,k
real(pReal), dimension(3,3) :: temp33_Real
real(pReal), dimension(3,3,3,3) :: temp3333_Real
call Utilities_Init()
write(6,'(/,a)') ' <<<+- DAMASK_spectral_solverBasic init -+>>>'
write(6,'(a)') ' $Id$'
@ -81,8 +83,8 @@ subroutine basic_init()
allocate (F_lastInc ( 3,3,res(1), res(2),res(3)), source = 0.0_pReal)
allocate (Fdot ( 3,3,res(1), res(2),res(3)), source = 0.0_pReal)
allocate (P ( 3,3,res(1), res(2),res(3)), source = 0.0_pReal)
allocate (coordinates( res(1), res(2),res(3),3), source = 0.0_pReal)
allocate (temperature( res(1), res(2),res(3)), source = 0.0_pReal)
allocate (coordinates( res(1), res(2),res(3),3),source = 0.0_pReal)
allocate (temperature( res(1), res(2),res(3)), source = 0.0_pReal)
!--------------------------------------------------------------------------------------------------
! init fields
@ -93,6 +95,7 @@ subroutine basic_init()
coordinates(i,j,k,1:3) = geomdim/real(res,pReal)*real([i,j,k],pReal) &
- geomdim/real(2_pInt*res,pReal)
enddo; enddo; enddo
elseif (restartInc > 1_pInt) then ! using old values from file
if (debugRestart) write(6,'(a,'//IO_intOut(restartInc-1_pInt)//',a)') &
'Reading values of increment', restartInc - 1_pInt, 'from file'
@ -110,26 +113,32 @@ subroutine basic_init()
call IO_read_jobBinaryFile(777,'F_aim_lastInc',trim(getSolverJobName()),size(F_aim_lastInc))
read (777,rec=1) F_aim_lastInc
close (777)
call IO_read_jobBinaryFile(777,'C_lastInc',trim(getSolverJobName()),size(C_lastInc))
read (777,rec=1) C_lastInc
close (777)
call IO_read_jobBinaryFile(777,'C',trim(getSolverJobName()),size(C))
read (777,rec=1) C
close (777)
call IO_read_jobBinaryFile(777,'F_aimDot',trim(getSolverJobName()),size(f_aimDot))
read (777,rec=1) f_aimDot
close (777)
call IO_read_jobBinaryFile(777,'C_ref',trim(getSolverJobName()),size(temp3333_Real))
read (777,rec=1) temp3333_Real
close (777)
coordinates = 0.0 ! change it later!!!
endif
!no rotation bc call deformed_fft(res,geomdim,math_rotate_backward33(F_aim,rotation_BC),1.0_pReal,F_lastInc,coordinates)
call Utilities_constitutiveResponse(coordinates,F,F_lastInc,temperature,0.0_pReal,&
call Utilities_constitutiveResponse(coordinates,F,F,temperature,0.0_pReal,&
P,C,temp33_Real,.false.,math_I3)
!no rotation bc call deformed_fft(res,geomdim,math_rotate_backward33(F_aim,rotation_BC),1.0_pReal,F_lastInc,coordinates)
!--------------------------------------------------------------------------------------------------
! reference stiffness
if (restartInc == 1_pInt) then
call IO_write_jobBinaryFile(777,'C_ref',size(C))
write (777,rec=1) C
close(777)
elseif (restartInc > 1_pInt) then
call IO_read_jobBinaryFile(777,'C_ref',trim(getSolverJobName()),size(C))
read (777,rec=1) C
close (777)
endif
if (restartInc == 1_pInt) then ! use initial stiffness as reference stiffness
temp3333_Real = C
endif
call Utilities_updateGamma(C)
call Utilities_updateGamma(temp3333_Real,.True.)
end subroutine basic_init
@ -173,8 +182,11 @@ type(tSolutionState) function &
use FEsolving, only: &
restartWrite, &
restartRead, &
terminallyIll
use DAMASK_spectral_Utilities, only: cutBack
use DAMASK_spectral_Utilities, only: &
cutBack
implicit none
!--------------------------------------------------------------------------------------------------
! input data for solution
@ -184,8 +196,7 @@ type(tSolutionState) function &
real(pReal), dimension(3,3), intent(in) :: rotation_BC
real(pReal), dimension(3,3,3,3) :: S
real(pReal), dimension(3,3), save :: f_aimDot = 0.0_pReal
real(pReal), dimension(3,3) :: F_aim_lab, &
real(pReal), dimension(3,3) :: F_aim_lab, &
F_aim_lab_lastIter, &
P_av
!--------------------------------------------------------------------------------------------------
@ -200,21 +211,35 @@ type(tSolutionState) function &
! restart information for spectral solver
if (restartWrite) then
write(6,'(a)') 'writing converged results for restart'
call IO_write_jobBinaryFile(777,'convergedSpectralDefgrad',size(F_lastInc))
write (777,rec=1) F_LastInc
call IO_write_jobBinaryFile(777,'convergedSpectralDefgrad',size(F)) ! writing deformation gradient field to file
write (777,rec=1) F
close (777)
call IO_write_jobBinaryFile(777,'convergedSpectralDefgrad_lastInc',size(F_lastInc)) ! writing F_lastInc field to file
write (777,rec=1) F_lastInc
close (777)
call IO_write_jobBinaryFile(777,'F_aim',size(F_aim))
write (777,rec=1) F_aim
close(777)
call IO_write_jobBinaryFile(777,'F_aim_lastInc',size(F_aim_lastInc))
write (777,rec=1) F_aim_lastInc
close(777)
call IO_write_jobBinaryFile(777,'C',size(C))
write (777,rec=1) C
close(777)
call IO_write_jobBinaryFile(777,'C_lastInc',size(C_lastInc))
write (777,rec=1) C_lastInc
close(777)
call IO_write_jobBinaryFile(777,'F_aimDot',size(f_aimDot))
write (777,rec=1) f_aimDot
close(777)
endif
if ( cutBack) then
F_aim = F_aim_lastInc
F = F_lastInc
C = C_lastInc
else
C_lastInc = C
F_aim = F_aim_lastInc
F = F_lastInc
C = C_lastInc
else
C_lastInc = C
!--------------------------------------------------------------------------------------------------
! calculate rate for aim
if (F_BC%myType=='l') then ! calculate f_aimDot from given L and current F
@ -225,7 +250,8 @@ else
f_aimDot = f_aimDot &
+ guessmode * P_BC%maskFloat * (F_aim - F_aim_lastInc)/timeinc_old
F_aim_lastInc = F_aim
print*, 'F_aimDot', f_aimDot
print*, 'guessmode', guessmode
!--------------------------------------------------------------------------------------------------
! update coordinates and rate and forward last inc
call deformed_fft(res,geomdim,math_rotate_backward33(F_aim_lastInc,rotation_BC), &
@ -235,15 +261,15 @@ else
F_lastInc = F
endif
F_aim = F_aim + f_aimDot * timeinc
F = Utilities_forwardField(timeinc,F_aim,F_lastInc,Fdot) !I think F aim should be rotated here
F = Utilities_forwardField(timeinc,F_aim,F_lastInc,Fdot) !I think F aim should be rotated here
!--------------------------------------------------------------------------------------------------
! update stiffness (and gamma operator)
S = Utilities_maskedCompliance(rotation_BC,P_BC%maskLogical,C)
if (update_gamma) call Utilities_updateGamma(C)
if (update_gamma) call Utilities_updateGamma(C,restartWrite)
ForwardData = .True.
if (.not. restartRead) ForwardData = .True.
iter = 0_pInt
convergenceLoop: do while(iter < itmax)

View File

@ -191,7 +191,7 @@ subroutine BasicPETSC_init()
close (777)
endif
call Utilities_updateGamma(C)
call Utilities_updateGamma(C,.True.)
end subroutine BasicPETSC_init
@ -294,7 +294,7 @@ else
!--------------------------------------------------------------------------------------------------
! update stiffness (and gamma operator)
S = Utilities_maskedCompliance(rotation_BC,P_BC%maskLogical,C)
if (update_gamma) call Utilities_updateGamma(C)
if (update_gamma) call Utilities_updateGamma(C,restartWrite)
ForwardData = .True.
mask_stress = P_BC%maskFloat

File diff suppressed because it is too large Load Diff