Add Explosive interfaces and restart

This commit is contained in:
Codex
2026-07-03 12:32:14 +08:00
parent 5853ac2644
commit 187af844d1
17 changed files with 629 additions and 32 deletions
+67 -1
View File
@@ -24,7 +24,8 @@ module sph_api
sph_gas_get_summary, sph_gas_get_extended_summary, &
sph_gas_get_source_summary, sph_gas_get_bubble_metrics, &
sph_gas_estimate_dt_limits
use sph_explosive, only: sph_explosive_initialize, sph_explosive_reset
use sph_explosive, only: sph_explosive_initialize, sph_explosive_reset, &
sph_explosive_get_summary, sph_explosive_set_default_ignition_point
use sph_solid, only: sph_solid_initialize, sph_solid_reset
use sph_shell, only: sph_shell_initialize, sph_shell_reset
use sph_api_state, only: sph_api_initialized, sph_api_model_built, &
@@ -439,6 +440,42 @@ contains
energy_source, ierr)
end subroutine sph_get_gas_source_summary
subroutine sph_set_ignition_point(x_value, y_value, z_value, time_value, ierr)
real(rk), intent(in) :: x_value
real(rk), intent(in) :: y_value
real(rk), intent(in) :: z_value
real(rk), intent(in) :: time_value
integer, intent(out) :: ierr
real(rk) :: ignition_x(3)
call sph_api_require_initialized(ierr)
if (ierr /= SPH_SUCCESS) return
ignition_x = (/x_value, y_value, z_value/)
call sph_explosive_set_default_ignition_point(ignition_x, time_value, ierr)
end subroutine sph_set_ignition_point
subroutine sph_get_explosive_summary(particle_count, reacted_count, &
lambda_range, released_totals, detonation_time_range, ierr)
integer, intent(out) :: particle_count
integer, intent(out) :: reacted_count
real(rk), intent(out) :: lambda_range(3)
real(rk), intent(out) :: released_totals(5)
real(rk), intent(out) :: detonation_time_range(2)
integer, intent(out) :: ierr
particle_count = 0
reacted_count = 0
lambda_range = 0.0_rk
released_totals = 0.0_rk
detonation_time_range = 0.0_rk
call sph_api_require_initialized(ierr)
if (ierr /= SPH_SUCCESS) return
call sph_api_require_model_built(ierr)
if (ierr /= SPH_SUCCESS) return
call sph_explosive_get_summary(particle_count, reacted_count, &
lambda_range, released_totals, detonation_time_range, ierr)
end subroutine sph_get_explosive_summary
subroutine sph_api_require_initialized(ierr)
integer, intent(out) :: ierr
@@ -720,6 +757,35 @@ subroutine sphft_get_gas_source_summary(mass_source, momentum_source, &
energy_source, ierr)
end subroutine sphft_get_gas_source_summary
subroutine sphft_set_ignition_point(x_value, y_value, z_value, time_value, ierr)
use sph_api, only: sph_set_ignition_point
use sph_precision, only: rk
implicit none
real(rk), intent(in) :: x_value
real(rk), intent(in) :: y_value
real(rk), intent(in) :: z_value
real(rk), intent(in) :: time_value
integer, intent(out) :: ierr
call sph_set_ignition_point(x_value, y_value, z_value, time_value, ierr)
end subroutine sphft_set_ignition_point
subroutine sphft_get_explosive_summary(particle_count, reacted_count, &
lambda_range, released_totals, detonation_time_range, ierr)
use sph_api, only: sph_get_explosive_summary
use sph_precision, only: rk
implicit none
integer, intent(out) :: particle_count
integer, intent(out) :: reacted_count
real(rk), intent(out) :: lambda_range(3)
real(rk), intent(out) :: released_totals(5)
real(rk), intent(out) :: detonation_time_range(2)
integer, intent(out) :: ierr
call sph_get_explosive_summary(particle_count, reacted_count, &
lambda_range, released_totals, detonation_time_range, ierr)
end subroutine sphft_get_explosive_summary
subroutine sphft_set_output_directory_chars(chars, count, ierr)
use sph_api, only: sph_set_output_directory
implicit none