This commit is contained in:
Martin Diehl 2019-05-18 07:39:55 +02:00
parent 2258bfb221
commit 34bcd38240
3 changed files with 24 additions and 39 deletions

View File

@ -46,7 +46,6 @@
#include "plastic_nonlocal.f90" #include "plastic_nonlocal.f90"
#include "constitutive.f90" #include "constitutive.f90"
#include "crystallite.f90" #include "crystallite.f90"
#include "homogenization_mech_RGC.f90"
#include "thermal_isothermal.f90" #include "thermal_isothermal.f90"
#include "thermal_adiabatic.f90" #include "thermal_adiabatic.f90"
#include "thermal_conduction.f90" #include "thermal_conduction.f90"
@ -56,4 +55,5 @@
#include "homogenization.f90" #include "homogenization.f90"
#include "homogenization_mech_none.f90" #include "homogenization_mech_none.f90"
#include "homogenization_mech_isostrain.f90" #include "homogenization_mech_isostrain.f90"
#include "homogenization_mech_RGC.f90"
#include "CPFEM.f90" #include "CPFEM.f90"

View File

@ -35,7 +35,6 @@ module homogenization
materialpoint_results !< results array of material point materialpoint_results !< results array of material point
integer, public, protected :: & integer, public, protected :: &
materialpoint_sizeResults, & materialpoint_sizeResults, &
homogenization_maxSizePostResults, &
thermal_maxSizePostResults, & thermal_maxSizePostResults, &
damage_maxSizePostResults damage_maxSizePostResults
@ -98,25 +97,25 @@ module homogenization
module function mech_RGC_updateState(P,F,F0,avgF,dt,dPdF,ip,el) module function mech_RGC_updateState(P,F,F0,avgF,dt,dPdF,ip,el)
logical, dimension(2) :: mech_RGC_updateState logical, dimension(2) :: mech_RGC_updateState
real(pReal), dimension(:,:,:), intent(in) :: & real(pReal), dimension(:,:,:), intent(in) :: &
P,& !< array of P P,& !< partitioned stresses
F,& !< array of F F,& !< partitioned deformation gradients
F0 !< array of initial F F0 !< partitioned initial deformation gradients
real(pReal), dimension(:,:,:,:,:), intent(in) :: dPdF !< array of current grain stiffness real(pReal), dimension(:,:,:,:,:), intent(in) :: dPdF !< partitioned stiffnesses
real(pReal), dimension(3,3), intent(in) :: avgF !< average F real(pReal), dimension(3,3), intent(in) :: avgF !< average F
real(pReal), intent(in) :: dt !< time increment real(pReal), intent(in) :: dt !< time increment
integer, intent(in) :: & integer, intent(in) :: &
ip, & !< integration point number ip, & !< integration point number
el !< element number el !< element number
end function end function mech_RGC_updateState
module subroutine mech_RGC_results(instance,group)
integer, intent(in) :: instance module subroutine mech_RGC_results(instance,group)
character(len=*), intent(in) :: group integer, intent(in) :: instance !< homogenization instance
end subroutine character(len=*), intent(in) :: group !< group name in HDF5 file
end subroutine mech_RGC_results
end interface end interface
public :: & public :: &
@ -124,11 +123,6 @@ logical, dimension(2) :: mech_RGC_updateState
materialpoint_stressAndItsTangent, & materialpoint_stressAndItsTangent, &
materialpoint_postResults, & materialpoint_postResults, &
homogenization_results homogenization_results
private :: &
partitionDeformation, &
updateState, &
averageStressAndItsTangent, &
postResults
contains contains
@ -137,7 +131,6 @@ contains
!> @brief module initialization !> @brief module initialization
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
subroutine homogenization_init subroutine homogenization_init
use homogenization_mech_RGC
use thermal_isothermal use thermal_isothermal
use thermal_adiabatic use thermal_adiabatic
use thermal_conduction use thermal_conduction
@ -245,7 +238,7 @@ subroutine homogenization_init
! allocate and initialize global variables ! allocate and initialize global variables
allocate(materialpoint_dPdF(3,3,3,3,theMesh%elem%nIPs,theMesh%nElems), source=0.0_pReal) allocate(materialpoint_dPdF(3,3,3,3,theMesh%elem%nIPs,theMesh%nElems), source=0.0_pReal)
allocate(materialpoint_F0(3,3,theMesh%elem%nIPs,theMesh%nElems), source=0.0_pReal) allocate(materialpoint_F0(3,3,theMesh%elem%nIPs,theMesh%nElems), source=0.0_pReal)
materialpoint_F0 = spread(spread(math_I3,3,theMesh%elem%nIPs),4,theMesh%nElems) ! initialize to identity materialpoint_F0 = spread(spread(math_I3,3,theMesh%elem%nIPs),4,theMesh%nElems) ! initialize to identity
allocate(materialpoint_F(3,3,theMesh%elem%nIPs,theMesh%nElems), source=0.0_pReal) allocate(materialpoint_F(3,3,theMesh%elem%nIPs,theMesh%nElems), source=0.0_pReal)
materialpoint_F = materialpoint_F0 ! initialize to identity materialpoint_F = materialpoint_F0 ! initialize to identity
allocate(materialpoint_subF0(3,3,theMesh%elem%nIPs,theMesh%nElems), source=0.0_pReal) allocate(materialpoint_subF0(3,3,theMesh%elem%nIPs,theMesh%nElems), source=0.0_pReal)
@ -260,18 +253,15 @@ subroutine homogenization_init
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
! allocate and initialize global state and postresutls variables ! allocate and initialize global state and postresutls variables
homogenization_maxSizePostResults = 0
thermal_maxSizePostResults = 0 thermal_maxSizePostResults = 0
damage_maxSizePostResults = 0 damage_maxSizePostResults = 0
do p = 1,size(config_homogenization) do p = 1,size(config_homogenization)
homogenization_maxSizePostResults = max(homogenization_maxSizePostResults,homogState (p)%sizePostResults)
thermal_maxSizePostResults = max(thermal_maxSizePostResults, thermalState (p)%sizePostResults) thermal_maxSizePostResults = max(thermal_maxSizePostResults, thermalState (p)%sizePostResults)
damage_maxSizePostResults = max(damage_maxSizePostResults ,damageState (p)%sizePostResults) damage_maxSizePostResults = max(damage_maxSizePostResults ,damageState (p)%sizePostResults)
enddo enddo
materialpoint_sizeResults = 1 & ! grain count materialpoint_sizeResults = 1 & ! grain count
+ 1 + homogenization_maxSizePostResults & ! homogSize & homogResult + 1 + thermal_maxSizePostResults &
+ thermal_maxSizePostResults &
+ damage_maxSizePostResults & + damage_maxSizePostResults &
+ homogenization_maxNgrains * (1 + crystallite_maxSizePostResults & ! crystallite size & crystallite results + homogenization_maxNgrains * (1 + crystallite_maxSizePostResults & ! crystallite size & crystallite results
+ 1 + constitutive_plasticity_maxSizePostResults & ! constitutive size & constitutive results + 1 + constitutive_plasticity_maxSizePostResults & ! constitutive size & constitutive results
@ -281,11 +271,6 @@ subroutine homogenization_init
write(6,'(/,a)') ' <<<+- homogenization init -+>>>' write(6,'(/,a)') ' <<<+- homogenization init -+>>>'
if (iand(debug_level(debug_homogenization), debug_levelBasic) /= 0) then if (iand(debug_level(debug_homogenization), debug_levelBasic) /= 0) then
#ifdef TODO
write(6,'(a32,1x,7(i8,1x))') 'homogenization_state0: ', shape(homogenization_state0)
write(6,'(a32,1x,7(i8,1x))') 'homogenization_subState0: ', shape(homogenization_subState0)
write(6,'(a32,1x,7(i8,1x))') 'homogenization_state: ', shape(homogenization_state)
#endif
write(6,'(a32,1x,7(i8,1x))') 'materialpoint_dPdF: ', shape(materialpoint_dPdF) write(6,'(a32,1x,7(i8,1x))') 'materialpoint_dPdF: ', shape(materialpoint_dPdF)
write(6,'(a32,1x,7(i8,1x))') 'materialpoint_F0: ', shape(materialpoint_F0) write(6,'(a32,1x,7(i8,1x))') 'materialpoint_F0: ', shape(materialpoint_F0)
write(6,'(a32,1x,7(i8,1x))') 'materialpoint_F: ', shape(materialpoint_F) write(6,'(a32,1x,7(i8,1x))') 'materialpoint_F: ', shape(materialpoint_F)

View File

@ -30,7 +30,7 @@ submodule(homogenization) homogenization_mech_RGC
angles angles
integer :: & integer :: &
of_debug = 0 of_debug = 0
integer(kind(undefined_ID)), dimension(:), allocatable :: & integer(kind(undefined_ID)), dimension(:), allocatable :: &
outputID outputID
end type tParameters end type tParameters
@ -945,7 +945,7 @@ end subroutine mech_RGC_averageStressAndItsTangent
!> @brief writes results to HDF5 output file !> @brief writes results to HDF5 output file
! ToDo: check wheter units are correct ! ToDo: check wheter units are correct
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
subroutine mech_RGC_results(instance,group) module subroutine mech_RGC_results(instance,group)
#if defined(PETSc) || defined(DAMASK_HDF5) #if defined(PETSc) || defined(DAMASK_HDF5)
integer, intent(in) :: instance integer, intent(in) :: instance
@ -981,8 +981,8 @@ subroutine mech_RGC_results(instance,group)
end associate end associate
#else #else
integer, intent(in) :: instance integer, intent(in) :: instance
character(len=*) :: group character(len=*), intent(in) :: group
#endif #endif
end subroutine mech_RGC_results end subroutine mech_RGC_results