bugfix: array access out of bounds

this now uses always the first (source) entry of a particular type.
Needs clearer structure in the future
This commit is contained in:
Martin Diehl 2020-02-29 09:52:33 +01:00
parent 07ab7a4d57
commit a9572f81a1
6 changed files with 18 additions and 6 deletions

View File

@ -75,8 +75,10 @@ subroutine source_damage_anisoBrittle_init
do p = 1, size(config_phase) do p = 1, size(config_phase)
source_damage_anisoBrittle_instance(p) = count(phase_source(:,1:p) == SOURCE_DAMAGE_ANISOBRITTLE_ID) source_damage_anisoBrittle_instance(p) = count(phase_source(:,1:p) == SOURCE_DAMAGE_ANISOBRITTLE_ID)
do sourceOffset = 1, phase_Nsources(p) do sourceOffset = 1, phase_Nsources(p)
if (phase_source(sourceOffset,p) == SOURCE_DAMAGE_ANISOBRITTLE_ID) & if (phase_source(sourceOffset,p) == SOURCE_DAMAGE_ANISOBRITTLE_ID) then
source_damage_anisoBrittle_offset(p) = sourceOffset source_damage_anisoBrittle_offset(p) = sourceOffset
exit
endif
enddo enddo
if (all(phase_source(:,p) /= SOURCE_DAMAGE_ANISOBRITTLE_ID)) cycle if (all(phase_source(:,p) /= SOURCE_DAMAGE_ANISOBRITTLE_ID)) cycle

View File

@ -70,8 +70,10 @@ subroutine source_damage_anisoDuctile_init
do p = 1, size(config_phase) do p = 1, size(config_phase)
source_damage_anisoDuctile_instance(p) = count(phase_source(:,1:p) == SOURCE_DAMAGE_ANISODUCTILE_ID) source_damage_anisoDuctile_instance(p) = count(phase_source(:,1:p) == SOURCE_DAMAGE_ANISODUCTILE_ID)
do sourceOffset = 1, phase_Nsources(p) do sourceOffset = 1, phase_Nsources(p)
if (phase_source(sourceOffset,p) == SOURCE_DAMAGE_ANISODUCTILE_ID) & if (phase_source(sourceOffset,p) == SOURCE_DAMAGE_ANISODUCTILE_ID) then
source_damage_anisoDuctile_offset(p) = sourceOffset source_damage_anisoDuctile_offset(p) = sourceOffset
exit
endif
enddo enddo
if (all(phase_source(:,p) /= SOURCE_DAMAGE_ANISODUCTILE_ID)) cycle if (all(phase_source(:,p) /= SOURCE_DAMAGE_ANISODUCTILE_ID)) cycle

View File

@ -65,8 +65,10 @@ subroutine source_damage_isoBrittle_init
do p = 1, size(config_phase) do p = 1, size(config_phase)
source_damage_isoBrittle_instance(p) = count(phase_source(:,1:p) == SOURCE_DAMAGE_ISOBRITTLE_ID) source_damage_isoBrittle_instance(p) = count(phase_source(:,1:p) == SOURCE_DAMAGE_ISOBRITTLE_ID)
do sourceOffset = 1, phase_Nsources(p) do sourceOffset = 1, phase_Nsources(p)
if (phase_source(sourceOffset,p) == SOURCE_DAMAGE_ISOBRITTLE_ID) & if (phase_source(sourceOffset,p) == SOURCE_DAMAGE_ISOBRITTLE_ID) then
source_damage_isoBrittle_offset(p) = sourceOffset source_damage_isoBrittle_offset(p) = sourceOffset
exit
endif
enddo enddo
if (all(phase_source(:,p) /= SOURCE_DAMAGE_ISOBRITTLE_ID)) cycle if (all(phase_source(:,p) /= SOURCE_DAMAGE_ISOBRITTLE_ID)) cycle

View File

@ -64,8 +64,10 @@ subroutine source_damage_isoDuctile_init
do p = 1, size(config_phase) do p = 1, size(config_phase)
source_damage_isoDuctile_instance(p) = count(phase_source(:,1:p) == SOURCE_DAMAGE_ISODUCTILE_ID) source_damage_isoDuctile_instance(p) = count(phase_source(:,1:p) == SOURCE_DAMAGE_ISODUCTILE_ID)
do sourceOffset = 1, phase_Nsources(p) do sourceOffset = 1, phase_Nsources(p)
if (phase_source(sourceOffset,p) == SOURCE_DAMAGE_ISODUCTILE_ID) & if (phase_source(sourceOffset,p) == SOURCE_DAMAGE_ISODUCTILE_ID) then
source_damage_isoDuctile_offset(p) = sourceOffset source_damage_isoDuctile_offset(p) = sourceOffset
exit
endif
enddo enddo
if (all(phase_source(:,p) /= SOURCE_DAMAGE_ISODUCTILE_ID)) cycle if (all(phase_source(:,p) /= SOURCE_DAMAGE_ISODUCTILE_ID)) cycle

View File

@ -54,8 +54,10 @@ subroutine source_thermal_dissipation_init
do p = 1, size(config_phase) do p = 1, size(config_phase)
source_thermal_dissipation_instance(p) = count(phase_source(:,1:p) == SOURCE_THERMAL_DISSIPATION_ID) source_thermal_dissipation_instance(p) = count(phase_source(:,1:p) == SOURCE_THERMAL_DISSIPATION_ID)
do sourceOffset = 1, phase_Nsources(p) do sourceOffset = 1, phase_Nsources(p)
if (phase_source(sourceOffset,p) == SOURCE_THERMAL_DISSIPATION_ID) & if (phase_source(sourceOffset,p) == SOURCE_THERMAL_DISSIPATION_ID) then
source_thermal_dissipation_offset(p) = sourceOffset source_thermal_dissipation_offset(p) = sourceOffset
exit
endif
enddo enddo
if (all(phase_source(:,p) /= SOURCE_THERMAL_DISSIPATION_ID)) cycle if (all(phase_source(:,p) /= SOURCE_THERMAL_DISSIPATION_ID)) cycle

View File

@ -58,8 +58,10 @@ subroutine source_thermal_externalheat_init
do p = 1, size(config_phase) do p = 1, size(config_phase)
source_thermal_externalheat_instance(p) = count(phase_source(:,1:p) == SOURCE_thermal_externalheat_ID) source_thermal_externalheat_instance(p) = count(phase_source(:,1:p) == SOURCE_thermal_externalheat_ID)
do sourceOffset = 1, phase_Nsources(p) do sourceOffset = 1, phase_Nsources(p)
if (phase_source(sourceOffset,p) == SOURCE_thermal_externalheat_ID) & if (phase_source(sourceOffset,p) == SOURCE_thermal_externalheat_ID) then
source_thermal_externalheat_offset(p) = sourceOffset source_thermal_externalheat_offset(p) = sourceOffset
exit
endif
enddo enddo
if (all(phase_source(:,p) /= SOURCE_thermal_externalheat_ID)) cycle if (all(phase_source(:,p) /= SOURCE_thermal_externalheat_ID)) cycle