restart does not overwrite existing results

This commit is contained in:
Martin Diehl 2020-05-06 17:50:59 +02:00
commit 0f2447d413
7 changed files with 149 additions and 137 deletions

View File

@ -26,7 +26,7 @@ set (COMPILE_FLAGS "${COMPILE_FLAGS} -xf95-cpp-input")
# preprocessor
set (COMPILE_FLAGS "${COMPILE_FLAGS} -fPIC -fPIE")
# position independent conde
# position independent code
set (COMPILE_FLAGS "${COMPILE_FLAGS} -ffree-line-length-132")
# restrict line length to the standard 132 characters (lattice.f90 require more characters)

View File

@ -83,10 +83,10 @@ subroutine CPFEM_initAll(el,ip)
call math_init
call rotations_init
call HDF5_utilities_init
call results_init
call results_init(.false.)
call discretization_marc_init(ip, el)
call lattice_init
call material_init
call material_init(.false.)
call constitutive_init
call crystallite_init
call homogenization_init

View File

@ -52,13 +52,13 @@ subroutine CPFEM_initAll
call rotations_init
call lattice_init
call HDF5_utilities_init
call results_init
call results_init(restart=interface_restartInc>0)
#if defined(Mesh)
call discretization_mesh_init
call discretization_mesh_init(restart=interface_restartInc>0)
#elif defined(Grid)
call discretization_grid_init
call discretization_grid_init(restart=interface_restartInc>0)
#endif
call material_init
call material_init(restart=interface_restartInc>0)
call constitutive_init
call crystallite_init
call homogenization_init

View File

@ -42,7 +42,9 @@ contains
!--------------------------------------------------------------------------------------------------
!> @brief reads the geometry file to obtain information on discretization
!--------------------------------------------------------------------------------------------------
subroutine discretization_grid_init
subroutine discretization_grid_init(restart)
logical, intent(in) :: restart
include 'fftw3-mpi.f03'
real(pReal), dimension(3) :: &
@ -100,13 +102,14 @@ subroutine discretization_grid_init
!--------------------------------------------------------------------------------------------------
! store geometry information for post processing
if(.not. restart) then
call results_openJobFile
call results_closeGroup(results_addGroup('geometry'))
call results_addAttribute('grid', grid, 'geometry')
call results_addAttribute('size', geomSize,'geometry')
call results_addAttribute('origin',origin, 'geometry')
call results_closeJobFile
endif
!--------------------------------------------------------------------------------------------------
! geometry information required by the nonlocal CP model
call geometry_plastic_nonlocal_setIPvolume(reshape([(product(mySize/real(myGrid,pReal)),j=1,product(myGrid))], &

View File

@ -207,7 +207,9 @@ contains
!--------------------------------------------------------------------------------------------------
!> @brief parses material configuration file
!--------------------------------------------------------------------------------------------------
subroutine material_init
subroutine material_init(restart)
logical, intent(in) :: restart
integer :: i,e,m,c,h, myDebug, myPhase, myHomog, myMicro
integer, dimension(:), allocatable :: &
@ -339,11 +341,12 @@ subroutine material_init
call config_deallocate('material.config/microstructure')
call config_deallocate('material.config/texture')
if (.not. restart) then
call results_openJobFile
call results_mapping_constituent(material_phaseAt,material_phaseMemberAt,config_name_phase)
call results_mapping_materialpoint(material_homogenizationAt,material_homogenizationMemberAt,config_name_homogenization)
call results_closeJobFile
endif
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! BEGIN DEPRECATED

View File

@ -63,7 +63,9 @@ contains
!> @brief initializes the mesh by calling all necessary private routines the mesh module
!! Order and routines strongly depend on type of solver
!--------------------------------------------------------------------------------------------------
subroutine discretization_mesh_init
subroutine discretization_mesh_init(restart)
integer, intent(in) :: restart
integer, dimension(1), parameter:: FE_geomtype = [1] !< geometry type of particular element type
integer, dimension(1) :: FE_Nips !< number of IPs in a specific type of element

View File

@ -59,7 +59,9 @@ module results
results_mapping_materialpoint
contains
subroutine results_init
subroutine results_init(restart)
logical, intent(in) :: restart
character(len=pStringLen) :: commandLine
@ -68,6 +70,7 @@ subroutine results_init
write(6,'(/,a)') ' Diehl et al., Integrating Materials and Manufacturing Innovation 6(1):8391, 2017'
write(6,'(a)') ' https://doi.org/10.1007/s40192-017-0084-5'
if(.not. restart) then
resultsFile = HDF5_openFile(trim(getSolverJobName())//'.hdf5','w',.true.)
call results_addAttribute('DADF5_version_major',0)
call results_addAttribute('DADF5_version_minor',6)
@ -77,6 +80,7 @@ subroutine results_init
call results_closeGroup(results_addGroup('mapping'))
call results_closeGroup(results_addGroup('mapping/cellResults'))
call results_closeJobFile
endif
end subroutine results_init