wrong counting

currently quite ugly, but planned changes for state structure will give
overcome this
This commit is contained in:
Martin Diehl 2019-06-14 10:05:39 +02:00
parent 083fdb13b4
commit 3f87a87a4e
13 changed files with 26 additions and 20 deletions

View File

@ -13,6 +13,7 @@ module plastic_disloUCLA
use material use material
use config use config
use lattice use lattice
use discretization
use results use results
implicit none implicit none
@ -295,7 +296,7 @@ subroutine plastic_disloUCLA_init()
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
! allocate state arrays ! allocate state arrays
NipcMyPhase = count(material_phaseMemberAt == p) NipcMyPhase = count(material_phaseAt == p) * discretization_nIP
sizeDotState = size(['rho_mob ','rho_dip ','gamma_sl']) * prm%sum_N_sl sizeDotState = size(['rho_mob ','rho_dip ','gamma_sl']) * prm%sum_N_sl
sizeState = sizeDotState sizeState = sizeDotState

View File

@ -15,6 +15,7 @@ module plastic_dislotwin
use material use material
use config use config
use lattice use lattice
use discretization
#if defined(PETSc) || defined(DAMASK_HDF5) #if defined(PETSc) || defined(DAMASK_HDF5)
use results use results
#endif #endif
@ -503,7 +504,7 @@ subroutine plastic_dislotwin_init
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
! allocate state arrays ! allocate state arrays
NipcMyPhase = count(material_phaseMemberAt == p) NipcMyPhase = count(material_phaseAt == p) * discretization_nIP
sizeDotState = size(['rho_mob ','rho_dip ','gamma_sl']) * prm%sum_N_sl & sizeDotState = size(['rho_mob ','rho_dip ','gamma_sl']) * prm%sum_N_sl &
+ size(['f_tw']) * prm%sum_N_tw & + size(['f_tw']) * prm%sum_N_tw &
+ size(['f_tr']) * prm%sum_N_tr + size(['f_tr']) * prm%sum_N_tr

View File

@ -14,9 +14,8 @@ module plastic_isotropic
use IO use IO
use material use material
use config use config
#if defined(PETSc) || defined(DAMASK_HDF5) use discretization
use results use results
#endif
implicit none implicit none
private private
@ -190,7 +189,7 @@ subroutine plastic_isotropic_init
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
! allocate state arrays ! allocate state arrays
NipcMyPhase = count(material_phaseMemberAt == p) NipcMyPhase = count(material_phaseAt == p) * discretization_nIP
sizeDotState = size(['xi ','accumulated_shear']) sizeDotState = size(['xi ','accumulated_shear'])
sizeState = sizeDotState sizeState = sizeDotState

View File

@ -13,9 +13,8 @@ module plastic_kinehardening
use material use material
use config use config
use lattice use lattice
#if defined(PETSc) || defined(DAMASK_HDF5) use discretization
use results use results
#endif
implicit none implicit none
private private
@ -257,7 +256,7 @@ subroutine plastic_kinehardening_init
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
! allocate state arrays ! allocate state arrays
NipcMyPhase = count(material_phaseMemberAt == p) NipcMyPhase = count(material_phaseAt == p) * discretization_nIP
sizeDotState = size(['crss ','crss_back', 'accshear ']) * prm%totalNslip sizeDotState = size(['crss ','crss_back', 'accshear ']) * prm%totalNslip
sizeDeltaState = size(['sense ', 'chi0 ', 'gamma0' ]) * prm%totalNslip sizeDeltaState = size(['sense ', 'chi0 ', 'gamma0' ]) * prm%totalNslip
sizeState = sizeDotState + sizeDeltaState sizeState = sizeDotState + sizeDeltaState

View File

@ -6,6 +6,7 @@
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
module plastic_none module plastic_none
use material use material
use discretization
use debug use debug
implicit none implicit none
@ -36,7 +37,7 @@ subroutine plastic_none_init
do p = 1, size(phase_plasticity) do p = 1, size(phase_plasticity)
if (phase_plasticity(p) /= PLASTICITY_NONE_ID) cycle if (phase_plasticity(p) /= PLASTICITY_NONE_ID) cycle
NipcMyPhase = count(material_phaseMemberAt == p) NipcMyPhase = count(material_phaseAt == p) * discretization_nIP
call material_allocatePlasticState(p,NipcMyPhase,0,0,0, & call material_allocatePlasticState(p,NipcMyPhase,0,0,0, &
0,0,0) 0,0,0)
plasticState(p)%sizePostResults = 0 plasticState(p)%sizePostResults = 0

View File

@ -556,7 +556,7 @@ subroutine plastic_nonlocal_init
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
! allocate state arrays ! allocate state arrays
NofMyPhase=count(material_phaseMemberAt==p) NofMyPhase = count(material_phaseAt==p) * discretization_nIP
sizeDotState = size([ 'rhoSglEdgePosMobile ','rhoSglEdgeNegMobile ', & sizeDotState = size([ 'rhoSglEdgePosMobile ','rhoSglEdgeNegMobile ', &
'rhoSglScrewPosMobile ','rhoSglScrewNegMobile ', & 'rhoSglScrewPosMobile ','rhoSglScrewNegMobile ', &
'rhoSglEdgePosImmobile ','rhoSglEdgeNegImmobile ', & 'rhoSglEdgePosImmobile ','rhoSglEdgeNegImmobile ', &
@ -677,7 +677,7 @@ subroutine plastic_nonlocal_init
allocate(iD(maxval(totalNslip),2,maxNinstances), source=0) allocate(iD(maxval(totalNslip),2,maxNinstances), source=0)
initializeInstances: do p = 1, size(phase_plasticity) initializeInstances: do p = 1, size(phase_plasticity)
NofMyPhase=count(material_phaseMemberAt==p) NofMyPhase = count(material_phaseAt==p) * discretization_nIP
myPhase2: if (phase_plasticity(p) == PLASTICITY_NONLOCAL_ID) then myPhase2: if (phase_plasticity(p) == PLASTICITY_NONLOCAL_ID) then
!*** determine indices to state array !*** determine indices to state array

View File

@ -12,9 +12,8 @@ module plastic_phenopowerlaw
use material use material
use config use config
use lattice use lattice
#if defined(PETSc) || defined(DAMASK_HDF5) use discretization
use results use results
#endif
implicit none implicit none
private private
@ -314,7 +313,7 @@ subroutine plastic_phenopowerlaw_init
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
! allocate state arrays ! allocate state arrays
NipcMyPhase = count(material_phaseMemberAt == p) NipcMyPhase = count(material_phaseAt == p) * discretization_nIP
sizeDotState = size(['tau_slip ','gamma_slip']) * prm%totalNslip & sizeDotState = size(['tau_slip ','gamma_slip']) * prm%totalNslip &
+ size(['tau_twin ','gamma_twin']) * prm%totalNtwin + size(['tau_twin ','gamma_twin']) * prm%totalNtwin
sizeState = sizeDotState sizeState = sizeDotState

View File

@ -10,6 +10,7 @@ module source_damage_anisoBrittle
use IO use IO
use math use math
use material use material
use discretization
use config use config
use lattice use lattice
@ -164,7 +165,7 @@ subroutine source_damage_anisoBrittle_init
end associate end associate
phase = p phase = p
NofMyPhase=count(material_phaseMemberAt==phase) NofMyPhase=count(material_phaseAt==phase) * discretization_nIP
instance = source_damage_anisoBrittle_instance(phase) instance = source_damage_anisoBrittle_instance(phase)
sourceOffset = source_damage_anisoBrittle_offset(phase) sourceOffset = source_damage_anisoBrittle_offset(phase)

View File

@ -9,6 +9,7 @@ module source_damage_anisoDuctile
use debug use debug
use IO use IO
use math use math
use discretization
use material use material
use config use config
@ -150,7 +151,7 @@ subroutine source_damage_anisoDuctile_init
phase = p phase = p
NofMyPhase=count(material_phaseMemberAt==phase) NofMyPhase=count(material_phaseAt==phase) * discretization_nIP
instance = source_damage_anisoDuctile_instance(phase) instance = source_damage_anisoDuctile_instance(phase)
sourceOffset = source_damage_anisoDuctile_offset(phase) sourceOffset = source_damage_anisoDuctile_offset(phase)

View File

@ -9,6 +9,7 @@ module source_damage_isoBrittle
use debug use debug
use IO use IO
use math use math
use discretization
use material use material
use config use config
@ -133,7 +134,7 @@ subroutine source_damage_isoBrittle_init
phase = p phase = p
NofMyPhase=count(material_phaseMemberAt==phase) NofMyPhase = count(material_phaseAt==phase) * discretization_nIP
instance = source_damage_isoBrittle_instance(phase) instance = source_damage_isoBrittle_instance(phase)
sourceOffset = source_damage_isoBrittle_offset(phase) sourceOffset = source_damage_isoBrittle_offset(phase)

View File

@ -8,6 +8,7 @@ module source_damage_isoDuctile
use prec use prec
use debug use debug
use IO use IO
use discretization
use material use material
use config use config
@ -132,7 +133,7 @@ subroutine source_damage_isoDuctile_init
end associate end associate
phase = p phase = p
NofMyPhase=count(material_phaseMemberAt==phase) NofMyPhase=count(material_phaseAt==phase) * discretization_nIP
instance = source_damage_isoDuctile_instance(phase) instance = source_damage_isoDuctile_instance(phase)
sourceOffset = source_damage_isoDuctile_offset(phase) sourceOffset = source_damage_isoDuctile_offset(phase)

View File

@ -7,6 +7,7 @@
module source_thermal_dissipation module source_thermal_dissipation
use prec use prec
use debug use debug
use discretization
use material use material
use config use config
@ -75,7 +76,7 @@ subroutine source_thermal_dissipation_init
if (all(phase_source(:,p) /= SOURCE_THERMAL_DISSIPATION_ID)) cycle if (all(phase_source(:,p) /= SOURCE_THERMAL_DISSIPATION_ID)) cycle
instance = source_thermal_dissipation_instance(p) instance = source_thermal_dissipation_instance(p)
param(instance)%kappa = config_phase(p)%getFloat('dissipation_coldworkcoeff') param(instance)%kappa = config_phase(p)%getFloat('dissipation_coldworkcoeff')
NofMyPhase=count(material_phaseMemberAt==p) NofMyPhase = count(material_phaseAt==p) * discretization_nIP
sourceOffset = source_thermal_dissipation_offset(p) sourceOffset = source_thermal_dissipation_offset(p)
call material_allocateSourceState(p,sourceOffset,NofMyPhase,0,0,0) call material_allocateSourceState(p,sourceOffset,NofMyPhase,0,0,0)

View File

@ -7,6 +7,7 @@
module source_thermal_externalheat module source_thermal_externalheat
use prec use prec
use debug use debug
use discretization
use material use material
use config use config
@ -83,7 +84,7 @@ subroutine source_thermal_externalheat_init
if (all(phase_source(:,p) /= SOURCE_thermal_externalheat_ID)) cycle if (all(phase_source(:,p) /= SOURCE_thermal_externalheat_ID)) cycle
instance = source_thermal_externalheat_instance(p) instance = source_thermal_externalheat_instance(p)
sourceOffset = source_thermal_externalheat_offset(p) sourceOffset = source_thermal_externalheat_offset(p)
NofMyPhase=count(material_phaseMemberAt==p) NofMyPhase = count(material_phaseAt==p) * discretization_nIP
param(instance)%time = config_phase(p)%getFloats('externalheat_time') param(instance)%time = config_phase(p)%getFloats('externalheat_time')
param(instance)%nIntervals = size(param(instance)%time) - 1 param(instance)%nIntervals = size(param(instance)%time) - 1