From 645b2605e11bb9636112ae71182e37e3f51b2568 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Fri, 11 Jan 2013 10:40:16 +0000 Subject: [PATCH] corrected reporting to statistics file (*.sta) --- code/DAMASK_spectral_solverAL.f90 | 11 +++++++---- code/DAMASK_spectral_solverBasic.f90 | 1 + code/DAMASK_spectral_solverBasicPETSc.f90 | 14 +++++++++----- code/DAMASK_spectral_utilities.f90 | 1 + code/IO.f90 | 9 ++++----- code/homogenization_isostrain.f90 | 6 ++---- 6 files changed, 24 insertions(+), 18 deletions(-) diff --git a/code/DAMASK_spectral_solverAL.f90 b/code/DAMASK_spectral_solverAL.f90 index 50c82c958..56108fa6d 100644 --- a/code/DAMASK_spectral_solverAL.f90 +++ b/code/DAMASK_spectral_solverAL.f90 @@ -212,9 +212,9 @@ end subroutine AL_init !-------------------------------------------------------------------------------------------------- type(tSolutionState) function & AL_solution(incInfoIn,guess,timeinc,timeinc_old,P_BC,F_BC,temperature_bc,rotation_BC) - use numerics, only: & - update_gamma + update_gamma, & + itmax use math, only: & math_mul33x33 ,& math_rotate_backward33 @@ -354,9 +354,12 @@ type(tSolutionState) function & AL_solution%termIll = terminallyIll terminallyIll = .false. - if (reason > 0 ) then + if (reason < 1 ) then + AL_solution%converged = .false. + AL_solution%iterationsNeeded = itmax + else AL_solution%converged = .true. - AL_solution%iterationsNeeded = reportIter + AL_solution%iterationsNeeded = reportIter - 1_pInt endif end function AL_solution diff --git a/code/DAMASK_spectral_solverBasic.f90 b/code/DAMASK_spectral_solverBasic.f90 index 5e15267e5..8b1f0b7d8 100644 --- a/code/DAMASK_spectral_solverBasic.f90 +++ b/code/DAMASK_spectral_solverBasic.f90 @@ -274,6 +274,7 @@ type(tSolutionState) function & ! iteration till converged if (.not. restartRead) ForwardData = .True. iter = 0_pInt + basic_solution%iterationsNeeded = itmax convergenceLoop: do while(iter < itmax) iter = iter + 1_pInt !-------------------------------------------------------------------------------------------------- diff --git a/code/DAMASK_spectral_solverBasicPETSc.f90 b/code/DAMASK_spectral_solverBasicPETSc.f90 index ad25d51e1..4eb8a42ab 100644 --- a/code/DAMASK_spectral_solverBasicPETSc.f90 +++ b/code/DAMASK_spectral_solverBasicPETSc.f90 @@ -194,7 +194,8 @@ end subroutine basicPETSc_init type(tSolutionState) function & basicPETSc_solution(incInfoIn,guess,timeinc,timeinc_old,P_BC,F_BC,temperature_bc,rotation_BC) use numerics, only: & - update_gamma + update_gamma, & + itmax use math, only: & math_mul33x33 ,& math_rotate_backward33 @@ -313,10 +314,13 @@ type(tSolutionState) function & call SNESGetConvergedReason(snes,reason,ierr); CHKERRQ(ierr) basicPETSc_solution%termIll = terminallyIll terminallyIll = .false. - BasicPETSC_solution%converged =.false. - if (reason > 0 ) then - BasicPETSC_solution%converged = .true. - BasicPETSC_solution%iterationsNeeded = reportIter + + if (reason < 1) then + basicPETSC_solution%converged = .false. + basicPETSC_solution%iterationsNeeded = itmax + else + basicPETSC_solution%converged = .true. + basicPETSC_solution%iterationsNeeded = reportIter - 1_pInt endif end function BasicPETSc_solution diff --git a/code/DAMASK_spectral_utilities.f90 b/code/DAMASK_spectral_utilities.f90 index 4f8a791d9..2c83a34b6 100644 --- a/code/DAMASK_spectral_utilities.f90 +++ b/code/DAMASK_spectral_utilities.f90 @@ -113,6 +113,7 @@ subroutine utilities_init() debug_spectralDivergence, & debug_spectralRestart, & debug_spectralFFTW, & + debug_spectralPETSc, & debug_spectralRotation #ifdef PETSc use debug, only: & diff --git a/code/IO.f90 b/code/IO.f90 index 1eb096019..d617ab725 100644 --- a/code/IO.f90 +++ b/code/IO.f90 @@ -1003,7 +1003,7 @@ end function IO_lc !-------------------------------------------------------------------------------------------------- !> @brief in place change of character in line to lower case !-------------------------------------------------------------------------------------------------- -subroutine IO_lcInplace(line) +pure subroutine IO_lcInplace(line) implicit none character(26), parameter :: lower = 'abcdefghijklmnopqrstuvwxyz' @@ -1652,17 +1652,16 @@ end function abaqus_assembleInputFile !-------------------------------------------------------------------------------------------------- !> @brief hybrid IA repetition counter !-------------------------------------------------------------------------------------------------- -integer(pInt) function hybridIA_reps(dV_V,steps,C) +integer(pInt) pure function hybridIA_reps(dV_V,steps,C) implicit none - integer(pInt), intent(in), dimension(3) :: & + integer(pInt), intent(in), dimension(3) :: & steps real(pReal), intent(in), dimension(steps(3),steps(2),steps(1)) :: & dV_V real(pReal), intent(in) :: & C - - integer(pInt) :: phi1,Phi,phi2 + integer(pInt) :: phi1,Phi,phi2 hybridIA_reps = 0_pInt do phi1=1_pInt,steps(1) diff --git a/code/homogenization_isostrain.f90 b/code/homogenization_isostrain.f90 index 71a60414b..5671c504e 100644 --- a/code/homogenization_isostrain.f90 +++ b/code/homogenization_isostrain.f90 @@ -162,7 +162,7 @@ function homogenization_isostrain_stateInit(myInstance) homogenization_isostrain_stateInit = 0.0_pReal -endfunction homogenization_isostrain_stateInit +end function homogenization_isostrain_stateInit !******************************************************************** @@ -263,7 +263,7 @@ end subroutine homogenization_isostrain_averageStressAndItsTangent !******************************************************************** ! derive average stress and stiffness from constituent quantities !******************************************************************** -function homogenization_isostrain_averageTemperature(& +pure function homogenization_isostrain_averageTemperature(& Temperature, & ! temperature ip, & ! my integration point el & ! my element @@ -316,8 +316,6 @@ pure function homogenization_isostrain_postResults(& c = c + 1_pInt end select enddo - - return end function homogenization_isostrain_postResults