From 18b342497555fec5b6d841fe866e093a698d390d Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sun, 25 Jul 2021 10:11:19 +0200 Subject: [PATCH] handle twin and slip systems --- src/lattice.f90 | 2 +- ...phase_mechanical_plastic_phenopowerlaw.f90 | 39 +++++++++++-------- src/results.f90 | 10 ++--- 3 files changed, 28 insertions(+), 23 deletions(-) diff --git a/src/lattice.f90 b/src/lattice.f90 index 725c36ba8..bf48fe019 100644 --- a/src/lattice.f90 +++ b/src/lattice.f90 @@ -2062,7 +2062,7 @@ function getlabels(active,potential,system) result(labels) enddo normal label(i:i) = ')' - labels(s) = label + labels(a) = label enddo activeSystems enddo activeFamilies diff --git a/src/phase_mechanical_plastic_phenopowerlaw.f90 b/src/phase_mechanical_plastic_phenopowerlaw.f90 index e4d84df0b..4f66e5f18 100644 --- a/src/phase_mechanical_plastic_phenopowerlaw.f90 +++ b/src/phase_mechanical_plastic_phenopowerlaw.f90 @@ -372,28 +372,33 @@ module subroutine plastic_phenopowerlaw_results(ph,group) integer, intent(in) :: ph character(len=*), intent(in) :: group - integer :: o + integer :: ou + associate(prm => param(ph), stt => state(ph)) - outputsLoop: do o = 1,size(prm%output) - select case(trim(prm%output(o))) - case('xi_sl') - call results_writeState_slip(stt%xi_sl,group,trim(prm%output(o)),prm%systems_sl, & - 'resistance against plastic slip','Pa') - case('gamma_sl') - call results_writeState_slip(stt%gamma_sl,group,trim(prm%output(o)),prm%systems_sl, & - 'plastic shear','1') + do ou = 1,size(prm%output) - case('xi_tw') - if(prm%sum_N_tw>0) call results_writeDataset(stt%xi_tw,group,trim(prm%output(o)), & - 'resistance against twinning','Pa') - case('gamma_tw') - if(prm%sum_N_tw>0) call results_writeDataset(stt%gamma_tw,group,trim(prm%output(o)), & - 'twinning shear','1') + select case(trim(prm%output(ou))) + + case('xi_sl') + call results_writePhaseState(stt%xi_sl,group,trim(prm%output(ou)),prm%systems_sl, & + 'resistance against plastic slip','Pa') + case('gamma_sl') + call results_writePhaseState(stt%gamma_sl,group,trim(prm%output(ou)),prm%systems_sl, & + 'plastic shear','1') + + case('xi_tw') + call results_writePhaseState(stt%xi_tw,group,trim(prm%output(ou)),prm%systems_tw, & + 'resistance against twinning','Pa') + case('gamma_tw') + call results_writePhaseState(stt%gamma_tw,group,trim(prm%output(ou)),prm%systems_tw, & + 'twinning shear','1') + + end select + + enddo - end select - enddo outputsLoop end associate end subroutine plastic_phenopowerlaw_results diff --git a/src/results.f90 b/src/results.f90 index fdf50a437..79745a2f3 100644 --- a/src/results.f90 +++ b/src/results.f90 @@ -53,7 +53,7 @@ module results results_openGroup, & results_closeGroup, & results_writeDataset, & - results_writeState_slip, & + results_writePhaseState, & results_setLink, & results_addAttribute, & results_removeLink, & @@ -361,7 +361,7 @@ end subroutine results_writeVectorDataset_real !-------------------------------------------------------------------------------------------------- !> @brief Store real vector dataset with associated metadata for slip !-------------------------------------------------------------------------------------------------- -subroutine results_writeState_slip(dataset,group,label,systems,description,SIunit) +subroutine results_writePhaseState(dataset,group,label,systems,description,SIunit) character(len=*), intent(in) :: label,group,description,SIunit real(pReal), intent(in), dimension(:,:) :: dataset @@ -370,15 +370,15 @@ subroutine results_writeState_slip(dataset,group,label,systems,description,SIuni integer(HID_T) :: groupHandle - if (size(systems) == 0) return + if (size(systems)*size(dataset,2) == 0 ) return !ToDo: maybe use for other results_write (not sure about scalar) groupHandle = results_openGroup(group) call HDF5_write(dataset,groupHandle,label) call executionStamp(group//'/'//label,description,SIunit) - call HDF5_addAttribute(resultsFile,'slip_systems',systems,group//'/'//label) + call HDF5_addAttribute(resultsFile,'systems',systems,group//'/'//label) call HDF5_closeGroup(groupHandle) -end subroutine results_writeState_slip +end subroutine results_writePhaseState !--------------------------------------------------------------------------------------------------