cleaning: comments added

This commit is contained in:
Sharan Roongta 2020-06-17 17:19:21 +02:00
parent f6355d199a
commit d4d29ff376
9 changed files with 35 additions and 34 deletions

View File

@ -126,7 +126,7 @@ subroutine CPFEM_general(mode, ffn, ffn1, temperature_inp, dt, elFE, ip, cauchyS
integer(pInt) elCP, & ! crystal plasticity element number integer(pInt) elCP, & ! crystal plasticity element number
i, j, k, l, m, n, ph, homog, mySource, & i, j, k, l, m, n, ph, homog, mySource, &
iJacoStiffness iJacoStiffness !< frequency of stiffness update
logical updateJaco ! flag indicating if Jacobian has to be updated logical updateJaco ! flag indicating if Jacobian has to be updated
real(pReal), parameter :: ODD_STRESS = 1e15_pReal, & !< return value for stress if terminallyIll real(pReal), parameter :: ODD_STRESS = 1e15_pReal, & !< return value for stress if terminallyIll
@ -134,14 +134,13 @@ subroutine CPFEM_general(mode, ffn, ffn1, temperature_inp, dt, elFE, ip, cauchyS
class(tNode), pointer :: & class(tNode), pointer :: &
num_commercialFEM num_commercialFEM
!------------------------------------------------------------------------------
! read numerical parameters and do sanity check
num_commercialFEM => numerics_root%get('commercialFEM',defaultVal=emptyDict) num_commercialFEM => numerics_root%get('commercialFEM',defaultVal=emptyDict)
iJacoStiffness = num_commercialFEM%get_asInt('ijacostiffness',defaultVal=1) iJacoStiffness = num_commercialFEM%get_asInt('ijacostiffness',defaultVal=1)
!----------------------------------------------------------------------
! sanity check
if (iJacoStiffness < 1) call IO_error(301,ext_msg='iJacoStiffness') if (iJacoStiffness < 1) call IO_error(301,ext_msg='iJacoStiffness')
!---------------------------------------------------------------------- !------------------------------------------------------------------------------
elCP = mesh_FEM2DAMASK_elem(elFE) elCP = mesh_FEM2DAMASK_elem(elFE)

View File

@ -4,9 +4,11 @@
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
module damage_local module damage_local
use prec use prec
use IO
use material use material
use config use config
use numerics use numerics
use YAML_types
use source_damage_isoBrittle use source_damage_isoBrittle
use source_damage_isoDuctile use source_damage_isoDuctile
use source_damage_anisoBrittle use source_damage_anisoBrittle
@ -83,8 +85,15 @@ function damage_local_updateState(subdt, ip, el)
homog, & homog, &
offset offset
real(pReal) :: & real(pReal) :: &
phi, phiDot, dPhiDot_dPhi phi, phiDot, dPhiDot_dPhi, &
residualStiffness !< non-zero residual damage
class(tNode), pointer :: &
num_generic
num_generic => numerics_root%get('generic',defaultVal=emptyDict)
residualStiffness = num_generic%get_asFloat('residualStiffness', defaultVal=1.0e-6_pReal)
if (residualStiffness < 0.0_pReal) call IO_error(301,ext_msg='residualStiffness')
homog = material_homogenizationAt(el) homog = material_homogenizationAt(el)
offset = material_homogenizationMemberAt(ip,el) offset = material_homogenizationMemberAt(ip,el)
phi = damageState(homog)%subState0(1,offset) phi = damageState(homog)%subState0(1,offset)

View File

@ -11,10 +11,12 @@ module grid_damage_spectral
use PETScsnes use PETScsnes
use prec use prec
use IO
use spectral_utilities use spectral_utilities
use discretization_grid use discretization_grid
use damage_nonlocal use damage_nonlocal
use numerics use numerics
use YAML_types
implicit none implicit none
private private
@ -236,8 +238,15 @@ subroutine formResidual(in,x_scal,f_scal,dummy,ierr)
PetscObject :: dummy PetscObject :: dummy
PetscErrorCode :: ierr PetscErrorCode :: ierr
integer :: i, j, k, cell integer :: i, j, k, cell
real(pReal) :: phiDot, dPhiDot_dPhi, mobility real(pReal) :: phiDot, dPhiDot_dPhi, mobility, &
residualStiffness !< non-zero residual damage
class(tNode), pointer :: &
num_generic
num_generic => numerics_root%get('generic',defaultVal=emptyDict)
residualStiffness = num_generic%get_asFloat('residualStiffness', defaultVal=1.0e-6_pReal)
if (residualStiffness < 0.0_pReal) call IO_error(301,ext_msg='residualStiffness')
phi_current = x_scal phi_current = x_scal
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
! evaluate polarization field ! evaluate polarization field

View File

@ -508,8 +508,8 @@ subroutine formResidual(in, FandF_tau, &
class(tNode), pointer :: & class(tNode), pointer :: &
num_grid num_grid
real(pReal) :: & real(pReal) :: &
polarAlpha, & polarAlpha, & !< polarization scheme parameter 0.0 < alpha < 2.0. alpha = 1.0 ==> AL scheme, alpha = 2.0 ==> accelerated scheme
polarBeta polarBeta !< polarization scheme parameter 0.0 < beta < 2.0. beta = 1.0 ==> AL scheme, beta = 2.0 ==> accelerated scheme
integer :: & integer :: &
i, j, k, e i, j, k, e

View File

@ -90,7 +90,9 @@ contains
subroutine math_init subroutine math_init
real(pReal), dimension(4) :: randTest real(pReal), dimension(4) :: randTest
integer :: randSize,randomSeed integer :: &
randSize, &
randomSeed !< fixed seeding for pseudo-random number generator, Default 0: use random seed
integer, dimension(:), allocatable :: randInit integer, dimension(:), allocatable :: randInit
class(tNode), pointer :: & class(tNode), pointer :: &
num_generic num_generic

View File

@ -104,7 +104,7 @@ subroutine utilities_init
character(len=pStringLen) :: petsc_optionsOrder character(len=pStringLen) :: petsc_optionsOrder
class(tNode), pointer :: & class(tNode), pointer :: &
numerics_mesh numerics_mesh
integer :: structOrder integer :: structOrder !< order of displacement shape functions
PetscErrorCode :: ierr PetscErrorCode :: ierr

View File

@ -87,7 +87,7 @@ subroutine discretization_mesh_init(restart)
class(tNode), pointer :: & class(tNode), pointer :: &
numerics_mesh numerics_mesh
integer :: integrationOrder integer :: integrationOrder !< order of quadrature rule required
numerics_mesh => numerics_root%get('mesh',defaultVal=emptyDict) numerics_mesh => numerics_root%get('mesh',defaultVal=emptyDict)
integrationOrder = numerics_mesh%get_asInt('integrationorder',defaultVal = 2) integrationOrder = numerics_mesh%get_asInt('integrationorder',defaultVal = 2)

View File

@ -97,7 +97,7 @@ subroutine FEM_mech_init(fieldBC)
class(tNode), pointer :: & class(tNode), pointer :: &
numerics_mesh numerics_mesh
integer :: integrationOrder integer :: integrationOrder !< order of quadrature rule required
write(6,'(/,a)') ' <<<+- FEM_mech init -+>>>'; flush(6) write(6,'(/,a)') ' <<<+- FEM_mech init -+>>>'; flush(6)

View File

@ -25,8 +25,6 @@ module numerics
worldsize = 1 !< MPI worldsize (/=1 for MPI simulations only) worldsize = 1 !< MPI worldsize (/=1 for MPI simulations only)
integer(4), protected, public :: & integer(4), protected, public :: &
DAMASK_NumThreadsInt = 0 !< value stored in environment variable DAMASK_NUM_THREADS, set to zero if no OpenMP directive DAMASK_NumThreadsInt = 0 !< value stored in environment variable DAMASK_NUM_THREADS, set to zero if no OpenMP directive
real(pReal), protected, public :: &
residualStiffness = 1.0e-6_pReal !< non-zero residual damage
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
! field parameters: ! field parameters:
@ -65,8 +63,7 @@ subroutine numerics_init
numerics_inFlow, & numerics_inFlow, &
key key
class (tNode), pointer :: & class (tNode), pointer :: &
num_grid, & num_grid
num_generic
logical :: fexist logical :: fexist
!$ character(len=6) DAMASK_NumThreadsString ! environment variable DAMASK_NUM_THREADS !$ character(len=6) DAMASK_NumThreadsString ! environment variable DAMASK_NUM_THREADS
@ -111,25 +108,11 @@ subroutine numerics_init
#endif #endif
endselect endselect
enddo enddo
num_generic => numerics_root%get('generic',defaultVal=emptyDict)
do i=1,num_generic%length
key = num_generic%getKey(i)
select case(key)
case ('residualStiffness')
residualStiffness = num_generic%get_asFloat(key)
endselect
enddo
else fileExists else fileExists
write(6,'(a,/)') ' using standard values' write(6,'(a,/)') ' using standard values'
flush(6) flush(6)
endif fileExists endif fileExists
!--------------------------------------------------------------------------------------------------
! gradient parameter
write(6,'(a24,1x,es8.1)') ' residualStiffness: ',residualStiffness
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
! openMP parameter ! openMP parameter
!$ write(6,'(a24,1x,i8,/)') ' number of threads: ',DAMASK_NumThreadsInt !$ write(6,'(a24,1x,i8,/)') ' number of threads: ',DAMASK_NumThreadsInt
@ -146,7 +129,6 @@ subroutine numerics_init
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
! sanity checks ! sanity checks
if (residualStiffness < 0.0_pReal) call IO_error(301,ext_msg='residualStiffness')
if (itmax <= 1) call IO_error(301,ext_msg='itmax') if (itmax <= 1) call IO_error(301,ext_msg='itmax')
if (itmin > itmax .or. itmin < 1) call IO_error(301,ext_msg='itmin') if (itmin > itmax .or. itmin < 1) call IO_error(301,ext_msg='itmin')