2013-03-22 23:05:05 +05:30
|
|
|
! Copyright 2011-2013 Max-Planck-Institut für Eisenforschung GmbH
|
2011-04-04 19:39:54 +05:30
|
|
|
!
|
|
|
|
! This file is part of DAMASK,
|
2012-08-25 17:16:36 +05:30
|
|
|
! the Düsseldorf Advanced Material Simulation Kit.
|
2011-04-04 19:39:54 +05:30
|
|
|
!
|
|
|
|
! DAMASK is free software: you can redistribute it and/or modify
|
|
|
|
! it under the terms of the GNU General Public License as published by
|
|
|
|
! the Free Software Foundation, either version 3 of the License, or
|
|
|
|
! (at your option) any later version.
|
|
|
|
!
|
|
|
|
! DAMASK is distributed in the hope that it will be useful,
|
|
|
|
! but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
! GNU General Public License for more details.
|
|
|
|
!
|
|
|
|
! You should have received a copy of the GNU General Public License
|
|
|
|
! along with DAMASK. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
!
|
2012-08-25 17:16:36 +05:30
|
|
|
!--------------------------------------------------------------------------------------------------
|
2009-08-31 20:39:15 +05:30
|
|
|
!* $Id$
|
2012-08-25 17:16:36 +05:30
|
|
|
!--------------------------------------------------------------------------------------------------
|
|
|
|
!> @author Franz Roters, Max-Planck-Institut für Eisenforschung GmbH
|
|
|
|
!> @author Philip Eisenlohr, Max-Planck-Institut für Eisenforschung GmbH
|
|
|
|
!> @author Christoph Kords, Max-Planck-Institut für Eisenforschung GmbH
|
|
|
|
!> @author Martin Diehl, Max-Planck-Institut für Eisenforschung GmbH
|
|
|
|
!> @brief Reading in and interpretating the debugging settings for the various modules
|
|
|
|
!--------------------------------------------------------------------------------------------------
|
2012-03-09 01:55:28 +05:30
|
|
|
module debug
|
2012-03-20 17:56:21 +05:30
|
|
|
use prec, only: &
|
|
|
|
pInt, &
|
|
|
|
pReal, &
|
|
|
|
pLongInt
|
2008-01-11 00:23:57 +05:30
|
|
|
|
2012-03-09 01:55:28 +05:30
|
|
|
implicit none
|
|
|
|
private
|
|
|
|
integer(pInt), parameter, public :: &
|
2013-03-31 18:36:49 +05:30
|
|
|
debug_LEVELSELECTIVE = 2_pInt**0_pInt, &
|
|
|
|
debug_LEVELBASIC = 2_pInt**1_pInt, &
|
|
|
|
debug_LEVELEXTENSIVE = 2_pInt**2_pInt
|
2012-03-09 01:55:28 +05:30
|
|
|
integer(pInt), parameter, private :: &
|
2013-03-31 18:36:49 +05:30
|
|
|
debug_MAXGENERAL = debug_LEVELEXTENSIVE ! must be set to the last bitcode used by (potentially) all debug types
|
2012-03-09 01:55:28 +05:30
|
|
|
integer(pInt), parameter, public :: &
|
2013-03-31 18:36:49 +05:30
|
|
|
debug_SPECTRALRESTART = debug_MAXGENERAL*2_pInt**1_pInt, &
|
|
|
|
debug_SPECTRALFFTW = debug_MAXGENERAL*2_pInt**2_pInt, &
|
|
|
|
debug_SPECTRALDIVERGENCE = debug_MAXGENERAL*2_pInt**3_pInt, &
|
|
|
|
debug_SPECTRALROTATION = debug_MAXGENERAL*2_pInt**4_pInt, &
|
|
|
|
debug_SPECTRALPETSC = debug_MAXGENERAL*2_pInt**5_pInt
|
2012-03-09 01:55:28 +05:30
|
|
|
|
|
|
|
integer(pInt), parameter, public :: &
|
2013-03-31 18:36:49 +05:30
|
|
|
debug_DEBUG = 1_pInt, &
|
|
|
|
debug_MATH = 2_pInt, &
|
|
|
|
debug_FESOLVING = 3_pInt, &
|
|
|
|
debug_MESH = 4_pInt, & !< stores debug level for mesh part of DAMASK bitwise coded
|
|
|
|
debug_MATERIAL = 5_pInt, & !< stores debug level for material part of DAMASK bitwise coded
|
|
|
|
debug_LATTICE = 6_pInt, & !< stores debug level for lattice part of DAMASK bitwise coded
|
|
|
|
debug_CONSTITUTIVE = 7_pInt, & !< stores debug level for constitutive part of DAMASK bitwise coded
|
|
|
|
debug_CRYSTALLITE = 8_pInt, &
|
|
|
|
debug_HOMOGENIZATION = 9_pInt, &
|
2012-03-09 01:55:28 +05:30
|
|
|
debug_CPFEM = 10_pInt, &
|
2013-03-31 18:36:49 +05:30
|
|
|
debug_SPECTRAL = 11_pInt, &
|
|
|
|
debug_MARC = 12_pInt, &
|
|
|
|
debug_ABAQUS = 13_pInt
|
2012-03-21 23:34:52 +05:30
|
|
|
integer(pInt), parameter, private :: &
|
2013-10-16 18:34:59 +05:30
|
|
|
debug_MAXNTYPE = debug_ABAQUS !< must be set to the maximum defined debug type
|
2012-03-09 01:55:28 +05:30
|
|
|
|
2012-10-02 15:05:39 +05:30
|
|
|
integer(pInt),protected, dimension(debug_maxNtype+2_pInt), public :: & ! specific ones, and 2 for "all" and "other"
|
2012-07-05 15:24:50 +05:30
|
|
|
debug_level = 0_pInt
|
2012-03-09 01:55:28 +05:30
|
|
|
|
|
|
|
integer(pInt), public :: &
|
2013-10-16 18:34:59 +05:30
|
|
|
debug_cumLpCalls = 0_pInt, & !< total number of calls to LpAndItsTangent
|
|
|
|
debug_cumDeltaStateCalls = 0_pInt, & !< total number of calls to deltaState
|
|
|
|
debug_cumDotStateCalls = 0_pInt, & !< total number of calls to dotState
|
2012-03-09 01:55:28 +05:30
|
|
|
debug_e = 1_pInt, &
|
|
|
|
debug_i = 1_pInt, &
|
|
|
|
debug_g = 1_pInt
|
|
|
|
|
|
|
|
integer(pLongInt), public :: &
|
2013-10-16 18:34:59 +05:30
|
|
|
debug_cumLpTicks = 0_pLongInt, & !< total cpu ticks spent in LpAndItsTangent
|
|
|
|
debug_cumDeltaStateTicks = 0_pLongInt, & !< total cpu ticks spent in deltaState
|
|
|
|
debug_cumDotStateTicks = 0_pLongInt !< total cpu ticks spent in dotState
|
2012-03-09 01:55:28 +05:30
|
|
|
|
|
|
|
integer(pInt), dimension(2), public :: &
|
|
|
|
debug_stressMaxLocation = 0_pInt, &
|
|
|
|
debug_stressMinLocation = 0_pInt, &
|
|
|
|
debug_jacobianMaxLocation = 0_pInt, &
|
|
|
|
debug_jacobianMinLocation = 0_pInt
|
|
|
|
|
|
|
|
integer(pInt), dimension(:), allocatable, public :: &
|
2013-10-16 18:34:59 +05:30
|
|
|
debug_CrystalliteLoopDistribution, & !< distribution of crystallite cutbacks
|
2012-03-09 01:55:28 +05:30
|
|
|
debug_MaterialpointStateLoopDistribution, &
|
|
|
|
debug_MaterialpointLoopDistribution
|
2010-09-23 13:31:41 +05:30
|
|
|
|
2012-03-09 01:55:28 +05:30
|
|
|
integer(pInt), dimension(:,:), allocatable, public :: &
|
2013-10-16 18:34:59 +05:30
|
|
|
debug_StressLoopDistribution, & !< distribution of stress iterations until convergence
|
|
|
|
debug_StateLoopDistribution !< distribution of state iterations until convergence
|
2012-03-09 01:55:28 +05:30
|
|
|
|
|
|
|
real(pReal), public :: &
|
|
|
|
debug_stressMax = -huge(1.0_pReal), &
|
|
|
|
debug_stressMin = huge(1.0_pReal), &
|
|
|
|
debug_jacobianMax = -huge(1.0_pReal), &
|
|
|
|
debug_jacobianMin = huge(1.0_pReal)
|
|
|
|
|
|
|
|
character(len=64), parameter, private :: &
|
2013-10-16 18:34:59 +05:30
|
|
|
debug_CONFIGFILE = 'debug.config' !< name of configuration file
|
2012-03-09 01:55:28 +05:30
|
|
|
|
2012-12-15 23:37:49 +05:30
|
|
|
#ifdef PETSc
|
|
|
|
character(len=1024), parameter, public :: &
|
2013-03-31 18:36:49 +05:30
|
|
|
PETSCDEBUG = ' -snes_view -snes_monitor '
|
2012-12-15 23:37:49 +05:30
|
|
|
#endif
|
2012-03-09 01:55:28 +05:30
|
|
|
public :: debug_init, &
|
|
|
|
debug_reset, &
|
|
|
|
debug_info
|
2008-02-19 18:28:46 +05:30
|
|
|
|
2012-03-09 01:55:28 +05:30
|
|
|
contains
|
2008-02-19 18:28:46 +05:30
|
|
|
|
2009-10-22 14:44:17 +05:30
|
|
|
|
2013-02-11 15:14:17 +05:30
|
|
|
!--------------------------------------------------------------------------------------------------
|
|
|
|
!> @brief reads in parameters from debug.config and allocates arrays
|
|
|
|
!--------------------------------------------------------------------------------------------------
|
2012-03-09 01:55:28 +05:30
|
|
|
subroutine debug_init
|
|
|
|
use, intrinsic :: iso_fortran_env ! to get compiler_version and compiler_options (at least for gfortran 4.6 at the moment)
|
2013-03-31 18:36:49 +05:30
|
|
|
use numerics, only: &
|
|
|
|
nStress, &
|
|
|
|
nState, &
|
|
|
|
nCryst, &
|
|
|
|
nMPstate, &
|
|
|
|
nHomog
|
|
|
|
use IO, only: &
|
2013-06-27 00:49:41 +05:30
|
|
|
IO_read, &
|
2013-03-31 18:36:49 +05:30
|
|
|
IO_error, &
|
|
|
|
IO_open_file_stat, &
|
|
|
|
IO_isBlank, &
|
|
|
|
IO_stringPos, &
|
|
|
|
IO_stringValue, &
|
|
|
|
IO_lc, &
|
|
|
|
IO_floatValue, &
|
|
|
|
IO_intValue, &
|
2013-12-11 22:19:20 +05:30
|
|
|
IO_timeStamp, &
|
|
|
|
IO_EOF
|
2012-03-09 01:55:28 +05:30
|
|
|
|
|
|
|
implicit none
|
2013-12-11 22:19:20 +05:30
|
|
|
integer(pInt), parameter :: FILEUNIT = 300_pInt
|
2012-07-05 15:24:50 +05:30
|
|
|
integer(pInt), parameter :: maxNchunks = 7_pInt
|
2012-03-09 01:55:28 +05:30
|
|
|
|
|
|
|
integer(pInt) :: i, what
|
|
|
|
integer(pInt), dimension(1+2*maxNchunks) :: positions
|
2013-06-27 00:49:41 +05:30
|
|
|
character(len=65536) :: tag
|
|
|
|
character(len=65536) :: line
|
2013-02-11 15:14:17 +05:30
|
|
|
|
2013-04-09 15:38:00 +05:30
|
|
|
write(6,'(/,a)') ' <<<+- debug init -+>>>'
|
|
|
|
write(6,'(a)') ' $Id$'
|
|
|
|
write(6,'(a16,a)') ' Current time : ',IO_timeStamp()
|
2012-02-01 00:48:55 +05:30
|
|
|
#include "compilation_info.f90"
|
2012-03-09 01:55:28 +05:30
|
|
|
|
2012-07-31 19:30:15 +05:30
|
|
|
if (allocated(debug_StressLoopDistribution)) &
|
|
|
|
deallocate(debug_StressLoopDistribution)
|
2012-10-12 23:30:55 +05:30
|
|
|
allocate(debug_StressLoopDistribution(nStress+1,2))
|
2012-07-31 19:30:15 +05:30
|
|
|
debug_StressLoopDistribution = 0_pInt
|
|
|
|
if (allocated(debug_StateLoopDistribution)) &
|
|
|
|
deallocate(debug_StateLoopDistribution)
|
2012-10-12 23:30:55 +05:30
|
|
|
allocate(debug_StateLoopDistribution(nState+1,2))
|
2012-07-31 19:30:15 +05:30
|
|
|
debug_StateLoopDistribution = 0_pInt
|
|
|
|
if (allocated(debug_CrystalliteLoopDistribution)) &
|
|
|
|
deallocate(debug_CrystalliteLoopDistribution)
|
|
|
|
allocate(debug_CrystalliteLoopDistribution(nCryst+1))
|
|
|
|
debug_CrystalliteLoopDistribution = 0_pInt
|
|
|
|
if (allocated(debug_MaterialpointStateLoopDistribution)) &
|
|
|
|
deallocate(debug_MaterialpointStateLoopDistribution)
|
|
|
|
allocate(debug_MaterialpointStateLoopDistribution(nMPstate))
|
|
|
|
debug_MaterialpointStateLoopDistribution = 0_pInt
|
|
|
|
if (allocated(debug_MaterialpointLoopDistribution)) &
|
|
|
|
deallocate(debug_MaterialpointLoopDistribution)
|
|
|
|
allocate(debug_MaterialpointLoopDistribution(nHomog+1))
|
|
|
|
debug_MaterialpointLoopDistribution = 0_pInt
|
2012-03-09 01:55:28 +05:30
|
|
|
|
2013-02-11 15:14:17 +05:30
|
|
|
!--------------------------------------------------------------------------------------------------
|
|
|
|
! try to open the config file
|
2013-06-27 00:49:41 +05:30
|
|
|
|
2013-10-23 16:53:41 +05:30
|
|
|
line = ''
|
2013-12-11 22:19:20 +05:30
|
|
|
fileExists: if(IO_open_file_stat(FILEUNIT,debug_configFile)) then
|
|
|
|
do while (trim(line) /= IO_EOF) ! read thru sections of phase part
|
|
|
|
line = IO_read(FILEUNIT)
|
2012-03-09 01:55:28 +05:30
|
|
|
if (IO_isBlank(line)) cycle ! skip empty lines
|
|
|
|
positions = IO_stringPos(line,maxNchunks)
|
|
|
|
tag = IO_lc(IO_stringValue(line,positions,1_pInt)) ! extract key
|
|
|
|
select case(tag)
|
|
|
|
case ('element','e','el')
|
|
|
|
debug_e = IO_intValue(line,positions,2_pInt)
|
|
|
|
case ('integrationpoint','i','ip')
|
|
|
|
debug_i = IO_intValue(line,positions,2_pInt)
|
|
|
|
case ('grain','g','gr')
|
|
|
|
debug_g = IO_intValue(line,positions,2_pInt)
|
|
|
|
end select
|
|
|
|
|
|
|
|
what = 0_pInt
|
|
|
|
select case(tag)
|
|
|
|
case ('debug')
|
2013-03-31 18:36:49 +05:30
|
|
|
what = debug_DEBUG
|
2012-03-09 01:55:28 +05:30
|
|
|
case ('math')
|
2013-03-31 18:36:49 +05:30
|
|
|
what = debug_MATH
|
2012-03-09 01:55:28 +05:30
|
|
|
case ('fesolving', 'fe')
|
2013-03-31 18:36:49 +05:30
|
|
|
what = debug_FESOLVING
|
2012-03-09 01:55:28 +05:30
|
|
|
case ('mesh')
|
2013-03-31 18:36:49 +05:30
|
|
|
what = debug_MESH
|
2012-03-09 01:55:28 +05:30
|
|
|
case ('material')
|
2013-03-31 18:36:49 +05:30
|
|
|
what = debug_MATERIAL
|
2012-03-09 01:55:28 +05:30
|
|
|
case ('lattice')
|
2013-03-31 18:36:49 +05:30
|
|
|
what = debug_LATTICE
|
2012-03-09 01:55:28 +05:30
|
|
|
case ('constitutive')
|
2013-03-31 18:36:49 +05:30
|
|
|
what = debug_CONSTITUTIVE
|
2012-03-09 01:55:28 +05:30
|
|
|
case ('crystallite')
|
2013-03-31 18:36:49 +05:30
|
|
|
what = debug_CRYSTALLITE
|
2012-03-09 01:55:28 +05:30
|
|
|
case ('homogenization')
|
2013-03-31 18:36:49 +05:30
|
|
|
what = debug_HOMOGENIZATION
|
2012-03-09 01:55:28 +05:30
|
|
|
case ('cpfem')
|
|
|
|
what = debug_CPFEM
|
|
|
|
case ('spectral')
|
2013-03-31 18:36:49 +05:30
|
|
|
what = debug_SPECTRAL
|
2013-04-09 15:38:00 +05:30
|
|
|
case ('marc')
|
2013-03-31 18:36:49 +05:30
|
|
|
what = debug_MARC
|
2012-03-20 23:31:31 +05:30
|
|
|
case ('abaqus')
|
2013-03-31 18:36:49 +05:30
|
|
|
what = debug_ABAQUS
|
2012-03-09 01:55:28 +05:30
|
|
|
case ('all')
|
2013-03-31 18:36:49 +05:30
|
|
|
what = debug_MAXNTYPE + 1_pInt
|
2012-03-09 01:55:28 +05:30
|
|
|
case ('other')
|
2013-03-31 18:36:49 +05:30
|
|
|
what = debug_MAXNTYPE + 2_pInt
|
2012-03-09 01:55:28 +05:30
|
|
|
end select
|
2013-06-27 00:49:41 +05:30
|
|
|
if (what /= 0) then
|
2013-02-08 21:25:53 +05:30
|
|
|
do i = 2_pInt, positions(1)
|
2012-03-09 01:55:28 +05:30
|
|
|
select case(IO_lc(IO_stringValue(line,positions,i)))
|
|
|
|
case('basic')
|
2013-03-31 18:36:49 +05:30
|
|
|
debug_level(what) = ior(debug_level(what), debug_LEVELBASIC)
|
2012-03-09 01:55:28 +05:30
|
|
|
case('extensive')
|
2013-03-31 18:36:49 +05:30
|
|
|
debug_level(what) = ior(debug_level(what), debug_LEVELEXTENSIVE)
|
2012-03-09 01:55:28 +05:30
|
|
|
case('selective')
|
2013-03-31 18:36:49 +05:30
|
|
|
debug_level(what) = ior(debug_level(what), debug_LEVELSELECTIVE)
|
2012-03-09 01:55:28 +05:30
|
|
|
case('restart')
|
2013-03-31 18:36:49 +05:30
|
|
|
debug_level(what) = ior(debug_level(what), debug_SPECTRALRESTART)
|
2012-03-09 01:55:28 +05:30
|
|
|
case('fft','fftw')
|
2013-03-31 18:36:49 +05:30
|
|
|
debug_level(what) = ior(debug_level(what), debug_SPECTRALFFTW)
|
2012-03-09 01:55:28 +05:30
|
|
|
case('divergence')
|
2013-03-31 18:36:49 +05:30
|
|
|
debug_level(what) = ior(debug_level(what), debug_SPECTRALDIVERGENCE)
|
2012-11-28 20:34:05 +05:30
|
|
|
case('rotation')
|
2013-03-31 18:36:49 +05:30
|
|
|
debug_level(what) = ior(debug_level(what), debug_SPECTRALROTATION)
|
2012-12-15 23:37:49 +05:30
|
|
|
case('petsc')
|
2013-03-31 18:36:49 +05:30
|
|
|
debug_level(what) = ior(debug_level(what), debug_SPECTRALPETSC)
|
2012-03-09 01:55:28 +05:30
|
|
|
end select
|
|
|
|
enddo
|
|
|
|
endif
|
|
|
|
enddo
|
2013-12-11 22:19:20 +05:30
|
|
|
close(FILEUNIT)
|
2012-03-09 01:55:28 +05:30
|
|
|
|
2012-07-05 15:24:50 +05:30
|
|
|
do i = 1_pInt, debug_maxNtype
|
|
|
|
if (debug_level(i) == 0) &
|
2013-03-31 18:36:49 +05:30
|
|
|
debug_level(i) = ior(debug_level(i), debug_level(debug_MAXNTYPE + 2_pInt)) ! fill undefined debug types with levels specified by "other"
|
2012-07-05 15:24:50 +05:30
|
|
|
|
2013-10-23 16:53:41 +05:30
|
|
|
debug_level(i) = ior(debug_level(i), debug_level(debug_MAXNTYPE + 1_pInt)) ! fill all debug types with levels specified by "all"
|
2012-03-09 01:55:28 +05:30
|
|
|
enddo
|
2010-09-23 13:31:41 +05:30
|
|
|
|
2013-03-31 18:36:49 +05:30
|
|
|
if (iand(debug_level(debug_debug),debug_LEVELBASIC) /= 0) &
|
2013-02-08 21:25:53 +05:30
|
|
|
write(6,'(a,/)') ' using values from config file'
|
2013-02-11 15:14:17 +05:30
|
|
|
else fileExists
|
2013-03-31 18:36:49 +05:30
|
|
|
if (iand(debug_level(debug_debug),debug_LEVELBASIC) /= 0) &
|
2013-02-11 15:14:17 +05:30
|
|
|
write(6,'(a,/)') ' using standard values'
|
|
|
|
endif fileExists
|
2012-03-09 01:55:28 +05:30
|
|
|
|
2013-02-11 15:14:17 +05:30
|
|
|
!--------------------------------------------------------------------------------------------------
|
|
|
|
! output switched on (debug level for debug must be extensive)
|
2013-03-31 18:36:49 +05:30
|
|
|
if (iand(debug_level(debug_debug),debug_LEVELEXTENSIVE) /= 0) then
|
|
|
|
do i = 1_pInt, debug_MAXNTYPE
|
2012-07-05 15:24:50 +05:30
|
|
|
select case(i)
|
2013-03-31 18:36:49 +05:30
|
|
|
case (debug_DEBUG)
|
2013-04-09 15:38:00 +05:30
|
|
|
tag = ' Debug'
|
2013-03-31 18:36:49 +05:30
|
|
|
case (debug_MATH)
|
2013-04-09 15:38:00 +05:30
|
|
|
tag = ' Math'
|
2013-03-31 18:36:49 +05:30
|
|
|
case (debug_FESOLVING)
|
2013-04-09 15:38:00 +05:30
|
|
|
tag = ' FEsolving'
|
2013-03-31 18:36:49 +05:30
|
|
|
case (debug_MESH)
|
2013-04-09 15:38:00 +05:30
|
|
|
tag = ' Mesh'
|
2013-03-31 18:36:49 +05:30
|
|
|
case (debug_MATERIAL)
|
2013-04-09 15:38:00 +05:30
|
|
|
tag = ' Material'
|
2013-03-31 18:36:49 +05:30
|
|
|
case (debug_LATTICE)
|
2013-04-09 15:38:00 +05:30
|
|
|
tag = ' Lattice'
|
2013-03-31 18:36:49 +05:30
|
|
|
case (debug_CONSTITUTIVE)
|
2013-04-09 15:38:00 +05:30
|
|
|
tag = ' Constitutive'
|
2013-03-31 18:36:49 +05:30
|
|
|
case (debug_CRYSTALLITE)
|
2013-04-09 15:38:00 +05:30
|
|
|
tag = ' Crystallite'
|
2013-03-31 18:36:49 +05:30
|
|
|
case (debug_HOMOGENIZATION)
|
2013-04-09 15:38:00 +05:30
|
|
|
tag = ' Homogenizaiton'
|
2012-07-05 15:24:50 +05:30
|
|
|
case (debug_CPFEM)
|
2013-04-09 15:38:00 +05:30
|
|
|
tag = ' CPFEM'
|
2013-03-31 18:36:49 +05:30
|
|
|
case (debug_SPECTRAL)
|
2013-04-09 15:38:00 +05:30
|
|
|
tag = ' Spectral solver'
|
2013-03-31 18:36:49 +05:30
|
|
|
case (debug_MARC)
|
2013-04-09 15:38:00 +05:30
|
|
|
tag = ' MSC.MARC FEM solver'
|
2013-03-31 18:36:49 +05:30
|
|
|
case (debug_ABAQUS)
|
2013-04-09 15:38:00 +05:30
|
|
|
tag = ' ABAQUS FEM solver'
|
2012-07-05 15:24:50 +05:30
|
|
|
end select
|
|
|
|
|
|
|
|
if(debug_level(i) /= 0) then
|
2013-04-09 15:38:00 +05:30
|
|
|
write(6,'(3a)') ' debug level for ', trim(tag), ':'
|
|
|
|
if(iand(debug_level(i),debug_LEVELBASIC) /= 0) write(6,'(a)') ' basic'
|
|
|
|
if(iand(debug_level(i),debug_LEVELEXTENSIVE) /= 0) write(6,'(a)') ' extensive'
|
2013-03-31 18:36:49 +05:30
|
|
|
if(iand(debug_level(i),debug_LEVELSELECTIVE) /= 0) then
|
2013-04-09 15:38:00 +05:30
|
|
|
write(6,'(a)') ' selective on:'
|
|
|
|
write(6,'(a24,1x,i8)') ' element: ',debug_e
|
|
|
|
write(6,'(a24,1x,i8)') ' ip: ',debug_i
|
|
|
|
write(6,'(a24,1x,i8)') ' grain: ',debug_g
|
2012-03-09 01:55:28 +05:30
|
|
|
endif
|
2013-04-09 15:38:00 +05:30
|
|
|
if(iand(debug_level(i),debug_SPECTRALRESTART) /= 0) write(6,'(a)') ' restart'
|
|
|
|
if(iand(debug_level(i),debug_SPECTRALFFTW) /= 0) write(6,'(a)') ' FFTW'
|
|
|
|
if(iand(debug_level(i),debug_SPECTRALDIVERGENCE)/= 0) write(6,'(a)') ' divergence'
|
|
|
|
if(iand(debug_level(i),debug_SPECTRALROTATION) /= 0) write(6,'(a)') ' rotation'
|
|
|
|
if(iand(debug_level(i),debug_SPECTRALPETSC) /= 0) write(6,'(a)') ' PETSc'
|
2012-03-09 01:55:28 +05:30
|
|
|
endif
|
|
|
|
enddo
|
|
|
|
endif
|
2010-09-23 13:31:41 +05:30
|
|
|
|
2012-03-09 01:55:28 +05:30
|
|
|
end subroutine debug_init
|
2009-06-15 18:41:21 +05:30
|
|
|
|
2013-02-11 15:14:17 +05:30
|
|
|
|
|
|
|
!--------------------------------------------------------------------------------------------------
|
|
|
|
!> @brief resets all debug values
|
|
|
|
!--------------------------------------------------------------------------------------------------
|
2012-03-09 01:55:28 +05:30
|
|
|
subroutine debug_reset
|
2009-05-07 21:57:36 +05:30
|
|
|
|
2012-03-09 01:55:28 +05:30
|
|
|
implicit none
|
2011-03-17 18:43:13 +05:30
|
|
|
|
2013-02-11 15:14:17 +05:30
|
|
|
debug_StressLoopDistribution = 0_pInt
|
2012-03-09 01:55:28 +05:30
|
|
|
debug_StateLoopDistribution = 0_pInt
|
|
|
|
debug_CrystalliteLoopDistribution = 0_pInt
|
|
|
|
debug_MaterialpointStateLoopDistribution = 0_pInt
|
|
|
|
debug_MaterialpointLoopDistribution = 0_pInt
|
|
|
|
debug_cumLpTicks = 0_pLongInt
|
2012-05-16 20:13:26 +05:30
|
|
|
debug_cumDeltaStateTicks = 0_pLongInt
|
2012-03-09 01:55:28 +05:30
|
|
|
debug_cumDotStateTicks = 0_pLongInt
|
|
|
|
debug_cumLpCalls = 0_pInt
|
2012-05-16 20:13:26 +05:30
|
|
|
debug_cumDeltaStateCalls = 0_pInt
|
2012-03-09 01:55:28 +05:30
|
|
|
debug_cumDotStateCalls = 0_pInt
|
|
|
|
debug_stressMaxLocation = 0_pInt
|
|
|
|
debug_stressMinLocation = 0_pInt
|
|
|
|
debug_jacobianMaxLocation = 0_pInt
|
|
|
|
debug_jacobianMinLocation = 0_pInt
|
|
|
|
debug_stressMax = -huge(1.0_pReal)
|
|
|
|
debug_stressMin = huge(1.0_pReal)
|
|
|
|
debug_jacobianMax = -huge(1.0_pReal)
|
|
|
|
debug_jacobianMin = huge(1.0_pReal)
|
2009-05-07 21:57:36 +05:30
|
|
|
|
2012-03-09 01:55:28 +05:30
|
|
|
end subroutine debug_reset
|
2008-02-19 18:28:46 +05:30
|
|
|
|
|
|
|
|
2013-02-11 15:14:17 +05:30
|
|
|
!--------------------------------------------------------------------------------------------------
|
|
|
|
!> @brief writes debug statements to standard out
|
|
|
|
!--------------------------------------------------------------------------------------------------
|
|
|
|
subroutine debug_info
|
|
|
|
use numerics, only: &
|
|
|
|
nStress, &
|
|
|
|
nState, &
|
|
|
|
nCryst, &
|
|
|
|
nMPstate, &
|
|
|
|
nHomog
|
2009-05-07 21:57:36 +05:30
|
|
|
|
2012-03-09 01:55:28 +05:30
|
|
|
implicit none
|
2013-02-11 15:14:17 +05:30
|
|
|
integer(pInt) :: j,integral
|
2012-03-09 01:55:28 +05:30
|
|
|
integer(pLongInt) :: tickrate
|
2012-10-12 23:30:55 +05:30
|
|
|
character(len=1) :: exceed
|
2009-05-07 21:57:36 +05:30
|
|
|
|
2012-03-09 01:55:28 +05:30
|
|
|
call system_clock(count_rate=tickrate)
|
|
|
|
|
|
|
|
!$OMP CRITICAL (write2out)
|
2013-03-31 18:36:49 +05:30
|
|
|
debugOutputCryst: if (iand(debug_level(debug_CRYSTALLITE),debug_LEVELBASIC) /= 0) then
|
2013-02-11 15:14:17 +05:30
|
|
|
write(6,'(/,a,/)') ' DEBUG Info (from previous cycle)'
|
2012-03-09 01:55:28 +05:30
|
|
|
write(6,'(a33,1x,i12)') 'total calls to LpAndItsTangent :',debug_cumLpCalls
|
|
|
|
if (debug_cumLpCalls > 0_pInt) then
|
2013-03-31 18:36:49 +05:30
|
|
|
write(6,'(a33,1x,f12.3)') 'total CPU time/s :',&
|
|
|
|
real(debug_cumLpTicks,pReal)/real(tickrate,pReal)
|
2012-03-09 01:55:28 +05:30
|
|
|
write(6,'(a33,1x,f12.6)') 'avg CPU time/microsecs per call :',&
|
2013-03-31 18:36:49 +05:30
|
|
|
real(debug_cumLpTicks,pReal)*1.0e6_pReal/real(tickrate*debug_cumLpCalls,pReal)
|
2012-03-09 01:55:28 +05:30
|
|
|
endif
|
2013-02-11 15:14:17 +05:30
|
|
|
write(6,'(/,a33,1x,i12)') 'total calls to collectDotState :',debug_cumDotStateCalls
|
2012-03-09 01:55:28 +05:30
|
|
|
if (debug_cumdotStateCalls > 0_pInt) then
|
2013-03-31 18:36:49 +05:30
|
|
|
write(6,'(a33,1x,f12.3)') 'total CPU time/s :',&
|
|
|
|
real(debug_cumDotStateTicks,pReal)/real(tickrate,pReal)
|
2012-03-09 01:55:28 +05:30
|
|
|
write(6,'(a33,1x,f12.6)') 'avg CPU time/microsecs per call :',&
|
2013-03-31 18:36:49 +05:30
|
|
|
real(debug_cumDotStateTicks,pReal)*1.0e6_pReal/real(tickrate*debug_cumDotStateCalls,pReal)
|
2012-03-09 01:55:28 +05:30
|
|
|
endif
|
2013-02-11 15:14:17 +05:30
|
|
|
write(6,'(/,a33,1x,i12)') 'total calls to collectDeltaState:',debug_cumDeltaStateCalls
|
2012-05-16 20:13:26 +05:30
|
|
|
if (debug_cumDeltaStateCalls > 0_pInt) then
|
2013-03-31 18:36:49 +05:30
|
|
|
write(6,'(a33,1x,f12.3)') 'total CPU time/s :',&
|
|
|
|
real(debug_cumDeltaStateTicks,pReal)/real(tickrate,pReal)
|
2012-05-16 20:13:26 +05:30
|
|
|
write(6,'(a33,1x,f12.6)') 'avg CPU time/microsecs per call :',&
|
2013-03-31 18:36:49 +05:30
|
|
|
real(debug_cumDeltaStateTicks,pReal)*1.0e6_pReal/real(tickrate*debug_cumDeltaStateCalls,pReal)
|
2012-05-16 20:13:26 +05:30
|
|
|
endif
|
2012-03-09 01:55:28 +05:30
|
|
|
|
|
|
|
integral = 0_pInt
|
2013-02-11 15:14:17 +05:30
|
|
|
write(6,'(3/,a)') 'distribution_StressLoop : stress stiffness'
|
|
|
|
do j=1_pInt,nStress+1_pInt
|
|
|
|
if (any(debug_StressLoopDistribution(j,:) /= 0_pInt )) then
|
|
|
|
integral = integral + j*(debug_StressLoopDistribution(j,1) + debug_StressLoopDistribution(j,2))
|
2012-10-12 23:30:55 +05:30
|
|
|
exceed = ' '
|
2013-02-11 15:14:17 +05:30
|
|
|
if (j > nStress) exceed = '+' ! last entry gets "+"
|
|
|
|
write(6,'(i25,a1,i10,1x,i10)') min(nStress,j),exceed,debug_StressLoopDistribution(j,1),&
|
|
|
|
debug_StressLoopDistribution(j,2)
|
2012-03-09 01:55:28 +05:30
|
|
|
endif
|
|
|
|
enddo
|
2012-11-06 18:05:45 +05:30
|
|
|
write(6,'(a15,i10,2(1x,i10))') ' total',integral,sum(debug_StressLoopDistribution(:,1)), &
|
|
|
|
sum(debug_StressLoopDistribution(:,2))
|
2012-03-09 01:55:28 +05:30
|
|
|
|
|
|
|
integral = 0_pInt
|
2013-02-11 15:14:17 +05:30
|
|
|
write(6,'(2/,a)') 'distribution_CrystalliteStateLoop :'
|
|
|
|
do j=1_pInt,nState+1_pInt
|
|
|
|
if (any(debug_StateLoopDistribution(j,:) /= 0)) then
|
|
|
|
integral = integral + j*(debug_StateLoopDistribution(j,1) + debug_StateLoopDistribution(j,2))
|
2012-10-12 23:30:55 +05:30
|
|
|
exceed = ' '
|
2013-02-11 15:14:17 +05:30
|
|
|
if (j > nState) exceed = '+' ! last entry gets "+"
|
|
|
|
write(6,'(i25,a1,i10,1x,i10)') min(nState,j),exceed,debug_StateLoopDistribution(j,1),&
|
|
|
|
debug_StateLoopDistribution(j,2)
|
2012-03-09 01:55:28 +05:30
|
|
|
endif
|
|
|
|
enddo
|
2012-11-06 18:05:45 +05:30
|
|
|
write(6,'(a15,i10,2(1x,i10))') ' total',integral,sum(debug_StateLoopDistribution(:,1)), &
|
|
|
|
sum(debug_StateLoopDistribution(:,2))
|
2011-03-17 18:43:13 +05:30
|
|
|
|
2012-03-09 01:55:28 +05:30
|
|
|
integral = 0_pInt
|
2013-02-11 15:14:17 +05:30
|
|
|
write(6,'(2/,a)') 'distribution_CrystalliteCutbackLoop :'
|
|
|
|
do j=1_pInt,nCryst+1_pInt
|
|
|
|
if (debug_CrystalliteLoopDistribution(j) /= 0) then
|
|
|
|
integral = integral + j*debug_CrystalliteLoopDistribution(j)
|
2012-10-12 23:30:55 +05:30
|
|
|
exceed = ' '
|
2013-02-11 15:14:17 +05:30
|
|
|
if (j > nCryst) exceed = '+'
|
|
|
|
write(6,'(i25,a1,i10)') min(nCryst,j),exceed,debug_CrystalliteLoopDistribution(j)
|
2012-03-09 01:55:28 +05:30
|
|
|
endif
|
|
|
|
enddo
|
|
|
|
write(6,'(a15,i10,1x,i10)') ' total',integral,sum(debug_CrystalliteLoopDistribution)
|
2013-02-11 15:14:17 +05:30
|
|
|
endif debugOutputCryst
|
2011-03-21 16:01:17 +05:30
|
|
|
|
2013-03-31 18:36:49 +05:30
|
|
|
debugOutputHomog: if (iand(debug_level(debug_HOMOGENIZATION),debug_LEVELBASIC) /= 0) then
|
2012-03-09 01:55:28 +05:30
|
|
|
integral = 0_pInt
|
2013-02-11 15:14:17 +05:30
|
|
|
write(6,'(2/,a)') 'distribution_MaterialpointStateLoop :'
|
|
|
|
do j=1_pInt,nMPstate
|
|
|
|
if (debug_MaterialpointStateLoopDistribution(j) /= 0) then
|
|
|
|
integral = integral + j*debug_MaterialpointStateLoopDistribution(j)
|
|
|
|
write(6,'(i25,1x,i10)') j,debug_MaterialpointStateLoopDistribution(j)
|
2012-03-09 01:55:28 +05:30
|
|
|
endif
|
|
|
|
enddo
|
|
|
|
write(6,'(a15,i10,1x,i10)') ' total',integral,sum(debug_MaterialpointStateLoopDistribution)
|
|
|
|
|
|
|
|
integral = 0_pInt
|
2013-02-11 15:14:17 +05:30
|
|
|
write(6,'(2/,a)') 'distribution_MaterialpointCutbackLoop :'
|
|
|
|
do j=1_pInt,nHomog+1_pInt
|
|
|
|
if (debug_MaterialpointLoopDistribution(j) /= 0) then
|
|
|
|
integral = integral + j*debug_MaterialpointLoopDistribution(j)
|
2012-10-12 23:30:55 +05:30
|
|
|
exceed = ' '
|
2013-02-11 15:14:17 +05:30
|
|
|
if (j > nHomog) exceed = '+'
|
|
|
|
write(6,'(i25,a1,i10)') min(nHomog,j),exceed,debug_MaterialpointLoopDistribution(j)
|
2012-03-09 01:55:28 +05:30
|
|
|
endif
|
|
|
|
enddo
|
|
|
|
write(6,'(a15,i10,1x,i10)') ' total',integral,sum(debug_MaterialpointLoopDistribution)
|
2013-02-11 15:14:17 +05:30
|
|
|
endif debugOutputHomog
|
2011-03-21 16:01:17 +05:30
|
|
|
|
2013-03-31 18:36:49 +05:30
|
|
|
debugOutputCPFEM: if (iand(debug_level(debug_CPFEM),debug_LEVELBASIC) /= 0) then
|
2013-02-11 15:14:17 +05:30
|
|
|
write(6,'(2/,a,/)') ' Extreme values of returned stress and jacobian'
|
2012-03-09 01:55:28 +05:30
|
|
|
write(6,'(a39)') ' value el ip'
|
2013-02-11 15:14:17 +05:30
|
|
|
write(6,'(a14,1x,e12.3,1x,i6,1x,i4)') ' stress min :', debug_stressMin, debug_stressMinLocation
|
|
|
|
write(6,'(a14,1x,e12.3,1x,i6,1x,i4)') ' max :', debug_stressMax, debug_stressMaxLocation
|
|
|
|
write(6,'(a14,1x,e12.3,1x,i6,1x,i4)') ' jacobian min :', debug_jacobianMin, debug_jacobianMinLocation
|
|
|
|
write(6,'(a14,1x,e12.3,1x,i6,1x,i4,/)') ' max :', debug_jacobianMax, debug_jacobianMaxLocation
|
|
|
|
endif debugOutputCPFEM
|
2012-03-09 01:55:28 +05:30
|
|
|
!$OMP END CRITICAL (write2out)
|
|
|
|
|
|
|
|
end subroutine debug_info
|
2008-01-11 00:23:57 +05:30
|
|
|
|
2012-03-09 01:55:28 +05:30
|
|
|
end module debug
|