simplified interface of CPFEM_general (removed P and F, made cs and dcs/dE optional)
commented and cleaned up the marc interface. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! For marc simulations, run ./code/setup/setup_code.sh !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
This commit is contained in:
parent
6625500cc7
commit
924d943edc
|
@ -266,8 +266,7 @@ end subroutine CPFEM_init
|
||||||
!--------------------------------------------------------------------------------------------------
|
!--------------------------------------------------------------------------------------------------
|
||||||
!> @brief perform initialization at first call, update variables and call the actual material model
|
!> @brief perform initialization at first call, update variables and call the actual material model
|
||||||
!--------------------------------------------------------------------------------------------------
|
!--------------------------------------------------------------------------------------------------
|
||||||
subroutine CPFEM_general(mode, ffn, ffn1, Temperature, dt, element, IP, cauchyStress,&
|
subroutine CPFEM_general(mode, ffn, ffn1, Temperature, dt, element, IP, cauchyStress, jacobian)
|
||||||
& jacobian, pstress, dPdF)
|
|
||||||
! note: cauchyStress = Cauchy stress cs(6) and jacobian = Consistent tangent dcs/dE
|
! note: cauchyStress = Cauchy stress cs(6) and jacobian = Consistent tangent dcs/dE
|
||||||
use numerics, only: defgradTolerance, &
|
use numerics, only: defgradTolerance, &
|
||||||
iJacoStiffness
|
iJacoStiffness
|
||||||
|
@ -343,19 +342,17 @@ subroutine CPFEM_general(mode, ffn, ffn1, Temperature, dt, element, IP, cauchySt
|
||||||
use DAMASK_interface
|
use DAMASK_interface
|
||||||
|
|
||||||
implicit none
|
implicit none
|
||||||
integer(pInt), intent(in) :: element, & ! FE element number
|
integer(pInt), intent(in) :: element, & !< FE element number
|
||||||
IP ! FE integration point number
|
IP !< FE integration point number
|
||||||
real(pReal), intent(inout) :: Temperature ! temperature
|
real(pReal), intent(inout) :: Temperature !< temperature
|
||||||
real(pReal), intent(in) :: dt ! time increment
|
real(pReal), intent(in) :: dt !< time increment
|
||||||
real(pReal), dimension (3,3), intent(in) :: ffn, & ! deformation gradient for t=t0
|
real(pReal), dimension (3,3), intent(in) :: ffn, & !< deformation gradient for t=t0
|
||||||
ffn1 ! deformation gradient for t=t1
|
ffn1 !< deformation gradient for t=t1
|
||||||
integer(pInt), intent(in) :: mode ! computation mode 1: regular computation plus aging of results
|
integer(pInt), intent(in) :: mode !< computation mode 1: regular computation plus aging of results
|
||||||
|
|
||||||
real(pReal), dimension(6), intent(out) :: cauchyStress ! stress vector in Mandel notation
|
|
||||||
real(pReal), dimension(6,6), intent(out) :: jacobian ! jacobian in Mandel notation
|
|
||||||
real(pReal), dimension (3,3), intent(out) :: pstress ! Piola-Kirchhoff stress in Matrix notation
|
|
||||||
real(pReal), dimension (3,3,3,3), intent(out) :: dPdF !
|
|
||||||
|
|
||||||
|
real(pReal), dimension(6), intent(out), optional :: cauchyStress !< stress vector in Mandel notation
|
||||||
|
real(pReal), dimension(6,6), intent(out), optional :: jacobian !< jacobian in Mandel notation
|
||||||
|
|
||||||
real(pReal) J_inverse, & ! inverse of Jacobian
|
real(pReal) J_inverse, & ! inverse of Jacobian
|
||||||
rnd
|
rnd
|
||||||
real(pReal), dimension (3,3) :: Kirchhoff, & ! Piola-Kirchhoff stress in Matrix notation
|
real(pReal), dimension (3,3) :: Kirchhoff, & ! Piola-Kirchhoff stress in Matrix notation
|
||||||
|
@ -573,9 +570,8 @@ subroutine CPFEM_general(mode, ffn, ffn1, Temperature, dt, element, IP, cauchySt
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
! --+>> COLLECTION OF FEM INPUT WITH RETURNING OF RANDOMIZED ODD STRESS AND JACOBIAN <<+--
|
!--------------------------------------------------------------------------------------------------
|
||||||
|
! collection of FEM input with returning of randomize odd stress and jacobian
|
||||||
|
|
||||||
if (iand(mode, CPFEM_BACKUPJACOBIAN) /= 0_pInt) &
|
if (iand(mode, CPFEM_BACKUPJACOBIAN) /= 0_pInt) &
|
||||||
CPFEM_dcsde_knownGood = CPFEM_dcsde
|
CPFEM_dcsde_knownGood = CPFEM_dcsde
|
||||||
if (iand(mode, CPFEM_RESTOREJACOBIAN) /= 0_pInt) &
|
if (iand(mode, CPFEM_RESTOREJACOBIAN) /= 0_pInt) &
|
||||||
|
@ -592,11 +588,6 @@ subroutine CPFEM_general(mode, ffn, ffn1, Temperature, dt, element, IP, cauchySt
|
||||||
CPFEM_calc_done = .false.
|
CPFEM_calc_done = .false.
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
cauchyStress = CPFEM_cs(1:6,IP,cp_en)
|
|
||||||
jacobian = CPFEM_dcsdE(1:6,1:6,IP,cp_en)
|
|
||||||
pstress = materialpoint_P(1:3,1:3,IP,cp_en)
|
|
||||||
dPdF = materialpoint_dPdF(1:3,1:3,1:3,1:3,IP,cp_en)
|
|
||||||
if (theTime > 0.0_pReal) then
|
if (theTime > 0.0_pReal) then
|
||||||
Temperature = materialpoint_Temperature(IP,cp_en) ! homogenized result except for potentially non-isothermal starting condition.
|
Temperature = materialpoint_Temperature(IP,cp_en) ! homogenized result except for potentially non-isothermal starting condition.
|
||||||
endif
|
endif
|
||||||
|
@ -605,24 +596,24 @@ subroutine CPFEM_general(mode, ffn, ffn1, Temperature, dt, element, IP, cauchySt
|
||||||
.and. ((debug_e == cp_en .and. debug_i == IP) &
|
.and. ((debug_e == cp_en .and. debug_i == IP) &
|
||||||
.or. .not. iand(debug_level(debug_CPFEM), debug_levelSelective) /= 0_pInt)) then
|
.or. .not. iand(debug_level(debug_CPFEM), debug_levelSelective) /= 0_pInt)) then
|
||||||
!$OMP CRITICAL (write2out)
|
!$OMP CRITICAL (write2out)
|
||||||
write(6,'(a,i8,1x,i2,/,12x,6(f10.3,1x)/)') '<< CPFEM >> stress/MPa at el ip ', cp_en, IP, cauchyStress/1.0e6_pReal
|
write(6,'(a,i8,1x,i2,/,12x,6(f10.3,1x)/)') '<< CPFEM >> stress/MPa at el ip ', &
|
||||||
write(6,'(a,i8,1x,i2,/,6(12x,6(f10.3,1x)/))') '<< CPFEM >> Jacobian/GPa at el ip ', cp_en, IP, transpose(jacobian)/1.0e9_pReal
|
cp_en, IP, CPFEM_cs(1:6,IP,cp_en)/1.0e6_pReal
|
||||||
|
write(6,'(a,i8,1x,i2,/,6(12x,6(f10.3,1x)/))') '<< CPFEM >> Jacobian/GPa at el ip ', &
|
||||||
|
cp_en, IP, transpose(CPFEM_dcsdE(1:6,1:6,IP,cp_en))/1.0e9_pReal
|
||||||
flush(6)
|
flush(6)
|
||||||
!$OMP END CRITICAL (write2out)
|
!$OMP END CRITICAL (write2out)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
!--------------------------------------------------------------------------------------------------
|
||||||
!*** warn if stiffness close to zero
|
! warn if stiffness close to zero
|
||||||
|
if (all(abs(CPFEM_dcsdE(1:6,1:6,IP,cp_en)) < 1e-10_pReal)) then
|
||||||
if (all(abs(jacobian) < 1e-10_pReal)) then
|
|
||||||
call IO_warning(601,cp_en,IP)
|
call IO_warning(601,cp_en,IP)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
!--------------------------------------------------------------------------------------------------
|
||||||
!*** remember extreme values of stress and jacobian
|
! remember extreme values of stress and jacobian
|
||||||
|
|
||||||
if (mode < 3) then
|
if (mode < 3) then
|
||||||
cauchyStress33 = math_Mandel6to33(cauchyStress)
|
cauchyStress33 = math_Mandel6to33(CPFEM_cs(1:6,IP,cp_en))
|
||||||
if (maxval(cauchyStress33) > debug_stressMax) then
|
if (maxval(cauchyStress33) > debug_stressMax) then
|
||||||
debug_stressMaxLocation = [cp_en, IP]
|
debug_stressMaxLocation = [cp_en, IP]
|
||||||
debug_stressMax = maxval(cauchyStress33)
|
debug_stressMax = maxval(cauchyStress33)
|
||||||
|
@ -631,7 +622,7 @@ subroutine CPFEM_general(mode, ffn, ffn1, Temperature, dt, element, IP, cauchySt
|
||||||
debug_stressMinLocation = [cp_en, IP]
|
debug_stressMinLocation = [cp_en, IP]
|
||||||
debug_stressMin = minval(cauchyStress33)
|
debug_stressMin = minval(cauchyStress33)
|
||||||
endif
|
endif
|
||||||
jacobian3333 = math_Mandel66to3333(jacobian)
|
jacobian3333 = math_Mandel66to3333(CPFEM_dcsdE(1:6,1:6,IP,cp_en))
|
||||||
if (maxval(jacobian3333) > debug_jacobianMax) then
|
if (maxval(jacobian3333) > debug_jacobianMax) then
|
||||||
debug_jacobianMaxLocation = [cp_en, IP]
|
debug_jacobianMaxLocation = [cp_en, IP]
|
||||||
debug_jacobianMax = maxval(jacobian3333)
|
debug_jacobianMax = maxval(jacobian3333)
|
||||||
|
@ -641,6 +632,11 @@ subroutine CPFEM_general(mode, ffn, ffn1, Temperature, dt, element, IP, cauchySt
|
||||||
debug_jacobianMin = minval(jacobian3333)
|
debug_jacobianMin = minval(jacobian3333)
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
!--------------------------------------------------------------------------------------------------
|
||||||
|
! copy to output if required (FEM solver)
|
||||||
|
if(present(cauchyStress)) cauchyStress = CPFEM_cs(1:6,IP,cp_en)
|
||||||
|
if(present(jacobian)) jacobian = CPFEM_dcsdE(1:6,1:6,IP,cp_en)
|
||||||
|
|
||||||
end subroutine CPFEM_general
|
end subroutine CPFEM_general
|
||||||
|
|
||||||
|
|
|
@ -204,8 +204,6 @@ subroutine vumat(nBlock, nDir, nshr, nStateV, nFieldV, nProps, lAnneal, &
|
||||||
real(pReal), dimension(nblock(1),nstatev), intent(out) :: &
|
real(pReal), dimension(nblock(1),nstatev), intent(out) :: &
|
||||||
stateNew !< state variables at each material point at the end of the increment
|
stateNew !< state variables at each material point at the end of the increment
|
||||||
|
|
||||||
real(pReal), dimension(3,3) :: pstress ! not used, but needed for call of cpfem_general
|
|
||||||
real(pReal), dimension(3,3,3,3) :: dPdF ! not used, but needed for call of cpfem_general
|
|
||||||
real(pReal), dimension(3) :: coordinates
|
real(pReal), dimension(3) :: coordinates
|
||||||
real(pReal), dimension(3,3) :: defgrd0,defgrd1
|
real(pReal), dimension(3,3) :: defgrd0,defgrd1
|
||||||
real(pReal), dimension(6) :: stress
|
real(pReal), dimension(6) :: stress
|
||||||
|
@ -286,7 +284,7 @@ subroutine vumat(nBlock, nDir, nshr, nStateV, nFieldV, nProps, lAnneal, &
|
||||||
cp_en = mesh_FEasCP('elem',nBlock(4_pInt+n))
|
cp_en = mesh_FEasCP('elem',nBlock(4_pInt+n))
|
||||||
mesh_ipCoordinates(1:3,n,cp_en) = numerics_unitlength * coordMp(n,1:3)
|
mesh_ipCoordinates(1:3,n,cp_en) = numerics_unitlength * coordMp(n,1:3)
|
||||||
|
|
||||||
call CPFEM_general(computationMode,defgrd0,defgrd1,temp,timeInc,cp_en,nBlock(2),stress,ddsdde, pstress, dPdF)
|
call CPFEM_general(computationMode,defgrd0,defgrd1,temp,timeInc,cp_en,nBlock(2),stress,ddsdde)
|
||||||
|
|
||||||
! Mandel: 11, 22, 33, SQRT(2)*12, SQRT(2)*23, SQRT(2)*13
|
! Mandel: 11, 22, 33, SQRT(2)*12, SQRT(2)*23, SQRT(2)*13
|
||||||
! straight: 11, 22, 33, 12, 23, 13
|
! straight: 11, 22, 33, 12, 23, 13
|
||||||
|
|
|
@ -213,8 +213,6 @@ subroutine UMAT(STRESS,STATEV,DDSDDE,SSE,SPD,SCD,&
|
||||||
DDSDDE !< Jacobian matrix of the constitutive model
|
DDSDDE !< Jacobian matrix of the constitutive model
|
||||||
|
|
||||||
real(pReal) :: temperature ! temp by Abaqus is intent(in)
|
real(pReal) :: temperature ! temp by Abaqus is intent(in)
|
||||||
real(pReal), dimension (3,3) :: pstress ! not used, but needed for call of cpfem_general
|
|
||||||
real(pReal), dimension (3,3,3,3) :: dPdF ! not used, but needed for call of cpfem_general
|
|
||||||
real(pReal), dimension(6) :: stress_h
|
real(pReal), dimension(6) :: stress_h
|
||||||
real(pReal), dimension(6,6) :: ddsdde_h
|
real(pReal), dimension(6,6) :: ddsdde_h
|
||||||
integer(pInt) :: computationMode, i, cp_en
|
integer(pInt) :: computationMode, i, cp_en
|
||||||
|
@ -313,7 +311,7 @@ subroutine UMAT(STRESS,STATEV,DDSDDE,SSE,SPD,SCD,&
|
||||||
!$OMP END CRITICAL (write2out)
|
!$OMP END CRITICAL (write2out)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
call CPFEM_general(computationMode,dfgrd0,dfgrd1,temperature,dtime,noel,npt,stress_h,ddsdde_h, pstress, dPdF)
|
call CPFEM_general(computationMode,dfgrd0,dfgrd1,temperature,dtime,noel,npt,stress_h,ddsdde_h)
|
||||||
|
|
||||||
! Mandel: 11, 22, 33, SQRT(2)*12, SQRT(2)*23, SQRT(2)*13
|
! Mandel: 11, 22, 33, SQRT(2)*12, SQRT(2)*23, SQRT(2)*13
|
||||||
! straight: 11, 22, 33, 12, 23, 13
|
! straight: 11, 22, 33, 12, 23, 13
|
||||||
|
|
|
@ -26,26 +26,23 @@
|
||||||
!> @author Denny Tjahjanto, Max-Planck-Institut für Eisenforschung GmbH
|
!> @author Denny Tjahjanto, Max-Planck-Institut für Eisenforschung GmbH
|
||||||
!> @author Christoph Kords, Max-Planck-Institut für Eisenforschung GmbH
|
!> @author Christoph Kords, Max-Planck-Institut für Eisenforschung GmbH
|
||||||
!> @brief Material subroutine for MSC.Marc
|
!> @brief Material subroutine for MSC.Marc
|
||||||
!> @details Usage:
|
!> @details Usage:
|
||||||
!> @details - choose material as hypela2
|
!> @details - choose material as hypela2
|
||||||
!> @details - set statevariable 2 to index of homogenization
|
!> @details - set statevariable 2 to index of homogenization
|
||||||
!> @details - set statevariable 3 to index of microstructure
|
!> @details - set statevariable 3 to index of microstructure
|
||||||
!> @details - make sure the file "material.config" exists in the working
|
!> @details - make sure the file "material.config" exists in the working directory
|
||||||
!> @details directory
|
!> @details - make sure the file "numerics.config" exists in the working directory
|
||||||
!> @details - make sure the file "numerics.config" exists in the working
|
!> @details - use nonsymmetric option for solver (e.g. direct profile or multifrontal sparse,
|
||||||
!> @details directory
|
!> @details the latter seems to be faster!)
|
||||||
!> @details - use nonsymmetric option for solver (e.g. direct
|
!> @details - in case of ddm (domain decomposition) a SYMMETRIC solver has to be used,
|
||||||
!> @details profile or multifrontal sparse, the latter seems
|
!> @details i.e uncheck "non-symmetric"
|
||||||
!> @details to be faster!)
|
!> @details Marc subroutines used:
|
||||||
!> @details - in case of ddm (domain decomposition)a SYMMETRIC
|
!> @details - hypela2
|
||||||
!> @details solver has to be used, i.e uncheck "non-symmetric"
|
!> @details - plotv
|
||||||
!> @details Marc subroutines used:
|
!> @details - quit
|
||||||
!> @details - hypela2
|
!> @details Marc common blocks included:
|
||||||
!> @details - plotv
|
!> @details - concom: lovl, inc
|
||||||
!> @details - quit
|
!> @details - creeps: timinc
|
||||||
!> @details Marc common blocks included:
|
|
||||||
!> @details - concom: lovl, ncycle, inc, incsub
|
|
||||||
!> @details - creeps: timinc
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
!--------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
#ifndef INT
|
#ifndef INT
|
||||||
|
@ -74,13 +71,13 @@ contains
|
||||||
!--------------------------------------------------------------------------------------------------
|
!--------------------------------------------------------------------------------------------------
|
||||||
subroutine DAMASK_interface_init
|
subroutine DAMASK_interface_init
|
||||||
|
|
||||||
implicit none
|
implicit none
|
||||||
|
|
||||||
!$OMP CRITICAL (write2out)
|
!$OMP CRITICAL (write2out)
|
||||||
write(6,'(/,a)') ' <<<+- DAMASK_marc init -+>>>'
|
write(6,'(/,a)') ' <<<+- DAMASK_marc init -+>>>'
|
||||||
write(6,'(a)') ' $Id$'
|
write(6,'(a)') ' $Id$'
|
||||||
#include "compilation_info.f90"
|
#include "compilation_info.f90"
|
||||||
!$OMP END CRITICAL (write2out)
|
!$OMP END CRITICAL (write2out)
|
||||||
|
|
||||||
end subroutine DAMASK_interface_init
|
end subroutine DAMASK_interface_init
|
||||||
|
|
||||||
|
@ -92,13 +89,12 @@ function getSolverWorkingDirectoryName()
|
||||||
|
|
||||||
implicit none
|
implicit none
|
||||||
character(1024) getSolverWorkingDirectoryName, inputName
|
character(1024) getSolverWorkingDirectoryName, inputName
|
||||||
character(len=*), parameter :: pathSep = achar(47)//achar(92) ! forward and backward slash
|
character(len=*), parameter :: pathSep = achar(47)//achar(92) ! forward and backward slash
|
||||||
|
|
||||||
getSolverWorkingDirectoryName=''
|
getSolverWorkingDirectoryName=''
|
||||||
inputName=''
|
inputName=''
|
||||||
inquire(5, name=inputName) ! determine inputputfile
|
inquire(5, name=inputName) ! determine inputputfile
|
||||||
getSolverWorkingDirectoryName=inputName(1:scan(inputName,pathSep,back=.true.))
|
getSolverWorkingDirectoryName=inputName(1:scan(inputName,pathSep,back=.true.))
|
||||||
! write(6,*) 'getSolverWorkingDirectoryName', getSolverWorkingDirectoryName
|
|
||||||
|
|
||||||
end function getSolverWorkingDirectoryName
|
end function getSolverWorkingDirectoryName
|
||||||
|
|
||||||
|
@ -113,12 +109,12 @@ function getSolverJobName()
|
||||||
|
|
||||||
implicit none
|
implicit none
|
||||||
character(1024) :: getSolverJobName, inputName
|
character(1024) :: getSolverJobName, inputName
|
||||||
character(len=*), parameter :: pathSep = achar(47)//achar(92) ! forward and backward slash
|
character(len=*), parameter :: pathSep = achar(47)//achar(92) ! forward and backward slash
|
||||||
integer(pInt) :: extPos
|
integer(pInt) :: extPos
|
||||||
|
|
||||||
getSolverJobName=''
|
getSolverJobName=''
|
||||||
inputName=''
|
inputName=''
|
||||||
inquire(5, name=inputName) ! determine inputfile
|
inquire(5, name=inputName) ! determine inputfile
|
||||||
extPos = len_trim(inputName)-4
|
extPos = len_trim(inputName)-4
|
||||||
getSolverJobName=inputName(scan(inputName,pathSep,back=.true.)+1:extPos)
|
getSolverJobName=inputName(scan(inputName,pathSep,back=.true.)+1:extPos)
|
||||||
|
|
||||||
|
@ -151,21 +147,11 @@ end module DAMASK_interface
|
||||||
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
!--------------------------------------------------------------------------------------------------
|
||||||
!> @brief This is the MSC.Marc user subroutine for defining material behavior
|
!> @brief This is the MSC.Marc user subroutine for defining material behavior
|
||||||
!> @details CAUTION : Due to calculation of the Deformation gradients, Stretch Tensors and
|
|
||||||
!> @details Rotation tensors at previous and current states, the analysis can be
|
|
||||||
!> @details computationally expensive. Please use the user subroutine -> hypela
|
|
||||||
!> @details if these kinematic quantities are not needed in the constitutive model
|
|
||||||
!> @details
|
|
||||||
!> @details IMPORTANT NOTES :
|
|
||||||
!> @details
|
|
||||||
!> @details (1) F,R,U are only available for continuum and membrane elements (not for
|
!> @details (1) F,R,U are only available for continuum and membrane elements (not for
|
||||||
!> @details shells and beams).
|
!> @details shells and beams).
|
||||||
!> @details
|
!> @details
|
||||||
!> @details (2) For total Lagrangian formulation use the -> 'Elasticity,1' card(=
|
!> @details (2) Use the -> 'Plasticity,3' card(=update+finite+large disp+constant d)
|
||||||
!> @details total Lagrange with large disp) in the parameter section of input deck.
|
!> @details in the parameter section of input deck (updated Lagrangian formulation).
|
||||||
!> @details For updated Lagrangian formulation use the -> 'Plasticity,3' card(=
|
|
||||||
!> @details update+finite+large disp+constant d) in the parameter section of
|
|
||||||
!> @details input deck.
|
|
||||||
!> @details
|
!> @details
|
||||||
!> @details The following operation obtains U (stretch tensor) at t=n+1 :
|
!> @details The following operation obtains U (stretch tensor) at t=n+1 :
|
||||||
!> @details
|
!> @details
|
||||||
|
@ -178,68 +164,46 @@ end module DAMASK_interface
|
||||||
!> @details enddo
|
!> @details enddo
|
||||||
!> @details enddo
|
!> @details enddo
|
||||||
!--------------------------------------------------------------------------------------------------
|
!--------------------------------------------------------------------------------------------------
|
||||||
subroutine hypela2(&
|
subroutine hypela2(d,g,e,de,s,t,dt,ngens,m,nn,kcus,matus,ndi,nshear,disp, &
|
||||||
d,& !< stress strain law to be formed
|
dispt,coord,ffn,frotn,strechn,eigvn,ffn1,frotn1, &
|
||||||
g,& !< change in stress due to temperature effects
|
strechn1,eigvn1,ncrd,itel,ndeg,ndm,nnode, &
|
||||||
e,& !< total elastic strain
|
jtype,lclass,ifr,ifu)
|
||||||
de,& !< increment of strain
|
use prec, only: &
|
||||||
s,& !< stress - should be updated by user
|
pReal, &
|
||||||
t,& !< state variables (comes in at t=n, must be updated to have state variables at t=n+1)
|
pInt
|
||||||
dt,& !< increment of state variables
|
use numerics, only: &
|
||||||
ngens,& !< size of stress - strain law
|
!$ DAMASK_NumThreadsInt, &
|
||||||
n,& !< element number
|
numerics_unitlength
|
||||||
nn,& !< integration point number
|
use FEsolving, only: &
|
||||||
kcus,& !< (1) layer number, (2) internal layer number
|
cycleCounter, &
|
||||||
matus,& !< (1) user material identification number, (2) internal material identification number
|
theInc, &
|
||||||
ndi,& !< number of direct components
|
calcMode, &
|
||||||
nshear,& !< number of shear components
|
lastMode, &
|
||||||
disp,& !< incremental displacements
|
theTime, &
|
||||||
dispt,& !< displacements at t=n (at assembly, lovl=4) and displacements at t=n+1 (at stress recovery, lovl=6)
|
theDelta, &
|
||||||
coord,& !< coordinates
|
lastIncConverged, &
|
||||||
ffn,& !< deformation gradient
|
outdatedByNewInc, &
|
||||||
frotn,& !< rotation tensor
|
outdatedFFN1, &
|
||||||
strechn,& !< square of principal stretch ratios, lambda(i)
|
terminallyIll, &
|
||||||
eigvn,& !< i principal direction components for j eigenvalues
|
symmetricSolver
|
||||||
ffn1,& !< deformation gradient
|
use math, only: &
|
||||||
frotn1,& !< rotation tensor
|
math_transpose33,&
|
||||||
strechn1,& !< square of principal stretch ratios, lambda(i)
|
invnrmMandel
|
||||||
eigvn1,& !< i principal direction components for j eigenvalues
|
use debug, only: &
|
||||||
ncrd,& !< number of coordinates
|
debug_level, &
|
||||||
itel,& !< dimension of F and R, either 2 or 3
|
debug_LEVELBASIC, &
|
||||||
ndeg,& !< number of degrees of freedom ==> is this at correct list position ?!?
|
debug_MARC, &
|
||||||
ndm,& !<
|
debug_info, &
|
||||||
nnode,& !< number of nodes per element
|
debug_reset
|
||||||
jtype,& !< element type
|
use mesh, only: &
|
||||||
lclass,& !< element class
|
mesh_FEasCP, &
|
||||||
ifr,& !< set to 1 if R has been calculated
|
mesh_element, &
|
||||||
ifu & !< set to 1 if stretch has been calculated
|
mesh_node0, &
|
||||||
)
|
mesh_node, &
|
||||||
|
mesh_build_subNodeCoords, &
|
||||||
use prec, only: pReal, &
|
mesh_build_ipCoordinates, &
|
||||||
pInt
|
FE_Nnodes, &
|
||||||
use numerics, only: numerics_unitlength
|
FE_geomtype
|
||||||
use FEsolving, only: cycleCounter, &
|
|
||||||
theInc, &
|
|
||||||
calcMode, &
|
|
||||||
lastMode, &
|
|
||||||
theTime, &
|
|
||||||
theDelta, &
|
|
||||||
lastIncConverged, &
|
|
||||||
outdatedByNewInc, &
|
|
||||||
outdatedFFN1, &
|
|
||||||
terminallyIll, &
|
|
||||||
symmetricSolver
|
|
||||||
use math, only: invnrmMandel
|
|
||||||
use debug, only: debug_info, &
|
|
||||||
debug_reset
|
|
||||||
use mesh, only: mesh_FEasCP, &
|
|
||||||
mesh_element, &
|
|
||||||
mesh_node0, &
|
|
||||||
mesh_node, &
|
|
||||||
mesh_build_subNodeCoords, &
|
|
||||||
mesh_build_ipCoordinates, &
|
|
||||||
FE_Nnodes, &
|
|
||||||
FE_geomtype
|
|
||||||
use CPFEM, only: &
|
use CPFEM, only: &
|
||||||
CPFEM_general, &
|
CPFEM_general, &
|
||||||
CPFEM_init_done, &
|
CPFEM_init_done, &
|
||||||
|
@ -249,120 +213,154 @@ subroutine hypela2(&
|
||||||
CPFEM_COLLECT, &
|
CPFEM_COLLECT, &
|
||||||
CPFEM_RESTOREJACOBIAN, &
|
CPFEM_RESTOREJACOBIAN, &
|
||||||
CPFEM_BACKUPJACOBIAN
|
CPFEM_BACKUPJACOBIAN
|
||||||
|
|
||||||
!$ use numerics, only: DAMASK_NumThreadsInt ! number of threads set by DAMASK_NUM_THREADS
|
|
||||||
|
|
||||||
implicit none
|
implicit none
|
||||||
!$ include "omp_lib.h" ! the openMP function library
|
!$ include "omp_lib.h" ! the openMP function library
|
||||||
! ** Start of generated type statements **
|
integer(pInt), intent(in) :: & ! according to MSC.Marc 2012 Manual D
|
||||||
real(pReal) coord, d, de, disp, dispt, dt, e, eigvn, eigvn1, ffn, ffn1
|
ngens, & !< size of stress-strain law
|
||||||
real(pReal) frotn, frotn1, g
|
nn, & !< integration point number
|
||||||
integer(pInt) ifr, ifu, itel, jtype, kcus, lclass, matus, n, ncrd, ndeg
|
ndi, & !< number of direct components
|
||||||
integer(pInt) ndi, ndm, ngens, nn, nnode, nshear
|
nshear, & !< number of shear components
|
||||||
real(pReal) s, strechn, strechn1, t
|
ncrd, & !< number of coordinates
|
||||||
logical :: cutBack
|
itel, & !< dimension of F and R, either 2 or 3
|
||||||
! ** End of generated type statements **
|
ndeg, & !< number of degrees of freedom
|
||||||
|
ndm, & !< not specified in MSC.Marc 2012 Manual D
|
||||||
dimension e(*),de(*),t(*),dt(*),g(*),d(ngens,*),s(*), n(2),coord(ncrd,*),disp(ndeg,*),matus(2),dispt(ndeg,*),ffn(itel,*),&
|
nnode, & !< number of nodes per element
|
||||||
frotn(itel,*),strechn(itel),eigvn(itel,*),ffn1(itel,*),frotn1(itel,*),strechn1(itel),eigvn1(itel,*),kcus(2), lclass(2)
|
jtype, & !< element type
|
||||||
|
ifr, & !< set to 1 if R has been calculated
|
||||||
|
ifu !< set to 1 if stretch has been calculated
|
||||||
|
integer(pInt), dimension(2), intent(in) :: & ! according to MSC.Marc 2012 Manual D
|
||||||
|
m, & !< (1) user element number, (2) internal element number
|
||||||
|
matus, & !< (1) user material identification number, (2) internal material identification number
|
||||||
|
kcus, & !< (1) layer number, (2) internal layer number
|
||||||
|
lclass !< (1) element class, (2) 0: displacement, 1: low order Herrmann, 2: high order Herrmann
|
||||||
|
real(pReal), dimension(*), intent(in) :: & ! has dimension(1) according to MSC.Marc 2012 Manual D, but according to example hypela2.f dimension(*)
|
||||||
|
e, & !< total elastic strain
|
||||||
|
de, & !< increment of strain
|
||||||
|
dt !< increment of state variables
|
||||||
|
real(pReal), dimension(itel), intent(in) :: & ! according to MSC.Marc 2012 Manual D
|
||||||
|
strechn, & !< square of principal stretch ratios, lambda(i) at t=n
|
||||||
|
strechn1 !< square of principal stretch ratios, lambda(i) at t=n+1
|
||||||
|
real(pReal), dimension(3,3), intent(in) :: & ! has dimension(itel,*) according to MSC.Marc 2012 Manual D, but we alway assume dimension(3,3)
|
||||||
|
ffn, & !< deformation gradient at t=n
|
||||||
|
ffn1 !< deformation gradient at t=n+1
|
||||||
|
real(pReal), dimension(itel,*), intent(in) :: & ! according to MSC.Marc 2012 Manual D
|
||||||
|
frotn, & !< rotation tensor at t=n
|
||||||
|
eigvn, & !< i principal direction components for j eigenvalues at t=n
|
||||||
|
frotn1, & !< rotation tensor at t=n+1
|
||||||
|
eigvn1 !< i principal direction components for j eigenvalues at t=n+1
|
||||||
|
real(pReal), dimension(ndeg,*), intent(in) :: & ! according to MSC.Marc 2012 Manual D
|
||||||
|
disp, & !< incremental displacements
|
||||||
|
dispt !< displacements at t=n (at assembly, lovl=4) and displacements at t=n+1 (at stress recovery, lovl=6)
|
||||||
|
real(pReal), dimension(ncrd,*), intent(in) :: & ! according to MSC.Marc 2012 Manual D
|
||||||
|
coord !< coordinates
|
||||||
|
real(pReal), dimension(*), intent(inout) :: & ! according to MSC.Marc 2012 Manual D
|
||||||
|
t !< state variables (comes in at t=n, must be updated to have state variables at t=n+1)
|
||||||
|
real(pReal), dimension(ndi+nshear), intent(out) :: & ! has dimension(*) according to MSC.Marc 2012 Manual D, but we need to loop over it
|
||||||
|
s, & !< stress - should be updated by user
|
||||||
|
g !< change in stress due to temperature effects
|
||||||
|
real(pReal), dimension(ngens,ngens), intent(out) :: & ! according to MSC.Marc 2012 Manual D, but according to example hypela2.f dimension(ngens,*)
|
||||||
|
d !< stress-strain law to be formed
|
||||||
|
|
||||||
|
!--------------------------------------------------------------------------------------------------
|
||||||
! Marc common blocks are in fixed format so they have to be reformated to free format (f90)
|
! Marc common blocks are in fixed format so they have to be reformated to free format (f90)
|
||||||
! Beware of changes in newer Marc versions
|
! Beware of changes in newer Marc versions
|
||||||
|
include "include/concom%%MARCVERSION%%" ! concom is needed for inc, lovl
|
||||||
|
include "include/creeps%%MARCVERSION%%" ! creeps is needed for timinc (time increment)
|
||||||
|
|
||||||
include "include/concom%%MARCVERSION%%" ! concom is needed for inc, subinc, ncycle, lovl
|
logical :: cutBack
|
||||||
include "include/creeps%%MARCVERSION%%" ! creeps is needed for timinc (time increment)
|
|
||||||
|
|
||||||
real(pReal), dimension(6) :: stress
|
real(pReal), dimension(6) :: stress
|
||||||
real(pReal), dimension(6,6) :: ddsdde
|
real(pReal), dimension(6,6) :: ddsdde
|
||||||
|
integer(pInt) :: computationMode, i, cp_en, node, FEnodeID
|
||||||
real(pReal), dimension (3,3) :: pstress ! dummy argument for call of cpfem_general (used by mpie_spectral)
|
!$ integer(pInt) :: defaultNumThreadsInt !< default value set by Marc
|
||||||
real(pReal), dimension (3,3,3,3) :: dPdF ! dummy argument for call of cpfem_general (used by mpie_spectral)
|
|
||||||
|
|
||||||
integer(pInt) computationMode, i, cp_en
|
!$ defaultNumThreadsInt = omp_get_num_threads() ! remember number of threads set by Marc
|
||||||
integer(pInt) node, FEnodeID
|
if (iand(debug_level(debug_MARC),debug_LEVELBASIC) /= 0_pInt) then
|
||||||
|
write(6,'(a,/,i8,i8,i2)') ' MSC.MARC information on shape of element(2), IP:', m, nn
|
||||||
|
write(6,'(a,2(1i))'), ' Jacobian: ', ngens,ngens
|
||||||
|
write(6,'(a,1i)'), ' Direct stress: ', ndi
|
||||||
|
write(6,'(a,1i)'), ' Shear stress: ', nshear
|
||||||
|
write(6,'(a,1i)'), ' DoF: ', ndeg
|
||||||
|
write(6,'(a,1i)'), ' Coordinates: ', ncrd
|
||||||
|
write(6,'(a,1i)'), ' Nodes: ', nnode
|
||||||
|
write(6,'(a,1i)'), ' Deformation gradient: ', itel
|
||||||
|
write(6,'(/,a,/,3(3(f12.7,1x)/))',advance='no') ' Deformation gradient at t=n:', &
|
||||||
|
math_transpose33(ffn)
|
||||||
|
write(6,'(/,a,/,3(3(f12.7,1x)/))',advance='no') ' Deformation gradient at t=n+1:', &
|
||||||
|
math_transpose33(ffn1)
|
||||||
|
endif
|
||||||
|
if (.not. CPFEM_init_done) call CPFEM_initAll(t(1),m(1),nn)
|
||||||
|
|
||||||
! OpenMP variable
|
!$ call omp_set_num_threads(DAMASK_NumThreadsInt) ! set number of threads for parallel execution set by DAMASK_NUM_THREADS
|
||||||
!$ integer(pInt) defaultNumThreadsInt ! default value set by Marc
|
|
||||||
|
|
||||||
|
|
||||||
!$ defaultNumThreadsInt = omp_get_num_threads() ! remember number of threads set by Marc
|
|
||||||
|
|
||||||
if (.not. CPFEM_init_done) call CPFEM_initAll(t(1),n(1),nn)
|
|
||||||
|
|
||||||
!$ call omp_set_num_threads(DAMASK_NumThreadsInt) ! set number of threads for parallel execution set by DAMASK_NUM_THREADS
|
|
||||||
|
|
||||||
if (lovl == 4 ) then
|
if (lovl == 4 ) then
|
||||||
if(timinc < theDelta .and. theInc == inc ) & ! first after cutback
|
if(timinc < theDelta .and. theInc == inc ) computationMode = CPFEM_RESTOREJACOBIAN ! first after cutback
|
||||||
computationMode = CPFEM_RESTOREJACOBIAN
|
else ! stress requested (lovl == 6)
|
||||||
else ! stress requested (lovl == 6)
|
cp_en = mesh_FEasCP('elem',m(1))
|
||||||
cp_en = mesh_FEasCP('elem',n(1))
|
if (cptim > theTime .or. inc /= theInc) then ! reached "convergence"
|
||||||
if (cptim > theTime .or. inc /= theInc) then ! reached "convergence"
|
|
||||||
terminallyIll = .false.
|
terminallyIll = .false.
|
||||||
cycleCounter = -1 ! first calc step increments this to cycle = 0
|
cycleCounter = -1 ! first calc step increments this to cycle = 0
|
||||||
if (inc == 0) then ! >> start of analysis <<
|
if (inc == 0) then ! >> start of analysis <<
|
||||||
lastIncConverged = .false. ! no Jacobian backup
|
lastIncConverged = .false. ! no Jacobian backup
|
||||||
outdatedByNewInc = .false. ! no aging of state
|
outdatedByNewInc = .false. ! no aging of state
|
||||||
lastMode = .false. ! pretend last step was collection
|
lastMode = .false. ! pretend last step was collection
|
||||||
calcMode = .false. ! pretend last step was collection
|
calcMode = .false. ! pretend last step was collection
|
||||||
!$OMP CRITICAL (write2out)
|
!$OMP CRITICAL (write2out)
|
||||||
write(6,'(a,i6,1x,i2)') '<< HYPELA2 >> start of analysis..! ',n(1),nn
|
write(6,'(a,i6,1x,i2)') '<< HYPELA2 >> start of analysis..! ',m(1),nn
|
||||||
flush(6)
|
flush(6)
|
||||||
!$OMP END CRITICAL (write2out)
|
!$OMP END CRITICAL (write2out)
|
||||||
else if (inc - theInc > 1) then ! >> restart of broken analysis <<
|
else if (inc - theInc > 1) then ! >> restart of broken analysis <<
|
||||||
lastIncConverged = .false. ! no Jacobian backup
|
lastIncConverged = .false. ! no Jacobian backup
|
||||||
outdatedByNewInc = .false. ! no aging of state
|
outdatedByNewInc = .false. ! no aging of state
|
||||||
lastMode = .true. ! pretend last step was calculation
|
lastMode = .true. ! pretend last step was calculation
|
||||||
calcMode = .true. ! pretend last step was calculation
|
calcMode = .true. ! pretend last step was calculation
|
||||||
!$OMP CRITICAL (write2out)
|
!$OMP CRITICAL (write2out)
|
||||||
write(6,'(a,i6,1x,i2)') '<< HYPELA2 >> restart of analysis..! ',n(1),nn
|
write(6,'(a,i6,1x,i2)') '<< HYPELA2 >> restart of analysis..! ',m(1),nn
|
||||||
flush(6)
|
flush(6)
|
||||||
!$OMP END CRITICAL (write2out)
|
!$OMP END CRITICAL (write2out)
|
||||||
else ! >> just the next inc <<
|
else ! >> just the next inc <<
|
||||||
lastIncConverged = .true. ! request Jacobian backup
|
lastIncConverged = .true. ! request Jacobian backup
|
||||||
outdatedByNewInc = .true. ! request aging of state
|
outdatedByNewInc = .true. ! request aging of state
|
||||||
lastMode = .true. ! assure last step was calculation
|
lastMode = .true. ! assure last step was calculation
|
||||||
calcMode = .true. ! assure last step was calculation
|
calcMode = .true. ! assure last step was calculation
|
||||||
!$OMP CRITICAL (write2out)
|
!$OMP CRITICAL (write2out)
|
||||||
write(6,'(a,i6,1x,i2)') '<< HYPELA2 >> new increment..! ',n(1),nn
|
write(6,'(a,i6,1x,i2)') '<< HYPELA2 >> new increment..! ',m(1),nn
|
||||||
flush(6)
|
flush(6)
|
||||||
!$OMP END CRITICAL (write2out)
|
!$OMP END CRITICAL (write2out)
|
||||||
endif
|
endif
|
||||||
else if ( timinc < theDelta ) then ! >> cutBack <<
|
else if ( timinc < theDelta ) then ! >> cutBack <<
|
||||||
terminallyIll = .false.
|
terminallyIll = .false.
|
||||||
cycleCounter = -1 ! first calc step increments this to cycle = 0
|
cycleCounter = -1 ! first calc step increments this to cycle = 0
|
||||||
calcMode = .true. ! pretend last step was calculation
|
calcMode = .true. ! pretend last step was calculation
|
||||||
!$OMP CRITICAL (write2out)
|
!$OMP CRITICAL (write2out)
|
||||||
write(6,'(a,i6,1x,i2)') '<< HYPELA2 >> cutback detected..! ',n(1),nn
|
write(6,'(a,i6,1x,i2)') '<< HYPELA2 >> cutback detected..! ',m(1),nn
|
||||||
flush(6)
|
flush(6)
|
||||||
!$OMP END CRITICAL (write2out)
|
!$OMP END CRITICAL (write2out)
|
||||||
endif ! convergence treatment end
|
endif ! convergence treatment end
|
||||||
|
|
||||||
calcMode(nn,cp_en) = .not. calcMode(nn,cp_en) ! ping pong (calc <--> collect)
|
calcMode(nn,cp_en) = .not. calcMode(nn,cp_en) ! ping pong (calc <--> collect)
|
||||||
|
|
||||||
if ( calcMode(nn,cp_en) ) then ! now --- CALC ---
|
if ( calcMode(nn,cp_en) ) then ! now --- CALC ---
|
||||||
if ( lastMode /= calcMode(nn,cp_en) ) then ! first after ping pong
|
if ( lastMode /= calcMode(nn,cp_en) ) then ! first after ping pong
|
||||||
call debug_reset() ! resets debugging
|
call debug_reset() ! resets debugging
|
||||||
outdatedFFN1 = .false.
|
outdatedFFN1 = .false.
|
||||||
cycleCounter = cycleCounter + 1_pInt
|
cycleCounter = cycleCounter + 1_pInt
|
||||||
call mesh_build_subNodeCoords() ! update subnodal coordinates
|
call mesh_build_subNodeCoords() ! update subnodal coordinates
|
||||||
call mesh_build_ipCoordinates() ! update ip coordinates
|
call mesh_build_ipCoordinates() ! update ip coordinates
|
||||||
endif
|
endif
|
||||||
if ( outdatedByNewInc ) then
|
if ( outdatedByNewInc ) then
|
||||||
computationMode = ior(CPFEM_CALCRESULTS,CPFEM_AGERESULTS)
|
computationMode = ior(CPFEM_CALCRESULTS,CPFEM_AGERESULTS)
|
||||||
outdatedByNewInc = .false. ! reset flag
|
outdatedByNewInc = .false. ! reset flag
|
||||||
else
|
else
|
||||||
computationMode = CPFEM_CALCRESULTS
|
computationMode = CPFEM_CALCRESULTS
|
||||||
endif
|
endif
|
||||||
else ! now --- COLLECT ---
|
else ! now --- COLLECT ---
|
||||||
if ( lastMode /= calcMode(nn,cp_en) .and. &
|
if ( lastMode /= calcMode(nn,cp_en) .and. & .not. terminallyIll) call debug_info() ! first after ping pong reports (meaningful) debugging
|
||||||
.not. terminallyIll ) then
|
|
||||||
call debug_info() ! first after ping pong reports (meaningful) debugging
|
|
||||||
endif
|
|
||||||
if ( lastIncConverged ) then
|
if ( lastIncConverged ) then
|
||||||
computationMode = ior(CPFEM_COLLECT,CPFEM_BACKUPJACOBIAN) ! collect and backup Jacobian after convergence
|
computationMode = ior(CPFEM_COLLECT,CPFEM_BACKUPJACOBIAN) ! collect and backup Jacobian after convergence
|
||||||
lastIncConverged = .false. ! reset flag
|
lastIncConverged = .false. ! reset flag
|
||||||
else
|
else
|
||||||
computationMode = CPFEM_COLLECT ! plain collect
|
computationMode = CPFEM_COLLECT ! plain collect
|
||||||
endif
|
endif
|
||||||
do node = 1,FE_Nnodes(FE_geomtype(mesh_element(2,cp_en)))
|
do node = 1,FE_Nnodes(FE_geomtype(mesh_element(2,cp_en)))
|
||||||
FEnodeID = mesh_FEasCP('node',mesh_element(4+node,cp_en))
|
FEnodeID = mesh_FEasCP('node',mesh_element(4+node,cp_en))
|
||||||
|
@ -370,23 +368,24 @@ subroutine hypela2(&
|
||||||
enddo
|
enddo
|
||||||
endif
|
endif
|
||||||
|
|
||||||
theTime = cptim ! record current starting time
|
theTime = cptim ! record current starting time
|
||||||
theDelta = timinc ! record current time increment
|
theDelta = timinc ! record current time increment
|
||||||
theInc = inc ! record current increment number
|
theInc = inc ! record current increment number
|
||||||
lastMode = calcMode(nn,cp_en) ! record calculationMode
|
lastMode = calcMode(nn,cp_en) ! record calculationMode
|
||||||
endif
|
endif
|
||||||
|
|
||||||
call CPFEM_general(computationMode,ffn,ffn1,t(1),timinc,n(1),nn,stress,ddsdde, pstress, dPdF)
|
call CPFEM_general(computationMode,ffn,ffn1,t(1),timinc,m(1),nn,stress,ddsdde)
|
||||||
|
|
||||||
! Mandel: 11, 22, 33, SQRT(2)*12, SQRT(2)*23, SQRT(2)*13
|
! Mandel: 11, 22, 33, SQRT(2)*12, SQRT(2)*23, SQRT(2)*13
|
||||||
! Marc: 11, 22, 33, 12, 23, 13
|
! Marc: 11, 22, 33, 12, 23, 13
|
||||||
! Marc: 11, 22, 33, 12
|
! Marc: 11, 22, 33, 12
|
||||||
|
|
||||||
forall(i=1:ngens) d(1:ngens,i) = invnrmMandel(i)*ddsdde(1:ngens,i)*invnrmMandel(1:ngens)
|
forall(i=1:ngens) d(1:ngens,i) = invnrmMandel(i)*ddsdde(1:ngens,i)*invnrmMandel(1:ngens)
|
||||||
s(1:ngens) = stress(1:ngens)*invnrmMandel(1:ngens)
|
s(1:ndi+nshear) = stress(1:ndi+nshear)*invnrmMandel(1:ndi+nshear)
|
||||||
if(symmetricSolver) d(1:ngens,1:ngens) = 0.5_pReal*(d(1:ngens,1:ngens)+transpose(d(1:ngens,1:ngens)))
|
g = 0.0_pReal
|
||||||
|
if(symmetricSolver) d = 0.5_pReal*(d+transpose(d))
|
||||||
|
|
||||||
!$ call omp_set_num_threads(defaultNumThreadsInt) ! reset number of threads to stored default value
|
!$ call omp_set_num_threads(defaultNumThreadsInt) ! reset number of threads to stored default value
|
||||||
|
|
||||||
end subroutine hypela2
|
end subroutine hypela2
|
||||||
|
|
||||||
|
@ -395,33 +394,37 @@ end subroutine hypela2
|
||||||
!> @brief sets user defined output variables for Marc
|
!> @brief sets user defined output variables for Marc
|
||||||
!> @details select a variable contour plotting (user subroutine).
|
!> @details select a variable contour plotting (user subroutine).
|
||||||
!--------------------------------------------------------------------------------------------------
|
!--------------------------------------------------------------------------------------------------
|
||||||
subroutine plotv(&
|
subroutine plotv(v,s,sp,etot,eplas,ecreep,t,m,nn,layer,ndi,nshear,jpltcd)
|
||||||
v,& !< variable
|
use prec, only: &
|
||||||
s,& !< stress array
|
pReal, &
|
||||||
sp,& !< stresses in preferred direction
|
pInt
|
||||||
etot,& !< total strain (generalized)
|
use mesh, only: &
|
||||||
eplas,& !< total plastic strain
|
mesh_FEasCP
|
||||||
ecreep,& !< total creep strain
|
use IO, only: &
|
||||||
t,& !< current temperature
|
IO_error
|
||||||
m,& !< element number
|
use homogenization, only: &
|
||||||
nn,& !< integration point number
|
materialpoint_results,&
|
||||||
layer,& !< layer number
|
materialpoint_sizeResults
|
||||||
ndi,& !< number of direct stress components
|
|
||||||
nshear,& !< number of shear stress components
|
|
||||||
jpltcd & !< user variable index
|
|
||||||
)
|
|
||||||
use prec, only: pReal,pInt
|
|
||||||
use mesh, only: mesh_FEasCP
|
|
||||||
use IO, only: IO_error
|
|
||||||
use homogenization, only: materialpoint_results,materialpoint_sizeResults
|
|
||||||
|
|
||||||
implicit none
|
implicit none
|
||||||
real(pReal) s(*),etot(*),eplas(*),ecreep(*),sp(*)
|
integer(pInt), intent(in) :: &
|
||||||
real(pReal) v, t(*)
|
m, & !< element number
|
||||||
integer(pInt) m, nn, layer, ndi, nshear, jpltcd
|
nn, & !< integration point number
|
||||||
|
layer, & !< layer number
|
||||||
|
ndi, & !< number of direct stress components
|
||||||
|
nshear, & !< number of shear stress components
|
||||||
|
jpltcd !< user variable index
|
||||||
|
real(pReal), dimension(*), intent(in) :: &
|
||||||
|
s, & !< stress array
|
||||||
|
sp, & !< stresses in preferred direction
|
||||||
|
etot, & !< total strain (generalized)
|
||||||
|
eplas, & !< total plastic strain
|
||||||
|
ecreep, & !< total creep strain
|
||||||
|
t !< current temperature
|
||||||
|
real(pReal), intent(out) :: &
|
||||||
|
v !< variable
|
||||||
|
|
||||||
if (jpltcd > materialpoint_sizeResults) call IO_error(700_pInt,jpltcd) ! complain about out of bounds error
|
if (jpltcd > materialpoint_sizeResults) call IO_error(700_pInt,jpltcd) ! complain about out of bounds error
|
||||||
|
|
||||||
v = materialpoint_results(jpltcd,nn,mesh_FEasCP('elem', m))
|
v = materialpoint_results(jpltcd,nn,mesh_FEasCP('elem', m))
|
||||||
|
|
||||||
end subroutine plotv
|
end subroutine plotv
|
||||||
|
|
|
@ -364,7 +364,7 @@ subroutine utilities_FFTforward(row,column)
|
||||||
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
!--------------------------------------------------------------------------------------------------
|
||||||
! removing highest frequencies
|
! removing highest frequencies
|
||||||
field_fourier ( res1_red,1:res(2) , 1:res(3) ,1:3,1:3)&
|
field_fourier ( res1_red,1:res(2) , 1:res(3) ,1:3,1:3)&
|
||||||
= cmplx(0.0_pReal,0.0_pReal,pReal)
|
= cmplx(0.0_pReal,0.0_pReal,pReal)
|
||||||
field_fourier (1:res1_red, res(2)/2_pInt+1_pInt,1:res(3) ,1:3,1:3)&
|
field_fourier (1:res1_red, res(2)/2_pInt+1_pInt,1:res(3) ,1:3,1:3)&
|
||||||
= cmplx(0.0_pReal,0.0_pReal,pReal)
|
= cmplx(0.0_pReal,0.0_pReal,pReal)
|
||||||
|
@ -764,9 +764,6 @@ subroutine utilities_constitutiveResponse(F_lastInc,F,temperature,timeinc,&
|
||||||
integer(pInt) :: &
|
integer(pInt) :: &
|
||||||
calcMode, & !< CPFEM mode for calculation
|
calcMode, & !< CPFEM mode for calculation
|
||||||
collectMode !< CPFEM mode for collection
|
collectMode !< CPFEM mode for collection
|
||||||
real(pReal), dimension(3,3,3,3) :: dPdF !< d P / d F
|
|
||||||
real(pReal), dimension(6) :: sigma !< cauchy stress in mandel notation
|
|
||||||
real(pReal), dimension(6,6) :: dsde !< d sigma / d Epsilon
|
|
||||||
real(pReal), dimension(3,3,3,3) :: max_dPdF, min_dPdF
|
real(pReal), dimension(3,3,3,3) :: max_dPdF, min_dPdF
|
||||||
real(pReal) :: max_dPdF_norm, min_dPdF_norm, defgradDetMin, defgradDetMax, defgradDet
|
real(pReal) :: max_dPdF_norm, min_dPdF_norm, defgradDetMin, defgradDetMax, defgradDet
|
||||||
integer(pInt) :: i,j,k
|
integer(pInt) :: i,j,k
|
||||||
|
@ -784,33 +781,32 @@ subroutine utilities_constitutiveResponse(F_lastInc,F,temperature,timeinc,&
|
||||||
calcMode = iand(calcMode, not(CPFEM_AGERESULTS))
|
calcMode = iand(calcMode, not(CPFEM_AGERESULTS))
|
||||||
endif
|
endif
|
||||||
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
|
||||||
! calculate bounds of det(F) and report
|
|
||||||
if(debugGeneral) then
|
|
||||||
defgradDetMax = -huge(1.0_pReal)
|
|
||||||
defgradDetMin = +huge(1.0_pReal)
|
|
||||||
do k = 1_pInt, res(3); do j = 1_pInt, res(2); do i = 1_pInt, res(1)
|
|
||||||
defgradDet = math_det33(F(1:3,1:3,i,j,k))
|
|
||||||
defgradDetMax = max(defgradDetMax,defgradDet)
|
|
||||||
defgradDetMin = min(defgradDetMin,defgradDet)
|
|
||||||
enddo; enddo; enddo
|
|
||||||
|
|
||||||
write(6,'(a,1x,es11.4)') ' max determinant of deformation =', defgradDetMax
|
|
||||||
write(6,'(a,1x,es11.4)') ' min determinant of deformation =', defgradDetMin
|
|
||||||
flush(6)
|
|
||||||
endif
|
|
||||||
|
|
||||||
call CPFEM_general(collectMode,F_lastInc(1:3,1:3,1,1,1),F(1:3,1:3,1,1,1), & ! collect mode handles Jacobian backup / restoration
|
call CPFEM_general(collectMode,F_lastInc(1:3,1:3,1,1,1),F(1:3,1:3,1,1,1), & ! collect mode handles Jacobian backup / restoration
|
||||||
temperature,timeinc,1_pInt,1_pInt,sigma,dsde,P(1:3,1:3,1,1,1),dPdF)
|
temperature,timeinc,1_pInt,1_pInt)
|
||||||
|
|
||||||
materialpoint_F0 = reshape(F_lastInc, [3,3,1,mesh_NcpElems])
|
materialpoint_F0 = reshape(F_lastInc, [3,3,1,mesh_NcpElems])
|
||||||
materialpoint_F = reshape(F, [3,3,1,mesh_NcpElems])
|
materialpoint_F = reshape(F, [3,3,1,mesh_NcpElems])
|
||||||
materialpoint_Temperature = temperature
|
materialpoint_Temperature = temperature
|
||||||
|
|
||||||
call debug_reset()
|
call debug_reset()
|
||||||
|
|
||||||
|
!--------------------------------------------------------------------------------------------------
|
||||||
|
! calculate bounds of det(F) and report
|
||||||
|
if(debugGeneral) then
|
||||||
|
defgradDetMax = -huge(1.0_pReal)
|
||||||
|
defgradDetMin = +huge(1.0_pReal)
|
||||||
|
do j = 1_pInt, mesh_NcpElems
|
||||||
|
defgradDet = math_det33(materialpoint_F(1:3,1:3,1,j))
|
||||||
|
defgradDetMax = max(defgradDetMax,defgradDet)
|
||||||
|
defgradDetMin = min(defgradDetMin,defgradDet)
|
||||||
|
end do
|
||||||
|
write(6,'(a,1x,es11.4)') ' max determinant of deformation =', defgradDetMax
|
||||||
|
write(6,'(a,1x,es11.4)') ' min determinant of deformation =', defgradDetMin
|
||||||
|
flush(6)
|
||||||
|
endif
|
||||||
|
|
||||||
call CPFEM_general(calcMode,F_lastInc(1:3,1:3,1,1,1), F(1:3,1:3,1,1,1), & ! first call calculates everything
|
call CPFEM_general(calcMode,F_lastInc(1:3,1:3,1,1,1), F(1:3,1:3,1,1,1), & ! first call calculates everything
|
||||||
temperature,timeinc,1_pInt,1_pInt,sigma,dsde,P(1:3,1:3,1,1,1),dPdF)
|
temperature,timeinc,1_pInt,1_pInt)
|
||||||
|
|
||||||
max_dPdF = 0.0_pReal
|
max_dPdF = 0.0_pReal
|
||||||
max_dPdF_norm = 0.0_pReal
|
max_dPdF_norm = 0.0_pReal
|
||||||
|
@ -825,7 +821,7 @@ subroutine utilities_constitutiveResponse(F_lastInc,F,temperature,timeinc,&
|
||||||
min_dPdF = materialpoint_dPdF(1:3,1:3,1:3,1:3,1,k)
|
min_dPdF = materialpoint_dPdF(1:3,1:3,1:3,1:3,1,k)
|
||||||
min_dPdF_norm = sum(materialpoint_dPdF(1:3,1:3,1:3,1:3,1,k)**2.0_pReal)
|
min_dPdF_norm = sum(materialpoint_dPdF(1:3,1:3,1:3,1:3,1,k)**2.0_pReal)
|
||||||
endif
|
endif
|
||||||
enddo
|
end do
|
||||||
|
|
||||||
P = reshape(materialpoint_P, [3,3,res(1),res(2),res(3)])
|
P = reshape(materialpoint_P, [3,3,res(1),res(2),res(3)])
|
||||||
C_volAvg = sum(sum(materialpoint_dPdF,dim=6),dim=5) * wgt
|
C_volAvg = sum(sum(materialpoint_dPdF,dim=6),dim=5) * wgt
|
||||||
|
|
|
@ -147,9 +147,9 @@ subroutine debug_init
|
||||||
character(len=64) :: tag
|
character(len=64) :: tag
|
||||||
character(len=1024) :: line
|
character(len=1024) :: line
|
||||||
|
|
||||||
write(6,'(/,a)') ' <<<+- debug init -+>>>'
|
write(6,'(/,a)') ' <<<+- debug init -+>>>'
|
||||||
write(6,'(a)') ' $Id$'
|
write(6,'(a)') ' $Id$'
|
||||||
write(6,'(a16,a)') ' Current time : ',IO_timeStamp()
|
write(6,'(a16,a)') ' Current time : ',IO_timeStamp()
|
||||||
#include "compilation_info.f90"
|
#include "compilation_info.f90"
|
||||||
|
|
||||||
if (allocated(debug_StressLoopDistribution)) &
|
if (allocated(debug_StressLoopDistribution)) &
|
||||||
|
@ -214,7 +214,7 @@ subroutine debug_init
|
||||||
what = debug_CPFEM
|
what = debug_CPFEM
|
||||||
case ('spectral')
|
case ('spectral')
|
||||||
what = debug_SPECTRAL
|
what = debug_SPECTRAL
|
||||||
case ('MARC')
|
case ('marc')
|
||||||
what = debug_MARC
|
what = debug_MARC
|
||||||
case ('abaqus')
|
case ('abaqus')
|
||||||
what = debug_ABAQUS
|
what = debug_ABAQUS
|
||||||
|
@ -268,48 +268,48 @@ subroutine debug_init
|
||||||
do i = 1_pInt, debug_MAXNTYPE
|
do i = 1_pInt, debug_MAXNTYPE
|
||||||
select case(i)
|
select case(i)
|
||||||
case (debug_DEBUG)
|
case (debug_DEBUG)
|
||||||
tag = 'Debug'
|
tag = ' Debug'
|
||||||
case (debug_MATH)
|
case (debug_MATH)
|
||||||
tag = 'Math'
|
tag = ' Math'
|
||||||
case (debug_FESOLVING)
|
case (debug_FESOLVING)
|
||||||
tag = 'FEsolving'
|
tag = ' FEsolving'
|
||||||
case (debug_MESH)
|
case (debug_MESH)
|
||||||
tag = 'Mesh'
|
tag = ' Mesh'
|
||||||
case (debug_MATERIAL)
|
case (debug_MATERIAL)
|
||||||
tag = 'Material'
|
tag = ' Material'
|
||||||
case (debug_LATTICE)
|
case (debug_LATTICE)
|
||||||
tag = 'Lattice'
|
tag = ' Lattice'
|
||||||
case (debug_CONSTITUTIVE)
|
case (debug_CONSTITUTIVE)
|
||||||
tag = 'Constitutive'
|
tag = ' Constitutive'
|
||||||
case (debug_CRYSTALLITE)
|
case (debug_CRYSTALLITE)
|
||||||
tag = 'Crystallite'
|
tag = ' Crystallite'
|
||||||
case (debug_HOMOGENIZATION)
|
case (debug_HOMOGENIZATION)
|
||||||
tag = 'Homogenizaiton'
|
tag = ' Homogenizaiton'
|
||||||
case (debug_CPFEM)
|
case (debug_CPFEM)
|
||||||
tag = 'CPFEM'
|
tag = ' CPFEM'
|
||||||
case (debug_SPECTRAL)
|
case (debug_SPECTRAL)
|
||||||
tag = 'Spectral solver'
|
tag = ' Spectral solver'
|
||||||
case (debug_MARC)
|
case (debug_MARC)
|
||||||
tag = 'MSC.MARC FEM solver'
|
tag = ' MSC.MARC FEM solver'
|
||||||
case (debug_ABAQUS)
|
case (debug_ABAQUS)
|
||||||
tag = 'ABAQUS FEM solver'
|
tag = ' ABAQUS FEM solver'
|
||||||
end select
|
end select
|
||||||
|
|
||||||
if(debug_level(i) /= 0) then
|
if(debug_level(i) /= 0) then
|
||||||
write(6,'(a,a)') tag,' debugging:'
|
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_LEVELBASIC) /= 0) write(6,'(a)') ' basic'
|
||||||
if(iand(debug_level(i),debug_LEVELEXTENSIVE) /= 0) write(6,'(a)') ' extensive'
|
if(iand(debug_level(i),debug_LEVELEXTENSIVE) /= 0) write(6,'(a)') ' extensive'
|
||||||
if(iand(debug_level(i),debug_LEVELSELECTIVE) /= 0) then
|
if(iand(debug_level(i),debug_LEVELSELECTIVE) /= 0) then
|
||||||
write(6,'(a)') 'selective on:'
|
write(6,'(a)') ' selective on:'
|
||||||
write(6,'(a24,1x,i8)') 'element: ',debug_e
|
write(6,'(a24,1x,i8)') ' element: ',debug_e
|
||||||
write(6,'(a24,1x,i8)') 'ip: ',debug_i
|
write(6,'(a24,1x,i8)') ' ip: ',debug_i
|
||||||
write(6,'(a24,1x,i8)') 'grain: ',debug_g
|
write(6,'(a24,1x,i8)') ' grain: ',debug_g
|
||||||
endif
|
endif
|
||||||
if(iand(debug_level(i),debug_SPECTRALRESTART) /= 0) write(6,'(a)') ' restart'
|
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_SPECTRALFFTW) /= 0) write(6,'(a)') ' FFTW'
|
||||||
if(iand(debug_level(i),debug_SPECTRALDIVERGENCE)/= 0) write(6,'(a)') ' divergence'
|
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_SPECTRALROTATION) /= 0) write(6,'(a)') ' rotation'
|
||||||
if(iand(debug_level(i),debug_SPECTRALPETSC) /= 0) write(6,'(a)') ' PETSc'
|
if(iand(debug_level(i),debug_SPECTRALPETSC) /= 0) write(6,'(a)') ' PETSc'
|
||||||
endif
|
endif
|
||||||
enddo
|
enddo
|
||||||
endif
|
endif
|
||||||
|
|
Loading…
Reference in New Issue