From 3f87a87a4e9476b69c14c1c4292d67d1359f096b Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Fri, 14 Jun 2019 10:05:39 +0200 Subject: [PATCH] wrong counting currently quite ugly, but planned changes for state structure will give overcome this --- src/plastic_disloUCLA.f90 | 3 ++- src/plastic_dislotwin.f90 | 3 ++- src/plastic_isotropic.f90 | 5 ++--- src/plastic_kinematichardening.f90 | 5 ++--- src/plastic_none.f90 | 3 ++- src/plastic_nonlocal.f90 | 4 ++-- src/plastic_phenopowerlaw.f90 | 5 ++--- src/source_damage_anisoBrittle.f90 | 3 ++- src/source_damage_anisoDuctile.f90 | 3 ++- src/source_damage_isoBrittle.f90 | 3 ++- src/source_damage_isoDuctile.f90 | 3 ++- src/source_thermal_dissipation.f90 | 3 ++- src/source_thermal_externalheat.f90 | 3 ++- 13 files changed, 26 insertions(+), 20 deletions(-) diff --git a/src/plastic_disloUCLA.f90 b/src/plastic_disloUCLA.f90 index a2658e8c4..28e1227aa 100644 --- a/src/plastic_disloUCLA.f90 +++ b/src/plastic_disloUCLA.f90 @@ -13,6 +13,7 @@ module plastic_disloUCLA use material use config use lattice + use discretization use results implicit none @@ -295,7 +296,7 @@ subroutine plastic_disloUCLA_init() !-------------------------------------------------------------------------------------------------- ! 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 sizeState = sizeDotState diff --git a/src/plastic_dislotwin.f90 b/src/plastic_dislotwin.f90 index e5fe58202..7847720ac 100644 --- a/src/plastic_dislotwin.f90 +++ b/src/plastic_dislotwin.f90 @@ -15,6 +15,7 @@ module plastic_dislotwin use material use config use lattice + use discretization #if defined(PETSc) || defined(DAMASK_HDF5) use results #endif @@ -503,7 +504,7 @@ subroutine plastic_dislotwin_init !-------------------------------------------------------------------------------------------------- ! 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 & + size(['f_tw']) * prm%sum_N_tw & + size(['f_tr']) * prm%sum_N_tr diff --git a/src/plastic_isotropic.f90 b/src/plastic_isotropic.f90 index 99518668d..3b5ec6e5a 100644 --- a/src/plastic_isotropic.f90 +++ b/src/plastic_isotropic.f90 @@ -14,9 +14,8 @@ module plastic_isotropic use IO use material use config -#if defined(PETSc) || defined(DAMASK_HDF5) + use discretization use results -#endif implicit none private @@ -190,7 +189,7 @@ subroutine plastic_isotropic_init !-------------------------------------------------------------------------------------------------- ! allocate state arrays - NipcMyPhase = count(material_phaseMemberAt == p) + NipcMyPhase = count(material_phaseAt == p) * discretization_nIP sizeDotState = size(['xi ','accumulated_shear']) sizeState = sizeDotState diff --git a/src/plastic_kinematichardening.f90 b/src/plastic_kinematichardening.f90 index b6173e2e8..f2183327c 100644 --- a/src/plastic_kinematichardening.f90 +++ b/src/plastic_kinematichardening.f90 @@ -13,9 +13,8 @@ module plastic_kinehardening use material use config use lattice -#if defined(PETSc) || defined(DAMASK_HDF5) + use discretization use results -#endif implicit none private @@ -257,7 +256,7 @@ subroutine plastic_kinehardening_init !-------------------------------------------------------------------------------------------------- ! allocate state arrays - NipcMyPhase = count(material_phaseMemberAt == p) + NipcMyPhase = count(material_phaseAt == p) * discretization_nIP sizeDotState = size(['crss ','crss_back', 'accshear ']) * prm%totalNslip sizeDeltaState = size(['sense ', 'chi0 ', 'gamma0' ]) * prm%totalNslip sizeState = sizeDotState + sizeDeltaState diff --git a/src/plastic_none.f90 b/src/plastic_none.f90 index d362e7a77..fa913df4c 100644 --- a/src/plastic_none.f90 +++ b/src/plastic_none.f90 @@ -6,6 +6,7 @@ !-------------------------------------------------------------------------------------------------- module plastic_none use material + use discretization use debug implicit none @@ -36,7 +37,7 @@ subroutine plastic_none_init do p = 1, size(phase_plasticity) 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, & 0,0,0) plasticState(p)%sizePostResults = 0 diff --git a/src/plastic_nonlocal.f90 b/src/plastic_nonlocal.f90 index d8a7fb4b7..854fc9177 100644 --- a/src/plastic_nonlocal.f90 +++ b/src/plastic_nonlocal.f90 @@ -556,7 +556,7 @@ subroutine plastic_nonlocal_init !-------------------------------------------------------------------------------------------------- ! allocate state arrays - NofMyPhase=count(material_phaseMemberAt==p) + NofMyPhase = count(material_phaseAt==p) * discretization_nIP sizeDotState = size([ 'rhoSglEdgePosMobile ','rhoSglEdgeNegMobile ', & 'rhoSglScrewPosMobile ','rhoSglScrewNegMobile ', & 'rhoSglEdgePosImmobile ','rhoSglEdgeNegImmobile ', & @@ -677,7 +677,7 @@ subroutine plastic_nonlocal_init allocate(iD(maxval(totalNslip),2,maxNinstances), source=0) 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 !*** determine indices to state array diff --git a/src/plastic_phenopowerlaw.f90 b/src/plastic_phenopowerlaw.f90 index ce244a203..0a0052dfb 100644 --- a/src/plastic_phenopowerlaw.f90 +++ b/src/plastic_phenopowerlaw.f90 @@ -12,9 +12,8 @@ module plastic_phenopowerlaw use material use config use lattice -#if defined(PETSc) || defined(DAMASK_HDF5) + use discretization use results -#endif implicit none private @@ -314,7 +313,7 @@ subroutine plastic_phenopowerlaw_init !-------------------------------------------------------------------------------------------------- ! allocate state arrays - NipcMyPhase = count(material_phaseMemberAt == p) + NipcMyPhase = count(material_phaseAt == p) * discretization_nIP sizeDotState = size(['tau_slip ','gamma_slip']) * prm%totalNslip & + size(['tau_twin ','gamma_twin']) * prm%totalNtwin sizeState = sizeDotState diff --git a/src/source_damage_anisoBrittle.f90 b/src/source_damage_anisoBrittle.f90 index 7019fcc11..9997f81e5 100644 --- a/src/source_damage_anisoBrittle.f90 +++ b/src/source_damage_anisoBrittle.f90 @@ -10,6 +10,7 @@ module source_damage_anisoBrittle use IO use math use material + use discretization use config use lattice @@ -164,7 +165,7 @@ subroutine source_damage_anisoBrittle_init end associate phase = p - NofMyPhase=count(material_phaseMemberAt==phase) + NofMyPhase=count(material_phaseAt==phase) * discretization_nIP instance = source_damage_anisoBrittle_instance(phase) sourceOffset = source_damage_anisoBrittle_offset(phase) diff --git a/src/source_damage_anisoDuctile.f90 b/src/source_damage_anisoDuctile.f90 index 27c768ffb..409466e48 100644 --- a/src/source_damage_anisoDuctile.f90 +++ b/src/source_damage_anisoDuctile.f90 @@ -9,6 +9,7 @@ module source_damage_anisoDuctile use debug use IO use math + use discretization use material use config @@ -150,7 +151,7 @@ subroutine source_damage_anisoDuctile_init phase = p - NofMyPhase=count(material_phaseMemberAt==phase) + NofMyPhase=count(material_phaseAt==phase) * discretization_nIP instance = source_damage_anisoDuctile_instance(phase) sourceOffset = source_damage_anisoDuctile_offset(phase) diff --git a/src/source_damage_isoBrittle.f90 b/src/source_damage_isoBrittle.f90 index 6d7893154..89f5a038c 100644 --- a/src/source_damage_isoBrittle.f90 +++ b/src/source_damage_isoBrittle.f90 @@ -9,6 +9,7 @@ module source_damage_isoBrittle use debug use IO use math + use discretization use material use config @@ -133,7 +134,7 @@ subroutine source_damage_isoBrittle_init phase = p - NofMyPhase=count(material_phaseMemberAt==phase) + NofMyPhase = count(material_phaseAt==phase) * discretization_nIP instance = source_damage_isoBrittle_instance(phase) sourceOffset = source_damage_isoBrittle_offset(phase) diff --git a/src/source_damage_isoDuctile.f90 b/src/source_damage_isoDuctile.f90 index b1d2ace28..65930cd07 100644 --- a/src/source_damage_isoDuctile.f90 +++ b/src/source_damage_isoDuctile.f90 @@ -8,6 +8,7 @@ module source_damage_isoDuctile use prec use debug use IO + use discretization use material use config @@ -132,7 +133,7 @@ subroutine source_damage_isoDuctile_init end associate phase = p - NofMyPhase=count(material_phaseMemberAt==phase) + NofMyPhase=count(material_phaseAt==phase) * discretization_nIP instance = source_damage_isoDuctile_instance(phase) sourceOffset = source_damage_isoDuctile_offset(phase) diff --git a/src/source_thermal_dissipation.f90 b/src/source_thermal_dissipation.f90 index 58bb11c84..9b18efef5 100644 --- a/src/source_thermal_dissipation.f90 +++ b/src/source_thermal_dissipation.f90 @@ -7,6 +7,7 @@ module source_thermal_dissipation use prec use debug + use discretization use material use config @@ -75,7 +76,7 @@ subroutine source_thermal_dissipation_init if (all(phase_source(:,p) /= SOURCE_THERMAL_DISSIPATION_ID)) cycle instance = source_thermal_dissipation_instance(p) 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) call material_allocateSourceState(p,sourceOffset,NofMyPhase,0,0,0) diff --git a/src/source_thermal_externalheat.f90 b/src/source_thermal_externalheat.f90 index 14684278f..1b9d03529 100644 --- a/src/source_thermal_externalheat.f90 +++ b/src/source_thermal_externalheat.f90 @@ -7,6 +7,7 @@ module source_thermal_externalheat use prec use debug + use discretization use material use config @@ -83,7 +84,7 @@ subroutine source_thermal_externalheat_init if (all(phase_source(:,p) /= SOURCE_thermal_externalheat_ID)) cycle instance = source_thermal_externalheat_instance(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)%nIntervals = size(param(instance)%time) - 1