Add explicit restart support

This commit is contained in:
shenw
2026-06-22 23:49:30 +08:00
parent 5d1e6e5526
commit 6ff7630b25
5 changed files with 545 additions and 0 deletions
+25
View File
@@ -15,6 +15,7 @@ module fem_api
use fem_contact
use fem_output_csv
use fem_output_vtk
use fem_restart
implicit none
logical :: api_initialized = .false.
@@ -583,6 +584,30 @@ contains
call output_vtk_write(step, ierr)
end subroutine fem_write_output
subroutine fem_write_restart(filename, ierr)
character(len=*), intent(in) :: filename
integer, intent(out) :: ierr
if (.not. api_initialized) then
call error_set(FEM_ERR_INTERNAL, 'fem_write_restart called before fem_initialize', ierr)
return
end if
call restart_write(filename, ierr)
end subroutine fem_write_restart
subroutine fem_read_restart(filename, ierr)
character(len=*), intent(in) :: filename
integer, intent(out) :: ierr
if (.not. api_initialized) then
call error_set(FEM_ERR_INTERNAL, 'fem_read_restart called before fem_initialize', ierr)
return
end if
call restart_read(filename, ierr)
end subroutine fem_read_restart
subroutine fem_estimate_stable_dt(dtcrit, ierr)
real(rk), intent(out) :: dtcrit
integer, intent(out) :: ierr