Expose explosive release balance interfaces

This commit is contained in:
Codex
2026-07-03 13:52:49 +08:00
parent fbbaab3771
commit 111e907509
16 changed files with 569 additions and 35 deletions
+34 -1
View File
@@ -25,7 +25,8 @@ module sph_api
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, &
sph_explosive_get_summary, sph_explosive_set_default_ignition_point
sph_explosive_get_summary, sph_explosive_get_release_balance, &
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, &
@@ -476,6 +477,24 @@ contains
lambda_range, released_totals, detonation_time_range, ierr)
end subroutine sph_get_explosive_summary
subroutine sph_get_explosive_release_balance(mass_values, energy_values, &
momentum_values, ierr)
real(rk), intent(out) :: mass_values(4)
real(rk), intent(out) :: energy_values(2)
real(rk), intent(out) :: momentum_values(3)
integer, intent(out) :: ierr
mass_values = 0.0_rk
energy_values = 0.0_rk
momentum_values = 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_release_balance(mass_values, energy_values, &
momentum_values, ierr)
end subroutine sph_get_explosive_release_balance
subroutine sph_api_require_initialized(ierr)
integer, intent(out) :: ierr
@@ -786,6 +805,20 @@ subroutine sphft_get_explosive_summary(particle_count, reacted_count, &
lambda_range, released_totals, detonation_time_range, ierr)
end subroutine sphft_get_explosive_summary
subroutine sphft_get_explosive_release_balance(mass_values, energy_values, &
momentum_values, ierr)
use sph_api, only: sph_get_explosive_release_balance
use sph_precision, only: rk
implicit none
real(rk), intent(out) :: mass_values(4)
real(rk), intent(out) :: energy_values(2)
real(rk), intent(out) :: momentum_values(3)
integer, intent(out) :: ierr
call sph_get_explosive_release_balance(mass_values, energy_values, &
momentum_values, ierr)
end subroutine sphft_get_explosive_release_balance
subroutine sphft_set_output_directory_chars(chars, count, ierr)
use sph_api, only: sph_set_output_directory
implicit none