doxygen comments

This commit is contained in:
Martin Diehl 2013-02-21 23:08:36 +00:00
parent 1f86e098ba
commit 42b96354db
1 changed files with 2259 additions and 2321 deletions

View File

@ -16,106 +16,111 @@
! You should have received a copy of the GNU General Public License
! along with DAMASK. If not, see <http://www.gnu.org/licenses/>.
!
!##############################################################
!* $Id$
!***************************************
!* Module: CRYSTALLITE *
!***************************************
!* contains: *
!* - _init *
!* - materialpoint_stressAndItsTangent *
!* - _partitionDeformation *
!* - _updateState *
!* - _stressAndItsTangent *
!* - _postResults *
!***************************************
!--------------------------------------------------------------------------------------------------
! $Id$
!--------------------------------------------------------------------------------------------------
!> @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
!> @brief crystallite state integration functions and reporting of results
!--------------------------------------------------------------------------------------------------
module crystallite
use prec, only: pReal, pInt
implicit none
private :: crystallite_integrateStateFPI, &
crystallite_integrateStateEuler, &
crystallite_integrateStateAdaptiveEuler, &
crystallite_integrateStateRK4, &
crystallite_integrateStateRKCK45, &
crystallite_integrateStress, &
crystallite_stateJump
external :: dgesv
! ****************************************************************
! *** General variables for the crystallite calculation ***
! ****************************************************************
integer(pInt) crystallite_maxSizePostResults
integer(pInt), dimension(:), allocatable :: crystallite_sizePostResults
integer(pInt), dimension(:,:), allocatable :: crystallite_sizePostResult
character(len=64), dimension(:,:), allocatable :: crystallite_output !< name of each post result output
integer(pInt), dimension (:,:,:), allocatable :: &
private
character(len=64), dimension(:,:), allocatable, private :: &
crystallite_output !< name of each post result output
integer(pInt), public, protected :: &
crystallite_maxSizePostResults
integer(pInt), dimension(:), allocatable, public, protected :: &
crystallite_sizePostResults
integer(pInt), dimension(:,:), allocatable, private :: &
crystallite_sizePostResult
integer(pInt), dimension(:,:,:), allocatable, private :: &
crystallite_symmetryID !< crystallographic symmetry 1=cubic 2=hexagonal, needed in all orientation calcs
real(pReal), dimension (:,:,:), allocatable :: &
real(pReal), dimension (:,:,:), allocatable, public :: &
crystallite_dt, & !< requested time increment of each grain
crystallite_Temperature, & !< Temp of each grain
crystallite_partionedTemperature0 !< Temp of each grain at start of homog inc
real(pReal), dimension (:,:,:), allocatable, private :: &
crystallite_subdt, & !< substepped time increment of each grain
crystallite_subFrac, & !< already calculated fraction of increment
crystallite_subStep, & !< size of next integration step
crystallite_Temperature, & !< Temp of each grain
crystallite_partionedTemperature0, & !< Temp of each grain at start of homog inc
crystallite_subTemperature0, & !< Temp of each grain at start of crystallite inc
crystallite_dotTemperature !< evolution of Temperature of each grain
real(pReal), dimension (:,:,:,:), allocatable :: &
real(pReal), dimension (:,:,:,:), allocatable, public :: &
crystallite_Tstar_v, & !< current 2nd Piola-Kirchhoff stress vector (end of converged time step)
crystallite_Tstar0_v, & !< 2nd Piola-Kirchhoff stress vector at start of FE inc
crystallite_partionedTstar0_v, & !< 2nd Piola-Kirchhoff stress vector at start of homog inc
crystallite_partionedTstar0_v !< 2nd Piola-Kirchhoff stress vector at start of homog inc
real(pReal), dimension (:,:,:,:), allocatable, private :: &
crystallite_subTstar0_v, & !< 2nd Piola-Kirchhoff stress vector at start of crystallite inc
crystallite_orientation, & !< orientation as quaternion
crystallite_orientation0, & !< initial orientation as quaternion
crystallite_rotation !< grain rotation away from initial orientation as axis-angle (in degrees) in crystal reference frame
real(pReal), dimension (:,:,:,:,:), allocatable :: &
crystallite_Fe, & !< current "elastic" def grad (end of converged time step)
crystallite_subFe0,& !< "elastic" def grad at start of crystallite inc
real(pReal), dimension (:,:,:,:,:), allocatable, public :: &
crystallite_Fp, & !< current plastic def grad (end of converged time step)
crystallite_invFp, & !< inverse of current plastic def grad (end of converged time step)
crystallite_Fp0, & !< plastic def grad at start of FE inc
crystallite_partionedFp0,& !< plastic def grad at start of homog inc
crystallite_subFp0,& !< plastic def grad at start of crystallite inc
crystallite_F0, & !< def grad at start of FE inc
crystallite_partionedF, & !< def grad to be reached at end of homog inc
crystallite_partionedF0, & !< def grad at start of homog inc
crystallite_subF, & !< def grad to be reached at end of crystallite inc
crystallite_subF0, & !< def grad at start of crystallite inc
crystallite_Lp, & !< current plastic velocitiy grad (end of converged time step)
crystallite_Lp0, & !< plastic velocitiy grad at start of FE inc
crystallite_partionedLp0,& !< plastic velocity grad at start of homog inc
crystallite_P !< 1st Piola-Kirchhoff stress per grain
real(pReal), dimension (:,:,:,:,:), allocatable, private :: &
crystallite_Fe, & !< current "elastic" def grad (end of converged time step)
crystallite_subFe0,& !< "elastic" def grad at start of crystallite inc
crystallite_invFp, & !< inverse of current plastic def grad (end of converged time step)
crystallite_subFp0,& !< plastic def grad at start of crystallite inc
crystallite_subF, & !< def grad to be reached at end of crystallite inc
crystallite_subF0, & !< def grad at start of crystallite inc
crystallite_subLp0,& !< plastic velocity grad at start of crystallite inc
crystallite_P, & !< 1st Piola-Kirchhoff stress per grain
crystallite_disorientation !< disorientation between two neighboring ips (only calculated for single grain IPs)
real(pReal), dimension (:,:,:,:,:,:,:), allocatable :: &
real(pReal), dimension (:,:,:,:,:,:,:), allocatable, public :: &
crystallite_dPdF, & !< current individual dPdF per grain (end of converged time step)
crystallite_dPdF0, & !< individual dPdF per grain at start of FE inc
crystallite_partioneddPdF0, & !< individual dPdF per grain at start of homog inc
crystallite_partioneddPdF0 !< individual dPdF per grain at start of homog inc
real(pReal), dimension (:,:,:,:,:,:,:), allocatable, private :: &
crystallite_fallbackdPdF !< dPdF fallback for non-converged grains (elastic prediction)
logical, dimension (:,:,:), allocatable :: &
crystallite_localPlasticity, & !< indicates this grain to have purely local constitutive law
crystallite_requested, & !< flag to request crystallite calculation
crystallite_todo, & !< flag to indicate need for further computation
logical, dimension (:,:,:), allocatable, public :: &
crystallite_requested !< flag to request crystallite calculation
logical, dimension (:,:,:), allocatable, public, protected :: &
crystallite_converged !< convergence flag
logical, dimension (:,:), allocatable :: &
logical, dimension (:,:,:), allocatable, private :: &
crystallite_localPlasticity, & !< indicates this grain to have purely local constitutive law
crystallite_todo !< flag to indicate need for further computation
logical, dimension (:,:), allocatable, private :: &
crystallite_clearToWindForward, &
crystallite_clearToCutback, &
crystallite_syncSubFrac, &
crystallite_syncSubFracCompleted, &
crystallite_neighborEnforcedCutback
public :: &
crystallite_init, &
crystallite_stressAndItsTangent, &
crystallite_orientations, &
crystallite_postResults
private :: &
crystallite_integrateStateFPI, &
crystallite_integrateStateEuler, &
crystallite_integrateStateAdaptiveEuler, &
crystallite_integrateStateRK4, &
crystallite_integrateStateRKCK45, &
crystallite_integrateStress, &
crystallite_stateJump
contains
!********************************************************************
! allocate and initialize per grain variables
!********************************************************************
!--------------------------------------------------------------------------------------------------
!> @brief allocates and initialize per grain variables
!--------------------------------------------------------------------------------------------------
subroutine crystallite_init(Temperature)
!*** variables and functions from other modules ***!
use, intrinsic :: iso_fortran_env ! to get compiler_version and compiler_options (at least for gfortran 4.6 at the moment)
use debug, only: debug_info, &
debug_reset, &
@ -149,12 +154,10 @@ subroutine crystallite_init(Temperature)
constitutive_nonlocal_structureName
implicit none
real(pReal), intent(in) :: Temperature
integer(pInt), parameter :: myFile = 200_pInt, &
maxNchunks = 2_pInt
!*** input variables ***!
real(pReal) Temperature
!*** local variables ***!
integer(pInt), dimension(1+2*maxNchunks) :: positions
integer(pInt) g, & ! grain number
@ -175,13 +178,9 @@ subroutine crystallite_init(Temperature)
character(len=64) tag
character(len=1024) line
!$OMP CRITICAL (write2out)
write(6,*)
write(6,*) '<<<+- crystallite init -+>>>'
write(6,*) '$Id$'
write(6,'(/,a)') ' <<<+- crystallite init -+>>>'
write(6,'(a)') ' $Id$'
#include "compilation_info.f90"
!$OMP END CRITICAL (write2out)
gMax = homogenization_maxNgrains
@ -384,9 +383,8 @@ crystallite_orientation0 = crystallite_orientation ! Store initial o
call crystallite_stressAndItsTangent(.true.,.false.) ! request elastic answers
crystallite_fallbackdPdF = crystallite_dPdF ! use initial elastic stiffness as fallback
! *** Output to MARC output file ***
! *** Output ***
if (iand(debug_level(debug_crystallite), debug_levelBasic) /= 0_pInt) then
!$OMP CRITICAL (write2out)
write(6,'(a35,1x,7(i8,1x))') 'crystallite_Temperature: ', shape(crystallite_Temperature)
write(6,'(a35,1x,7(i8,1x))') 'crystallite_dotTemperature: ', shape(crystallite_dotTemperature)
write(6,'(a35,1x,7(i8,1x))') 'crystallite_Fe: ', shape(crystallite_Fe)
@ -433,7 +431,6 @@ if (iand(debug_level(debug_crystallite), debug_levelBasic) /= 0_pInt) then
write(6,*)
write(6,*) 'Number of nonlocal grains: ',count(.not. crystallite_localPlasticity)
flush(6)
!$OMP END CRITICAL (write2out)
endif
call debug_info
@ -442,13 +439,10 @@ endif
end subroutine crystallite_init
!********************************************************************
! calculate stress (P) and tangent (dPdF) for crystallites
!********************************************************************
!--------------------------------------------------------------------------------------------------
!> @brief calculate stress (P) and tangent (dPdF) for crystallites
!--------------------------------------------------------------------------------------------------
subroutine crystallite_stressAndItsTangent(updateJaco,rate_sensitivity)
!*** variables and functions from other modules ***!
use numerics, only: subStepMinCryst, &
subStepSizeCryst, &
stepIncreaseCryst, &
@ -502,9 +496,7 @@ use constitutive, only: constitutive_sizeState, &
implicit none
!*** input variables ***!
logical, intent(in) :: updateJaco, rate_sensitivity ! flag indicating wehther we want to update the Jacobian (stiffness) or not
!*** local variables ***!
real(pReal) myPert, & ! perturbation with correct sign
formerSubStep, &
subFracIntermediate
@ -1237,14 +1229,10 @@ endif
end subroutine crystallite_stressAndItsTangent
!********************************************************************
! integrate stress, state and Temperature with
! 4h order explicit Runge Kutta method
!********************************************************************
!--------------------------------------------------------------------------------------------------
!> @brief integrate stress, state and Temperature with 4th order explicit Runge Kutta method
!--------------------------------------------------------------------------------------------------
subroutine crystallite_integrateStateRK4(gg,ii,ee)
!*** variables and functions from other modules ***!
use prec, only: pInt, &
pReal
use numerics, only: numerics_integrationMode
@ -1512,15 +1500,11 @@ endif
end subroutine crystallite_integrateStateRK4
!********************************************************************
! integrate stress, state and Temperature with
! 5th order Runge-Kutta Cash-Karp method with adaptive step size
! (use 5th order solution to advance = "local extrapolation")
!********************************************************************
!--------------------------------------------------------------------------------------------------
!> @brief integrate stress, state and Temperature with 5th order Runge-Kutta Cash-Karp method with
!> adaptive step size (use 5th order solution to advance = "local extrapolation")
!--------------------------------------------------------------------------------------------------
subroutine crystallite_integrateStateRKCK45(gg,ii,ee)
!*** variables and functions from other modules ***!
use debug, only: debug_level, &
debug_crystallite, &
debug_levelBasic, &
@ -2035,14 +2019,10 @@ endif
end subroutine crystallite_integrateStateRKCK45
!********************************************************************
! integrate stress, state and Temperature with
! 1nd order Euler method with adaptive step size
!********************************************************************
!--------------------------------------------------------------------------------------------------
!> @brief integrate stress, state and Temperature with 1st order Euler method with adaptive step size
!--------------------------------------------------------------------------------------------------
subroutine crystallite_integrateStateAdaptiveEuler(gg,ii,ee)
!*** variables and functions from other modules ***!
use debug, only: debug_level, &
debug_crystallite, &
debug_levelBasic, &
@ -2074,7 +2054,6 @@ use constitutive, only: constitutive_sizeDotState, &
implicit none
!*** input variables ***!
integer(pInt), optional, intent(in):: ee, & ! element index
ii, & ! integration point index
@ -2355,14 +2334,10 @@ endif
end subroutine crystallite_integrateStateAdaptiveEuler
!********************************************************************
! integrate stress, state and Temperature with
! 1st order explicit Euler method
!********************************************************************
!--------------------------------------------------------------------------------------------------
!> @brief integrate stress, state and Temperature with 1st order explicit Euler method
!--------------------------------------------------------------------------------------------------
subroutine crystallite_integrateStateEuler(gg,ii,ee)
!*** variables and functions from other modules ***!
use numerics, only: numerics_integrationMode, &
numerics_timeSyncing
use debug, only: debug_level, &
@ -2563,15 +2538,11 @@ endif
end subroutine crystallite_integrateStateEuler
!********************************************************************
! integrate stress, state and Temperature with
! adaptive 1st order explicit Euler method
! using Fixed Point Iteration to adapt the stepsize
!********************************************************************
!--------------------------------------------------------------------------------------------------
!> @brief integrate stress, state and Temperature with adaptive 1st order explicit Euler method
!> using Fixed Point Iteration to adapt the stepsize
!--------------------------------------------------------------------------------------------------
subroutine crystallite_integrateStateFPI(gg,ii,ee)
!*** variables and functions from other modules ***!
use debug, only: debug_e, &
debug_i, &
debug_g, &
@ -2603,14 +2574,10 @@ use constitutive, only: constitutive_subState0, &
constitutive_aTolState
implicit none
!*** input variables ***!
integer(pInt), optional, intent(in):: ee, & ! element index
ii, & ! integration point index
gg ! grain index
!*** output variables ***!
!*** local variables ***!
integer(pInt) NiterationState, & ! number of iterations in state loop
e, & ! element index in element loop
@ -2911,18 +2878,13 @@ do while (any(crystallite_todo .and. .not. crystallite_converged) .and. Niterati
enddo ! crystallite convergence loop
end subroutine crystallite_integrateStateFPI
!***********************************************************
!* calculates a jump in the state according to the current *
!* state and the current stress *
!***********************************************************
!--------------------------------------------------------------------------------------------------
!> @brief calculates a jump in the state according to the current state and the current stress
!--------------------------------------------------------------------------------------------------
function crystallite_stateJump(g,i,e)
!*** variables and functions from other modules ***!
use debug, only: debug_level, &
debug_crystallite, &
debug_levelExtensive, &
@ -2942,8 +2904,6 @@ use constitutive, only: constitutive_sizeDotState, &
constitutive_microstructure
implicit none
!*** input variables ***!
integer(pInt), intent(in):: e, & ! element index
i, & ! integration point index
g ! grain index
@ -2987,19 +2947,16 @@ end function crystallite_stateJump
!***********************************************************************
!*** calculation of stress (P) with time integration ***
!*** based on a residuum in Lp and intermediate ***
!*** acceleration of the Newton-Raphson correction ***
!***********************************************************************
!--------------------------------------------------------------------------------------------------
!> @brief calculation of stress (P) with time integration based on a residuum in Lp and
!> intermediate acceleration of the Newton-Raphson correction
!--------------------------------------------------------------------------------------------------
function crystallite_integrateStress(&
g,& ! grain number
i,& ! integration point number
e,& ! element number
timeFraction &
)
use prec, only: pLongInt
use numerics, only: nStress, &
aTol_crystalliteStress, &
@ -3040,8 +2997,6 @@ use math, only: math_mul33x33, &
math_Plain9to33
implicit none
!*** input variables ***!
integer(pInt), intent(in):: e, & ! element index
i, & ! integration point index
g ! grain index
@ -3094,7 +3049,7 @@ integer(pLongInt) tick, &
tock, &
tickrate, &
maxticks
external :: dgesv
!* be pessimistic
@ -3349,14 +3304,10 @@ endif
end function crystallite_integrateStress
!********************************************************************
! calculates orientations and disorientations (in case of single grain ips)
!********************************************************************
!--------------------------------------------------------------------------------------------------
!> @brief calculates orientations and disorientations (in case of single grain ips)
!--------------------------------------------------------------------------------------------------
subroutine crystallite_orientations
!*** variables and functions from other modules ***!
use math, only: math_pDecomposition, &
math_RtoQ, &
math_qDisorientation, &
@ -3376,12 +3327,6 @@ use constitutive_nonlocal, only: constitutive_nonlocal_structure, &
constitutive_nonlocal_updateCompatibility
implicit none
!*** input variables ***!
!*** output variables ***!
!*** local variables ***!
integer(pInt) e, & ! element index
i, & ! integration point index
g, & ! grain index
@ -3475,17 +3420,15 @@ end subroutine crystallite_orientations
!********************************************************************
! return results of particular grain
!********************************************************************
!--------------------------------------------------------------------------------------------------
!> @brief return results of particular grain
!--------------------------------------------------------------------------------------------------
function crystallite_postResults(&
dt,& ! time increment
g,& ! grain number
i,& ! integration point number
e & ! element number
)
!*** variables and functions from other modules ***!
use math, only: math_qToEuler, &
math_qToAxisAngle, &
math_mul33x33, &
@ -3508,8 +3451,6 @@ function crystallite_postResults(&
constitutive_homogenizedC
implicit none
!*** input variables ***!
integer(pInt), intent(in):: e, & ! element index
i, & ! integration point index
g ! grain index
@ -3622,7 +3563,4 @@ function crystallite_postResults(&
end function crystallite_postResults
END MODULE
!##############################################################
end module crystallite