From debe096a538acf10f5d38ff718d07e78311a8888 Mon Sep 17 00:00:00 2001 From: Sharan Roongta Date: Sun, 12 Jul 2020 15:22:40 +0200 Subject: [PATCH] results placed where it belongs; cleaning --- src/constitutive.f90 | 109 +++-------------------------------- src/constitutive_damage.f90 | 70 ++++++++++++++++++---- src/constitutive_plastic.f90 | 72 ++++++++++++++++++++++- src/constitutive_thermal.f90 | 2 - 4 files changed, 135 insertions(+), 118 deletions(-) diff --git a/src/constitutive.f90 b/src/constitutive.f90 index cb970957f..040858e3f 100644 --- a/src/constitutive.f90 +++ b/src/constitutive.f90 @@ -298,56 +298,11 @@ module constitutive C end subroutine source_damage_isoBrittle_deltaState - - module subroutine plastic_isotropic_results(instance,group) - integer, intent(in) :: instance - character(len=*), intent(in) :: group - end subroutine plastic_isotropic_results - - module subroutine plastic_phenopowerlaw_results(instance,group) - integer, intent(in) :: instance - character(len=*), intent(in) :: group - end subroutine plastic_phenopowerlaw_results - - module subroutine plastic_kinehardening_results(instance,group) - integer, intent(in) :: instance - character(len=*), intent(in) :: group - end subroutine plastic_kinehardening_results - - module subroutine plastic_dislotwin_results(instance,group) - integer, intent(in) :: instance - character(len=*), intent(in) :: group - end subroutine plastic_dislotwin_results - - module subroutine plastic_disloUCLA_results(instance,group) - integer, intent(in) :: instance - character(len=*), intent(in) :: group - end subroutine plastic_disloUCLA_results - - module subroutine plastic_nonlocal_results(instance,group) - integer, intent(in) :: instance - character(len=*), intent(in) :: group - end subroutine plastic_nonlocal_results - - module subroutine source_damage_anisoBrittle_results(phase,group) - integer, intent(in) :: phase - character(len=*), intent(in) :: group - end subroutine source_damage_anisoBrittle_results - - module subroutine source_damage_anisoDuctile_results(phase,group) - integer, intent(in) :: phase - character(len=*), intent(in) :: group - end subroutine source_damage_anisoDuctile_results - - module subroutine source_damage_isoBrittle_results(phase,group) - integer, intent(in) :: phase - character(len=*), intent(in) :: group - end subroutine source_damage_isoBrittle_results - - module subroutine source_damage_isoDuctile_results(phase,group) - integer, intent(in) :: phase - character(len=*), intent(in) :: group - end subroutine source_damage_isoDuctile_results + module subroutine plastic_results + end subroutine plastic_results + + module subroutine damage_results + end subroutine damage_results end interface @@ -817,58 +772,8 @@ end function constitutive_deltaState !-------------------------------------------------------------------------------------------------- subroutine constitutive_results - integer :: p,i - character(len=pStringLen) :: group,group_plastic,group_sources - - plasticityLoop: do p=1,size(config_name_phase) - group = trim('current/constituent')//'/'//trim(config_name_phase(p)) - call results_closeGroup(results_addGroup(group)) - - group_plastic = trim(group)//'/plastic' - - call results_closeGroup(results_addGroup(group_plastic)) - select case(phase_plasticity(p)) - - case(PLASTICITY_ISOTROPIC_ID) - call plastic_isotropic_results(phase_plasticityInstance(p),group_plastic) - - case(PLASTICITY_PHENOPOWERLAW_ID) - call plastic_phenopowerlaw_results(phase_plasticityInstance(p),group_plastic) - - case(PLASTICITY_KINEHARDENING_ID) - call plastic_kinehardening_results(phase_plasticityInstance(p),group_plastic) - - case(PLASTICITY_DISLOTWIN_ID) - call plastic_dislotwin_results(phase_plasticityInstance(p),group_plastic) - - case(PLASTICITY_DISLOUCLA_ID) - call plastic_disloUCLA_results(phase_plasticityInstance(p),group_plastic) - - case(PLASTICITY_NONLOCAL_ID) - call plastic_nonlocal_results(phase_plasticityInstance(p),group_plastic) - end select - - sourceLoop: do i = 1, phase_Nsources(p) - group_sources = trim(group)//'/sources' - - call results_closeGroup(results_addGroup(group_sources)) - - sourceType: select case (phase_source(i,p)) - - case (SOURCE_damage_anisoBrittle_ID) sourceType - call source_damage_anisoBrittle_results(p,group_sources) - case (SOURCE_damage_anisoDuctile_ID) sourceType - call source_damage_anisoDuctile_results(p,group_sources) - case (SOURCE_damage_isoBrittle_ID) sourceType - call source_damage_isoBrittle_results(p,group_sources) - case (SOURCE_damage_isoDuctile_ID) sourceType - call source_damage_isoDuctile_results(p,group_sources) - end select sourceType - - enddo SourceLoop - - enddo plasticityLoop - + call plastic_results + call damage_results end subroutine constitutive_results diff --git a/src/constitutive_damage.f90 b/src/constitutive_damage.f90 index 6dae6e298..fe9eb4e41 100644 --- a/src/constitutive_damage.f90 +++ b/src/constitutive_damage.f90 @@ -1,7 +1,5 @@ submodule(constitutive) constitutive_damage - implicit none - interface module subroutine source_damage_anisoBrittle_init @@ -24,7 +22,6 @@ submodule(constitutive) constitutive_damage module subroutine source_damage_anisobrittle_getRateAndItsTangent(localphiDot, dLocalphiDot_dPhi, phi, phase, constituent) - integer, intent(in) :: & phase, & constituent @@ -33,11 +30,9 @@ submodule(constitutive) constitutive_damage real(pReal), intent(out) :: & localphiDot, & dLocalphiDot_dPhi - end subroutine source_damage_anisoBrittle_getRateAndItsTangent module subroutine source_damage_anisoDuctile_getRateAndItsTangent(localphiDot, dLocalphiDot_dPhi, phi, phase, constituent) - integer, intent(in) :: & phase, & constituent @@ -46,11 +41,9 @@ submodule(constitutive) constitutive_damage real(pReal), intent(out) :: & localphiDot, & dLocalphiDot_dPhi - end subroutine source_damage_anisoDuctile_getRateAndItsTangent module subroutine source_damage_isoBrittle_getRateAndItsTangent(localphiDot, dLocalphiDot_dPhi, phi, phase, constituent) - integer, intent(in) :: & phase, & constituent @@ -59,11 +52,9 @@ submodule(constitutive) constitutive_damage real(pReal), intent(out) :: & localphiDot, & dLocalphiDot_dPhi - end subroutine source_damage_isoBrittle_getRateAndItsTangent module subroutine source_damage_isoDuctile_getRateAndItsTangent(localphiDot, dLocalphiDot_dPhi, phi, phase, constituent) - integer, intent(in) :: & phase, & constituent @@ -72,11 +63,9 @@ submodule(constitutive) constitutive_damage real(pReal), intent(out) :: & localphiDot, & dLocalphiDot_dPhi - end subroutine source_damage_isoDuctile_getRateAndItsTangent module subroutine source_thermal_dissipation_getRateAndItsTangent(TDot, dTDot_dT, Tstar, Lp, phase) - integer, intent(in) :: & phase real(pReal), intent(in), dimension(3,3) :: & @@ -87,8 +76,28 @@ submodule(constitutive) constitutive_damage real(pReal), intent(out) :: & TDot, & dTDot_dT - end subroutine source_thermal_dissipation_getRateAndItsTangent + + module subroutine source_damage_anisoBrittle_results(phase,group) + integer, intent(in) :: phase + character(len=*), intent(in) :: group + end subroutine source_damage_anisoBrittle_results + + module subroutine source_damage_anisoDuctile_results(phase,group) + integer, intent(in) :: phase + character(len=*), intent(in) :: group + end subroutine source_damage_anisoDuctile_results + + module subroutine source_damage_isoBrittle_results(phase,group) + integer, intent(in) :: phase + character(len=*), intent(in) :: group + end subroutine source_damage_isoBrittle_results + + module subroutine source_damage_isoDuctile_results(phase,group) + integer, intent(in) :: phase + character(len=*), intent(in) :: group + end subroutine source_damage_isoDuctile_results + end interface contains @@ -152,4 +161,41 @@ module procedure constitutive_damage_getRateAndItsTangents end procedure constitutive_damage_getRateAndItsTangents + +module subroutine damage_results + + integer :: p,i + character(len=pStringLen) :: group + + do p = 1, size(config_name_phase) + sourceLoop: do i = 1, phase_Nsources(p) + group = trim('current/constituent')//'/'//trim(config_name_phase(p)) + group = trim(group)//'/sources' + + sourceType: select case (phase_source(i,p)) + + case (SOURCE_damage_anisoBrittle_ID) sourceType + group = trim(group)//'/damage_anisoBrittle' + call results_closeGroup(results_addGroup(group)) + call source_damage_anisoBrittle_results(p,group) + case (SOURCE_damage_anisoDuctile_ID) sourceType + group = trim(group)//'/damage_anisoDuctile' + call results_closeGroup(results_addGroup(group)) + call source_damage_anisoDuctile_results(p,group) + case (SOURCE_damage_isoBrittle_ID) sourceType + group = trim(group)//'/damage_isoBrittle' + call results_closeGroup(results_addGroup(group)) + call source_damage_isoBrittle_results(p,group) + case (SOURCE_damage_isoDuctile_ID) sourceType + group = trim(group)//'/damage_isoDuctile' + call results_closeGroup(results_addGroup(group)) + call source_damage_isoDuctile_results(p,group) + end select sourceType + + enddo SourceLoop + enddo + +end subroutine damage_results + + end submodule diff --git a/src/constitutive_plastic.f90 b/src/constitutive_plastic.f90 index ad7e5a54b..873887149 100644 --- a/src/constitutive_plastic.f90 +++ b/src/constitutive_plastic.f90 @@ -1,7 +1,5 @@ submodule(constitutive) constitutive_plastic - implicit none - interface module subroutine plastic_none_init @@ -139,6 +137,38 @@ submodule(constitutive) constitutive_plastic el end subroutine plastic_nonlocal_dependentState + module subroutine plastic_isotropic_results(instance,group) + integer, intent(in) :: instance + character(len=*), intent(in) :: group + end subroutine plastic_isotropic_results + + module subroutine plastic_phenopowerlaw_results(instance,group) + integer, intent(in) :: instance + character(len=*), intent(in) :: group + end subroutine plastic_phenopowerlaw_results + + module subroutine plastic_kinehardening_results(instance,group) + integer, intent(in) :: instance + character(len=*), intent(in) :: group + end subroutine plastic_kinehardening_results + + module subroutine plastic_dislotwin_results(instance,group) + integer, intent(in) :: instance + character(len=*), intent(in) :: group + end subroutine plastic_dislotwin_results + + module subroutine plastic_disloUCLA_results(instance,group) + integer, intent(in) :: instance + character(len=*), intent(in) :: group + end subroutine plastic_disloUCLA_results + + module subroutine plastic_nonlocal_results(instance,group) + integer, intent(in) :: instance + character(len=*), intent(in) :: group + end subroutine plastic_nonlocal_results + + + end interface @@ -252,5 +282,43 @@ module procedure constitutive_plastic_LpAndItsTangents end procedure constitutive_plastic_LpAndItsTangents +module subroutine plastic_results + + integer :: p + character(len=pStringLen) :: group + + plasticityLoop: do p=1,size(config_name_phase) + group = trim('current/constituent')//'/'//trim(config_name_phase(p)) + call results_closeGroup(results_addGroup(group)) + + group = trim(group)//'/plastic' + + call results_closeGroup(results_addGroup(group)) + select case(phase_plasticity(p)) + + case(PLASTICITY_ISOTROPIC_ID) + call plastic_isotropic_results(phase_plasticityInstance(p),group) + + case(PLASTICITY_PHENOPOWERLAW_ID) + call plastic_phenopowerlaw_results(phase_plasticityInstance(p),group) + + case(PLASTICITY_KINEHARDENING_ID) + call plastic_kinehardening_results(phase_plasticityInstance(p),group) + + case(PLASTICITY_DISLOTWIN_ID) + call plastic_dislotwin_results(phase_plasticityInstance(p),group) + + case(PLASTICITY_DISLOUCLA_ID) + call plastic_disloUCLA_results(phase_plasticityInstance(p),group) + + case(PLASTICITY_NONLOCAL_ID) + call plastic_nonlocal_results(phase_plasticityInstance(p),group) + end select + + enddo plasticityLoop + +end subroutine plastic_results + + end submodule constitutive_plastic diff --git a/src/constitutive_thermal.f90 b/src/constitutive_thermal.f90 index 5526fb1d3..ca40e21fa 100644 --- a/src/constitutive_thermal.f90 +++ b/src/constitutive_thermal.f90 @@ -1,7 +1,5 @@ submodule(constitutive) constitutive_thermal - implicit none - interface module subroutine source_thermal_dissipation_init