Harden coupling diagnostics and pressure wave smoke

This commit is contained in:
Codex
2026-07-03 00:00:53 +08:00
parent 7e98da3301
commit f22fa74038
5 changed files with 123 additions and 60 deletions
+23 -2
View File
@@ -6,7 +6,8 @@ program test_input
use sph_input_reader, only: sph_input_get_warning_count
use sph_database, only: material_count, section_count, nset_count, &
elset_count, element_count, coupling_region_count, particle_phase, &
SPH_PHASE_WATER
coupling_region_type, SPH_PHASE_WATER, SPH_REGION_COUPLING_CONTACT, &
SPH_REGION_COUPLING_CONTINUUM
implicit none
integer :: ierr
@@ -20,13 +21,17 @@ program test_input
if (elset_count <= 0) call fail('element set metadata was not saved')
if (element_count <= 0) call fail('element metadata was not saved')
if (coupling_region_count <= 0) call fail('coupling region metadata was not saved')
if (coupling_region_type(1) /= SPH_REGION_COUPLING_CONTACT) then
call fail('contact coupling region type mismatch')
end if
call sph_finalize(ierr)
call assert_ok(ierr, 'finalize failed after metadata check')
call check_good_input('tests/data/mixed_case_011.inp', 2, .false.)
call check_good_input('tests/data/output_control_011.inp', 2, .false.)
call check_good_input('tests/data/coupling_region_011.inp', 2, .false.)
call check_coupling_region_type('tests/data/coupling_region_011.inp', &
SPH_REGION_COUPLING_CONTINUUM)
call check_good_input('tests/data/water_material_case_021.inp', 4, .false.)
call check_good_input('tests/data/water_eos_no_p0_021.inp', 1, .false.)
call check_good_input('tests/data/water_eos_with_b_021.inp', 1, .false.)
@@ -107,6 +112,22 @@ contains
end if
end subroutine check_good_input
subroutine check_coupling_region_type(filename, expected_type)
character(len=*), intent(in) :: filename
integer, intent(in) :: expected_type
call sph_initialize(ierr)
call assert_ok(ierr, 'initialize failed for coupling type input')
call sph_read_inp(filename, ierr)
call assert_ok(ierr, 'coupling type input read failed')
call sph_build_model(ierr)
call assert_ok(ierr, 'coupling type model build failed')
if (coupling_region_count <= 0) call fail('coupling type region missing')
if (coupling_region_type(1) /= expected_type) call fail('coupling type mismatch')
call sph_finalize(ierr)
call assert_ok(ierr, 'finalize failed after coupling type input')
end subroutine check_coupling_region_type
subroutine check_repeat_read_replaces_model()
call sph_initialize(ierr)
call assert_ok(ierr, 'initialize failed for repeat read')