From 12b1c7e641ae19672de94dbe7af04298eea3f9e8 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Wed, 23 Dec 2020 14:37:12 +0100 Subject: [PATCH] one loop is enough --- src/constitutive_mech.f90 | 7 +++++++ src/homogenization.f90 | 23 ++++++++++------------- src/homogenization_mech.f90 | 6 ------ 3 files changed, 17 insertions(+), 19 deletions(-) diff --git a/src/constitutive_mech.f90 b/src/constitutive_mech.f90 index 800e67b32..197169c7a 100644 --- a/src/constitutive_mech.f90 +++ b/src/constitutive_mech.f90 @@ -3,6 +3,13 @@ !---------------------------------------------------------------------------------------------------- submodule(constitutive) constitutive_mech + enum, bind(c); enumerator :: & + ELASTICITY_UNDEFINED_ID, & + ELASTICITY_HOOKE_ID, & + STIFFNESS_DEGRADATION_UNDEFINED_ID, & + STIFFNESS_DEGRADATION_DAMAGE_ID + end enum + integer(kind(ELASTICITY_undefined_ID)), dimension(:), allocatable :: & phase_elasticity !< elasticity of each phase integer(kind(SOURCE_undefined_ID)), dimension(:,:), allocatable :: & diff --git a/src/homogenization.f90 b/src/homogenization.f90 index 00bb5fc6a..8334e99b2 100644 --- a/src/homogenization.f90 +++ b/src/homogenization.f90 @@ -164,11 +164,13 @@ subroutine materialpoint_stressAndItsTangent(dt) integer :: ce -!-------------------------------------------------------------------------------------------------- -! initialize restoration points + +!$OMP PARALLEL DO PRIVATE(ce,myNgrains,NiterationMPstate,NiterationHomog) do el = FEsolving_execElem(1),FEsolving_execElem(2) do ip = FEsolving_execIP(1),FEsolving_execIP(2); +!-------------------------------------------------------------------------------------------------- +! initialize restoration points call constitutive_initializeRestorationPoints(ip,el) subFrac(ip,el) = 0.0_pReal @@ -183,19 +185,12 @@ subroutine materialpoint_stressAndItsTangent(dt) if (damageState(material_homogenizationAt(el))%sizeState > 0) & damageState(material_homogenizationAt(el))%subState0(:,material_homogenizationMemberAt(ip,el)) = & damageState(material_homogenizationAt(el))%State0( :,material_homogenizationMemberAt(ip,el)) - enddo - enddo NiterationHomog = 0 - cutBackLooping: do while (.not. terminallyIll .and. & - any(subStep(FEsolving_execIP(1):FEsolving_execIP(2),& - FEsolving_execElem(1):FEsolving_execElem(2)) > num%subStepMinHomog)) + cutBackLooping: do while (.not. terminallyIll .and. subStep(ip,el) > num%subStepMinHomog) - !$OMP PARALLEL DO PRIVATE(ce,myNgrains,NiterationMPstate) - elementLooping1: do el = FEsolving_execElem(1),FEsolving_execElem(2) myNgrains = homogenization_Nconstituents(material_homogenizationAt(el)) - IpLooping1: do ip = FEsolving_execIP(1),FEsolving_execIP(2) if (converged(ip,el)) then subFrac(ip,el) = subFrac(ip,el) + subStep(ip,el) @@ -283,14 +278,16 @@ subroutine materialpoint_stressAndItsTangent(dt) endif enddo convergenceLooping - enddo IpLooping1 - enddo elementLooping1 - !$OMP END PARALLEL DO + NiterationHomog = NiterationHomog + 1 enddo cutBackLooping + enddo + enddo + !$OMP END PARALLEL DO + if (.not. terminallyIll ) then call crystallite_orientations() ! calculate crystal orientations !$OMP PARALLEL DO diff --git a/src/homogenization_mech.f90 b/src/homogenization_mech.f90 index 7fff6f55b..56f1e554f 100644 --- a/src/homogenization_mech.f90 +++ b/src/homogenization_mech.f90 @@ -5,12 +5,6 @@ submodule(homogenization) homogenization_mech - enum, bind(c); enumerator :: & - ELASTICITY_UNDEFINED_ID, & - ELASTICITY_HOOKE_ID, & - STIFFNESS_DEGRADATION_UNDEFINED_ID, & - STIFFNESS_DEGRADATION_DAMAGE_ID - end enum interface module subroutine mech_none_init