DAMASK_EICMD/src/materialpoint.f90

159 lines
4.5 KiB
Fortran
Raw Normal View History

!--------------------------------------------------------------------------------------------------
!> @author Franz Roters, Max-Planck-Institut für Eisenforschung GmbH
!> @author Philip Eisenlohr, Max-Planck-Institut für Eisenforschung GmbH
!> @brief needs a good name and description
!--------------------------------------------------------------------------------------------------
2022-05-03 16:30:28 +05:30
module materialpoint
2021-07-08 17:57:04 +05:30
use parallelization
2022-04-24 08:13:44 +05:30
use CLI
2023-11-25 20:29:00 +05:30
use system_routines
use signal
use prec
2023-04-14 14:00:03 +05:30
use misc
use IO
2020-04-28 13:59:13 +05:30
use YAML_types
2020-05-22 00:11:40 +05:30
use YAML_parse
2021-07-08 17:57:04 +05:30
use HDF5
use HDF5_utilities
2023-01-19 22:07:45 +05:30
use result
use config
use math
use rotations
2022-01-31 19:35:15 +05:30
use polynomials
use tables
2023-07-15 23:58:57 +05:30
use crystal
use material
use phase
use homogenization
use discretization
#if defined(MESH)
2020-03-20 19:25:10 +05:30
use FEM_quadrature
2020-03-20 19:38:07 +05:30
use discretization_mesh
#elif defined(GRID)
use base64
2020-03-20 11:28:55 +05:30
use discretization_grid
2019-06-11 19:46:10 +05:30
#endif
implicit none(type,external)
2020-01-27 01:45:21 +05:30
public
2019-05-15 02:42:32 +05:30
contains
!--------------------------------------------------------------------------------------------------
!> @brief Initialize all modules.
!--------------------------------------------------------------------------------------------------
2022-12-07 22:59:03 +05:30
subroutine materialpoint_initAll()
2022-12-07 22:59:03 +05:30
call parallelization_init()
call CLI_init() ! grid and mesh commandline interface
2023-11-25 20:29:00 +05:30
call system_routines_init()
2023-01-19 22:07:45 +05:30
call signal_init()
2022-12-07 22:59:03 +05:30
call prec_init()
2023-04-14 14:00:03 +05:30
call misc_init()
2022-12-07 22:59:03 +05:30
call IO_init()
#if defined(MESH)
2022-12-07 22:59:03 +05:30
call FEM_quadrature_init()
#elif defined(GRID)
2022-12-07 22:59:03 +05:30
call base64_init()
#endif
2022-12-07 22:59:03 +05:30
call YAML_types_init()
call YAML_parse_init()
call HDF5_utilities_init()
2023-01-19 22:07:45 +05:30
call result_init(restart=CLI_restartInc>0)
2022-12-07 22:59:03 +05:30
call config_init()
call math_init()
call rotations_init()
call polynomials_init()
call tables_init()
2023-07-15 23:58:57 +05:30
call crystal_init()
#if defined(MESH)
call discretization_mesh_init(restart=CLI_restartInc>0)
#elif defined(GRID)
call discretization_grid_init(restart=CLI_restartInc>0)
2020-03-20 11:28:55 +05:30
#endif
call material_init(restart=CLI_restartInc>0)
2022-12-07 22:59:03 +05:30
call phase_init()
call homogenization_init()
call materialpoint_init()
2023-02-27 17:04:03 +05:30
call config_material_deallocate()
2022-04-24 21:05:59 +05:30
end subroutine materialpoint_initAll
2019-12-07 19:50:04 +05:30
!--------------------------------------------------------------------------------------------------
2020-02-25 22:23:15 +05:30
!> @brief Read restart information if needed.
!--------------------------------------------------------------------------------------------------
2022-12-07 22:59:03 +05:30
subroutine materialpoint_init()
2019-06-11 19:46:10 +05:30
2020-12-30 02:01:22 +05:30
integer(HID_T) :: fileHandle
2020-12-30 04:44:48 +05:30
2022-04-24 21:05:59 +05:30
print'(/,1x,a)', '<<<+- materialpoint init -+>>>'; flush(IO_STDOUT)
2019-06-11 19:46:10 +05:30
2020-12-30 02:01:22 +05:30
if (CLI_restartInc > 0) then
2023-06-28 15:53:00 +05:30
print'(/,1x,a,1x,i0)', 'loading restart information of increment',CLI_restartInc; flush(IO_STDOUT)
fileHandle = HDF5_openFile(getSolverJobName()//'_restart.hdf5','r')
2020-12-30 02:01:22 +05:30
2020-12-30 04:44:48 +05:30
call homogenization_restartRead(fileHandle)
2021-02-09 03:51:53 +05:30
call phase_restartRead(fileHandle)
2020-12-30 02:01:22 +05:30
call HDF5_closeFile(fileHandle)
2022-12-02 00:14:53 +05:30
end if
2020-02-25 22:23:15 +05:30
2022-04-24 21:05:59 +05:30
end subroutine materialpoint_init
2018-12-05 04:25:39 +05:30
2020-02-25 22:23:15 +05:30
!--------------------------------------------------------------------------------------------------
!> @brief Write restart information.
!--------------------------------------------------------------------------------------------------
2022-12-07 22:59:03 +05:30
subroutine materialpoint_restartWrite()
2020-12-30 04:44:48 +05:30
2020-12-30 02:01:22 +05:30
integer(HID_T) :: fileHandle
2020-12-30 04:44:48 +05:30
2020-12-30 02:01:22 +05:30
2023-06-21 15:07:00 +05:30
print'(1x,a)', 'saving field and constitutive data required for restart';flush(IO_STDOUT)
2020-12-30 02:01:22 +05:30
fileHandle = HDF5_openFile(getSolverJobName()//'_restart.hdf5','a')
2020-12-30 02:01:22 +05:30
2020-12-30 04:44:48 +05:30
call homogenization_restartWrite(fileHandle)
2021-02-09 03:51:53 +05:30
call phase_restartWrite(fileHandle)
2020-02-25 22:23:15 +05:30
2020-12-30 02:01:22 +05:30
call HDF5_closeFile(fileHandle)
2020-02-25 22:23:15 +05:30
2022-04-24 21:05:59 +05:30
end subroutine materialpoint_restartWrite
2020-02-25 22:23:15 +05:30
!--------------------------------------------------------------------------------------------------
!> @brief Forward data for new time increment.
!--------------------------------------------------------------------------------------------------
2022-12-07 22:59:03 +05:30
subroutine materialpoint_forward()
2020-02-25 22:23:15 +05:30
2022-12-07 22:59:03 +05:30
call homogenization_forward()
call phase_forward()
2020-02-25 22:23:15 +05:30
2022-04-24 21:05:59 +05:30
end subroutine materialpoint_forward
2018-12-05 04:25:39 +05:30
!--------------------------------------------------------------------------------------------------
!> @brief Trigger writing of results.
2018-12-05 04:25:39 +05:30
!--------------------------------------------------------------------------------------------------
2023-01-19 22:07:45 +05:30
subroutine materialpoint_result(inc,time)
integer, intent(in) :: inc
real(pREAL), intent(in) :: time
2023-01-19 22:07:45 +05:30
call result_openJobFile()
call result_addIncrement(inc,time)
call phase_result()
call homogenization_result()
call discretization_result()
call result_finalizeIncrement()
call result_closeJobFile()
2018-12-05 04:25:39 +05:30
2023-01-19 22:07:45 +05:30
end subroutine materialpoint_result
2018-12-05 04:25:39 +05:30
2022-05-03 16:30:28 +05:30
end module materialpoint