From 3aec4f91f4300b8be09a0da5f9a64f8062487af5 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Fri, 28 Feb 2020 19:46:18 +0100 Subject: [PATCH] WIP: get rid of global variables from lattice --- src/kinematics_cleavage_opening.f90 | 13 +++++++++---- src/source_damage_isoBrittle.f90 | 3 ++- src/source_thermal_externalheat.f90 | 2 +- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/kinematics_cleavage_opening.f90 b/src/kinematics_cleavage_opening.f90 index e63ea0d7d..5508074a6 100644 --- a/src/kinematics_cleavage_opening.f90 +++ b/src/kinematics_cleavage_opening.f90 @@ -29,7 +29,12 @@ module kinematics_cleavage_opening real(pReal), dimension(:), allocatable :: & critDisp, & critLoad - end type + real(pReal), dimension(:,:,:,:), allocatable :: & + cleavage_systems + end type tParameters + + type(tParameters), dimension(:), allocatable :: param !< containers of constitutive parameters (len Ninstance) + ! Begin Deprecated integer, dimension(:), allocatable :: & @@ -71,10 +76,9 @@ subroutine kinematics_cleavage_opening_init if (iand(debug_level(debug_constitutive),debug_levelBasic) /= 0) & write(6,'(a16,1x,i5,/)') '# instances:',Ninstance + allocate(param(Ninstance)) + allocate(kinematics_cleavage_opening_instance(size(config_phase)), source=0) - do p = 1, size(config_phase) - kinematics_cleavage_opening_instance(p) = count(phase_kinematics(:,1:p) == kinematics_cleavage_opening_ID) ! ToDo: count correct? - enddo allocate(kinematics_cleavage_opening_critDisp(lattice_maxNcleavageFamily,Ninstance), source=0.0_pReal) allocate(kinematics_cleavage_opening_critLoad(lattice_maxNcleavageFamily,Ninstance), source=0.0_pReal) @@ -84,6 +88,7 @@ subroutine kinematics_cleavage_opening_init allocate(kinematics_cleavage_opening_N(Ninstance), source=0.0_pReal) do p = 1, size(config_phase) + kinematics_cleavage_opening_instance(p) = count(phase_kinematics(:,1:p) == kinematics_cleavage_opening_ID) ! ToDo: count correct? if (all(phase_kinematics(:,p) /= KINEMATICS_cleavage_opening_ID)) cycle associate(config => config_phase(p)) diff --git a/src/source_damage_isoBrittle.f90 b/src/source_damage_isoBrittle.f90 index 28b60320d..30f76d38a 100644 --- a/src/source_damage_isoBrittle.f90 +++ b/src/source_damage_isoBrittle.f90 @@ -16,6 +16,7 @@ module source_damage_isoBrittle implicit none private + integer, dimension(:), allocatable :: & source_damage_isoBrittle_offset, & source_damage_isoBrittle_instance @@ -36,7 +37,7 @@ module source_damage_isoBrittle source_damage_isoBrittle_init, & source_damage_isoBrittle_deltaState, & source_damage_isoBrittle_getRateAndItsTangent, & - source_damage_isoBrittle_Results + source_damage_isoBrittle_results contains diff --git a/src/source_thermal_externalheat.f90 b/src/source_thermal_externalheat.f90 index bf1f50bf3..de49ee395 100644 --- a/src/source_thermal_externalheat.f90 +++ b/src/source_thermal_externalheat.f90 @@ -18,7 +18,7 @@ module source_thermal_externalheat source_thermal_externalheat_offset, & !< which source is my current thermal dissipation mechanism? source_thermal_externalheat_instance !< instance of thermal dissipation source mechanism - type :: tParameters !< container type for internal constitutive parameters + type :: tParameters !< container type for internal constitutive parameters real(pReal), dimension(:), allocatable :: & time, & heat_rate