From 72ab936ec38f8fc63b1c993b067f9ab70bc842d0 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sun, 23 May 2021 00:10:46 +0200 Subject: [PATCH] cleaning --- src/config.f90 | 2 +- src/material.f90 | 30 ++++++++++++------------------ src/math.f90 | 3 +-- src/parallelization.f90 | 6 +++--- src/phase.f90 | 4 ++-- src/prec.f90 | 2 +- src/results.f90 | 3 +-- 7 files changed, 21 insertions(+), 29 deletions(-) diff --git a/src/config.f90 b/src/config.f90 index 02b16f2a2..7d75cb444 100644 --- a/src/config.f90 +++ b/src/config.f90 @@ -92,7 +92,7 @@ end subroutine parse_debug !-------------------------------------------------------------------------------------------------- !> @brief Deallocate config_material. -!ToDo: deallocation of numerics debug (optional) +!ToDo: deallocation of numerics and debug (optional) !-------------------------------------------------------------------------------------------------- subroutine config_deallocate diff --git a/src/material.f90 b/src/material.f90 index 662dc2fa2..9d67fc34c 100644 --- a/src/material.f90 +++ b/src/material.f90 @@ -32,18 +32,15 @@ module material material_name_homogenization !< name of each homogenization integer, dimension(:), allocatable, public, protected :: & ! (elem) - material_homogenizationAt, & !< homogenization ID of each element - material_homogenizationID, & !< per cell - material_homogenizationEntry !< per cell - integer, dimension(:,:), allocatable :: & ! (ip,elem) - material_homogenizationMemberAt !< position of the element within its homogenization instance + material_homogenizationAt, & !< homogenization ID of each element TODO: remove + material_homogenizationID, & !< per cell TODO: material_ID_homogenization + material_homogenizationEntry !< per cell TODO: material_entry_homogenization integer, dimension(:,:), allocatable, public, protected :: & ! (constituent,elem) - material_phaseAt, & !< phase ID of each element - material_phaseID, & !< per (constituent,cell) - material_phaseEntry !< per (constituent,cell) + material_phaseAt, & !< phase ID of each element TODO: remove + material_phaseID, & !< per (constituent,cell) TODO: material_ID_phase + material_phaseEntry !< per (constituent,cell) TODO: material_entry_phase integer, dimension(:,:,:), allocatable, public, protected :: & ! (constituent,IP,elem) - material_phaseMemberAt !< position of the element within its phase instance - + material_phaseMemberAt !TODO: remove public :: & tRotationContainer, & material_orientation0, & @@ -118,7 +115,6 @@ subroutine parse() allocate(counterHomogenization(homogenizations%length),source=0) allocate(material_homogenizationAt(discretization_Nelems),source=0) - allocate(material_homogenizationMemberAt(discretization_nIPs,discretization_Nelems),source=0) allocate(material_phaseAt(homogenization_maxNconstituents,discretization_Nelems),source=0) allocate(material_phaseMemberAt(homogenization_maxNconstituents,discretization_nIPs,discretization_Nelems),source=0) @@ -136,9 +132,8 @@ subroutine parse() do ip = 1, discretization_nIPs ce = (el-1)*discretization_nIPs + ip counterHomogenization(material_homogenizationAt(el)) = counterHomogenization(material_homogenizationAt(el)) + 1 - material_homogenizationMemberAt(ip,el) = counterHomogenization(material_homogenizationAt(el)) - material_homogenizationID(ce) = material_homogenizationAt(el) - material_homogenizationEntry(ce) = material_homogenizationMemberAt(ip,el) + material_homogenizationEntry(ce) = counterHomogenization(material_homogenizationAt(el)) + material_homogenizationID(ce) = material_homogenizationAt(el) enddo frac = 0.0_pReal @@ -150,10 +145,9 @@ subroutine parse() do ip = 1, discretization_nIPs ce = (el-1)*discretization_nIPs + ip counterPhase(material_phaseAt(co,el)) = counterPhase(material_phaseAt(co,el)) + 1 - material_phaseMemberAt(co,ip,el) = counterPhase(material_phaseAt(co,el)) - - material_phaseID(co,ce) = material_phaseAt(co,el) - material_phaseEntry(co,ce) = material_phaseMemberAt(co,ip,el) + material_phaseMemberAt(co,ip,el) = counterPhase(material_phaseAt(co,el)) + material_phaseEntry(co,ce) = counterPhase(material_phaseAt(co,el)) + material_phaseID(co,ce) = material_phaseAt(co,el) enddo enddo diff --git a/src/math.f90 b/src/math.f90 index 6ef942677..5b2cedacb 100644 --- a/src/math.f90 +++ b/src/math.f90 @@ -1140,8 +1140,7 @@ end function math_areaTriangle !-------------------------------------------------------------------------------------------------- -!> @brief limits a scalar value to a certain range (either one or two sided) -! Will return NaN if left > right +!> @brief Limit a scalar value to a certain range (either one or two sided). !-------------------------------------------------------------------------------------------------- real(pReal) pure elemental function math_clip(a, left, right) diff --git a/src/parallelization.f90 b/src/parallelization.f90 index e850ff04d..ee8e71006 100644 --- a/src/parallelization.f90 +++ b/src/parallelization.f90 @@ -27,7 +27,7 @@ module parallelization contains !-------------------------------------------------------------------------------------------------- -!> @brief calls subroutines that reads material, numerics and debug configuration files +!> @brief Initialize shared memory (openMP) and distributed memory (MPI) parallelization. !-------------------------------------------------------------------------------------------------- subroutine parallelization_init @@ -42,8 +42,8 @@ subroutine parallelization_init ! If openMP is enabled, check if the MPI libary supports it and initialize accordingly. ! Otherwise, the first call to PETSc will do the initialization. call MPI_Init_Thread(MPI_THREAD_FUNNELED,threadLevel,err) - if (err /= 0) error stop 'MPI init failed' - if (threadLevel @brief report precision and do self test +!> @brief Report precision and do self test. !-------------------------------------------------------------------------------------------------- subroutine prec_init diff --git a/src/results.f90 b/src/results.f90 index 31b2db856..97a3b2489 100644 --- a/src/results.f90 +++ b/src/results.f90 @@ -423,7 +423,7 @@ subroutine results_mapping_phase(ID,entry,label) integer, dimension(size(entry,1),size(entry,2)) :: & entryGlobal - integer, dimension(size(label),0:worldsize-1) :: entryOffset !< offset in entry counting per process + integer, dimension(size(label),0:worldsize-1) :: entryOffset !< offset in entry counting per process integer, dimension(0:worldsize-1) :: writeSize !< amount of data written per process integer(HSIZE_T), dimension(2) :: & myShape, & !< shape of the dataset (this process) @@ -718,7 +718,6 @@ end subroutine results_mapping_homogenization !-------------------------------------------------------------------------------------------------- subroutine executionStamp(path,description,SIunit) - character(len=*), intent(in) :: path,description character(len=*), intent(in), optional :: SIunit