submodule for homogenization

first draft, RGC not included because of name clash with isostrain
This commit is contained in:
Martin Diehl 2019-04-05 21:42:07 +02:00
parent 489a24afd8
commit 72b30729bb
5 changed files with 52 additions and 49 deletions

View File

@ -337,9 +337,6 @@ elseif(CMAKE_Fortran_COMPILER_ID STREQUAL "GNU")
set (COMPILE_FLAGS "${COMPILE_FLAGS} -fimplicit-none") set (COMPILE_FLAGS "${COMPILE_FLAGS} -fimplicit-none")
# assume "implicit none" even if not present in source # assume "implicit none" even if not present in source
set (COMPILE_FLAGS "${COMPILE_FLAGS} -fmodule-private")
# assume "private" even if not present in source
set (COMPILE_FLAGS "${COMPILE_FLAGS} -Wall") set (COMPILE_FLAGS "${COMPILE_FLAGS} -Wall")
# sets the following Fortran options: # sets the following Fortran options:
# -Waliasing: warn about possible aliasing of dummy arguments. Specifically, it warns if the same actual argument is associated with a dummy argument with "INTENT(IN)" and a dummy argument with "INTENT(OUT)" in a call with an explicit interface. # -Waliasing: warn about possible aliasing of dummy arguments. Specifically, it warns if the same actual argument is associated with a dummy argument with "INTENT(IN)" and a dummy argument with "INTENT(OUT)" in a call with an explicit interface.

View File

@ -46,8 +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_none.f90"
#include "homogenization_mech_isostrain.f90"
#include "homogenization_mech_RGC.f90" #include "homogenization_mech_RGC.f90"
#include "thermal_isothermal.f90" #include "thermal_isothermal.f90"
#include "thermal_adiabatic.f90" #include "thermal_adiabatic.f90"
@ -56,4 +54,6 @@
#include "damage_local.f90" #include "damage_local.f90"
#include "damage_nonlocal.f90" #include "damage_nonlocal.f90"
#include "homogenization.f90" #include "homogenization.f90"
#include "homogenization_mech_none.f90"
#include "homogenization_mech_isostrain.f90"
#include "CPFEM.f90" #include "CPFEM.f90"

View File

@ -39,6 +39,30 @@ module homogenization
logical, dimension(:,:,:), allocatable, private :: & logical, dimension(:,:,:), allocatable, private :: &
materialpoint_doneAndHappy materialpoint_doneAndHappy
interface
module subroutine mech_none_init
end subroutine mech_none_init
module subroutine mech_isostrain_init
end subroutine mech_isostrain_init
module subroutine mech_isostrain_partitionDeformation(F,avgF)
real(pReal), dimension (:,:,:), intent(out) :: F !< partitioned deformation gradient
real(pReal), dimension (3,3), intent(in) :: avgF !< average deformation gradient at material point
end subroutine mech_isostrain_partitionDeformation
module subroutine mech_isostrain_averageStressAndItsTangent(avgP,dAvgPdAvgF,P,dPdF,instance)
real(pReal), dimension (3,3), intent(out) :: avgP !< average stress at material point
real(pReal), dimension (3,3,3,3), intent(out) :: dAvgPdAvgF !< average stiffness at material point
real(pReal), dimension (:,:,:), intent(in) :: P !< partitioned stresses
real(pReal), dimension (:,:,:,:,:), intent(in) :: dPdF !< partitioned stiffnesses
integer, intent(in) :: instance
end subroutine mech_isostrain_averageStressAndItsTangent
end interface
public :: & public :: &
homogenization_init, & homogenization_init, &
materialpoint_stressAndItsTangent, & materialpoint_stressAndItsTangent, &
@ -77,9 +101,7 @@ subroutine homogenization_init
config_homogenization, & config_homogenization, &
homogenization_name homogenization_name
use material use material
use homogenization_none use homogenization_mech_RGC
use homogenization_isostrain
use homogenization_RGC
use thermal_isothermal use thermal_isothermal
use thermal_adiabatic use thermal_adiabatic
use thermal_conduction use thermal_conduction
@ -100,8 +122,8 @@ subroutine homogenization_init
logical :: valid logical :: valid
if (any(homogenization_type == HOMOGENIZATION_NONE_ID)) call homogenization_none_init if (any(homogenization_type == HOMOGENIZATION_NONE_ID)) call mech_none_init
if (any(homogenization_type == HOMOGENIZATION_ISOSTRAIN_ID)) call homogenization_isostrain_init if (any(homogenization_type == HOMOGENIZATION_ISOSTRAIN_ID)) call mech_isostrain_init
if (any(homogenization_type == HOMOGENIZATION_RGC_ID)) call homogenization_RGC_init if (any(homogenization_type == HOMOGENIZATION_RGC_ID)) call homogenization_RGC_init
if (any(thermal_type == THERMAL_isothermal_ID)) call thermal_isothermal_init if (any(thermal_type == THERMAL_isothermal_ID)) call thermal_isothermal_init
@ -709,9 +731,7 @@ subroutine partitionDeformation(ip,el)
HOMOGENIZATION_RGC_ID HOMOGENIZATION_RGC_ID
use crystallite, only: & use crystallite, only: &
crystallite_partionedF crystallite_partionedF
use homogenization_isostrain, only: & use homogenization_mech_RGC, only: &
homogenization_isostrain_partitionDeformation
use homogenization_RGC, only: &
homogenization_RGC_partitionDeformation homogenization_RGC_partitionDeformation
implicit none implicit none
@ -725,7 +745,7 @@ subroutine partitionDeformation(ip,el)
crystallite_partionedF(1:3,1:3,1,ip,el) = materialpoint_subF(1:3,1:3,ip,el) crystallite_partionedF(1:3,1:3,1,ip,el) = materialpoint_subF(1:3,1:3,ip,el)
case (HOMOGENIZATION_ISOSTRAIN_ID) chosenHomogenization case (HOMOGENIZATION_ISOSTRAIN_ID) chosenHomogenization
call homogenization_isostrain_partitionDeformation(& call mech_isostrain_partitionDeformation(&
crystallite_partionedF(1:3,1:3,1:homogenization_Ngrains(mesh_element(3,el)),ip,el), & crystallite_partionedF(1:3,1:3,1:homogenization_Ngrains(mesh_element(3,el)),ip,el), &
materialpoint_subF(1:3,1:3,ip,el)) materialpoint_subF(1:3,1:3,ip,el))
@ -760,7 +780,7 @@ function updateState(ip,el)
crystallite_dPdF, & crystallite_dPdF, &
crystallite_partionedF,& crystallite_partionedF,&
crystallite_partionedF0 crystallite_partionedF0
use homogenization_RGC, only: & use homogenization_mech_RGC, only: &
homogenization_RGC_updateState homogenization_RGC_updateState
use thermal_adiabatic, only: & use thermal_adiabatic, only: &
thermal_adiabatic_updateState thermal_adiabatic_updateState
@ -824,9 +844,7 @@ subroutine averageStressAndItsTangent(ip,el)
HOMOGENIZATION_RGC_ID HOMOGENIZATION_RGC_ID
use crystallite, only: & use crystallite, only: &
crystallite_P,crystallite_dPdF crystallite_P,crystallite_dPdF
use homogenization_isostrain, only: & use homogenization_mech_RGC, only: &
homogenization_isostrain_averageStressAndItsTangent
use homogenization_RGC, only: &
homogenization_RGC_averageStressAndItsTangent homogenization_RGC_averageStressAndItsTangent
implicit none implicit none
@ -840,7 +858,7 @@ subroutine averageStressAndItsTangent(ip,el)
materialpoint_dPdF(1:3,1:3,1:3,1:3,ip,el) = crystallite_dPdF(1:3,1:3,1:3,1:3,1,ip,el) materialpoint_dPdF(1:3,1:3,1:3,1:3,ip,el) = crystallite_dPdF(1:3,1:3,1:3,1:3,1,ip,el)
case (HOMOGENIZATION_ISOSTRAIN_ID) chosenHomogenization case (HOMOGENIZATION_ISOSTRAIN_ID) chosenHomogenization
call homogenization_isostrain_averageStressAndItsTangent(& call mech_isostrain_averageStressAndItsTangent(&
materialpoint_P(1:3,1:3,ip,el), & materialpoint_P(1:3,1:3,ip,el), &
materialpoint_dPdF(1:3,1:3,1:3,1:3,ip,el),& materialpoint_dPdF(1:3,1:3,1:3,1:3,ip,el),&
crystallite_P(1:3,1:3,1:homogenization_Ngrains(mesh_element(3,el)),ip,el), & crystallite_P(1:3,1:3,1:homogenization_Ngrains(mesh_element(3,el)),ip,el), &
@ -887,7 +905,7 @@ function postResults(ip,el)
DAMAGE_none_ID, & DAMAGE_none_ID, &
DAMAGE_local_ID, & DAMAGE_local_ID, &
DAMAGE_nonlocal_ID DAMAGE_nonlocal_ID
use homogenization_RGC, only: & use homogenization_mech_RGC, only: &
homogenization_RGC_postResults homogenization_RGC_postResults
use thermal_adiabatic, only: & use thermal_adiabatic, only: &
thermal_adiabatic_postResults thermal_adiabatic_postResults

View File

@ -4,36 +4,32 @@
!> @author Philip Eisenlohr, Max-Planck-Institut für Eisenforschung GmbH !> @author Philip Eisenlohr, Max-Planck-Institut für Eisenforschung GmbH
!> @brief Isostrain (full constraint Taylor assuption) homogenization scheme !> @brief Isostrain (full constraint Taylor assuption) homogenization scheme
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
module homogenization_mech_isostrain submodule(homogenization) homogenization_mech_isostrain
implicit none implicit none
private
enum, bind(c) enum, bind(c)
enumerator :: & enumerator :: &
parallel_ID, & parallel_ID, &
average_ID average_ID
end enum end enum
type, private :: tParameters !< container type for internal constitutive parameters type :: tParameters !< container type for internal constitutive parameters
integer :: & integer :: &
Nconstituents Nconstituents
integer(kind(average_ID)) :: & integer(kind(average_ID)) :: &
mapping mapping
end type end type
type(tParameters), dimension(:), allocatable, private :: param !< containers of constitutive parameters (len Ninstance) type(tParameters), dimension(:), allocatable :: param !< containers of constitutive parameters (len Ninstance)
public :: &
homogenization_isostrain_init, &
homogenization_isostrain_partitionDeformation, &
homogenization_isostrain_averageStressAndItsTangent
contains contains
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
!> @brief allocates all neccessary fields, reads information from material configuration file !> @brief allocates all neccessary fields, reads information from material configuration file
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
subroutine homogenization_isostrain_init module subroutine mech_isostrain_init
use debug, only: & use debug, only: &
debug_HOMOGENIZATION, & debug_HOMOGENIZATION, &
debug_level, & debug_level, &
@ -94,15 +90,13 @@ subroutine homogenization_isostrain_init
enddo enddo
end subroutine homogenization_isostrain_init end subroutine mech_isostrain_init
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
!> @brief partitions the deformation gradient onto the constituents !> @brief partitions the deformation gradient onto the constituents
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
subroutine homogenization_isostrain_partitionDeformation(F,avgF) module subroutine mech_isostrain_partitionDeformation(F,avgF)
use prec, only: &
pReal
implicit none implicit none
real(pReal), dimension (:,:,:), intent(out) :: F !< partitioned deformation gradient real(pReal), dimension (:,:,:), intent(out) :: F !< partitioned deformation gradient
@ -111,15 +105,13 @@ subroutine homogenization_isostrain_partitionDeformation(F,avgF)
F = spread(avgF,3,size(F,3)) F = spread(avgF,3,size(F,3))
end subroutine homogenization_isostrain_partitionDeformation end subroutine mech_isostrain_partitionDeformation
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
!> @brief derive average stress and stiffness from constituent quantities !> @brief derive average stress and stiffness from constituent quantities
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
subroutine homogenization_isostrain_averageStressAndItsTangent(avgP,dAvgPdAvgF,P,dPdF,instance) module subroutine mech_isostrain_averageStressAndItsTangent(avgP,dAvgPdAvgF,P,dPdF,instance)
use prec, only: &
pReal
implicit none implicit none
real(pReal), dimension (3,3), intent(out) :: avgP !< average stress at material point real(pReal), dimension (3,3), intent(out) :: avgP !< average stress at material point
@ -142,6 +134,6 @@ subroutine homogenization_isostrain_averageStressAndItsTangent(avgP,dAvgPdAvgF,P
end associate end associate
end subroutine homogenization_isostrain_averageStressAndItsTangent end subroutine mech_isostrain_averageStressAndItsTangent
end module homogenization_mech_isostrain end submodule homogenization_mech_isostrain

View File

@ -4,20 +4,16 @@
!> @author Martin Diehl, Max-Planck-Institut für Eisenforschung GmbH !> @author Martin Diehl, Max-Planck-Institut für Eisenforschung GmbH
!> @brief dummy homogenization homogenization scheme for 1 constituent per material point !> @brief dummy homogenization homogenization scheme for 1 constituent per material point
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
module homogenization_mech_none submodule(homogenization) homogenization_mech_none
implicit none implicit none
private
public :: &
homogenization_none_init
contains contains
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
!> @brief allocates all neccessary fields, reads information from material configuration file !> @brief allocates all neccessary fields, reads information from material configuration file
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
subroutine homogenization_none_init() module subroutine mech_none_init
use debug, only: & use debug, only: &
debug_HOMOGENIZATION, & debug_HOMOGENIZATION, &
debug_level, & debug_level, &
@ -55,6 +51,6 @@ subroutine homogenization_none_init()
enddo enddo
end subroutine homogenization_none_init end subroutine mech_none_init
end module homogenization_mech_none end submodule homogenization_mech_none