program test_coupling_shell_pressure_081 use sph_precision, only: rk use sph_error, only: SPH_SUCCESS use sph_api, only: sph_initialize, sph_finalize, sph_read_inp, & sph_build_model, sph_advance_explicit use sph_database, only: v, SPH_COUPLING_DISTRIBUTION_AREA use sph_coupling_interface, only: sph_coupling_apply_facet_pressures implicit none integer :: ierr integer :: ids(3) real(rk) :: pressures(3) call sph_initialize(ierr) call assert_ok(ierr, 'initialize failed for shell pressure') call sph_read_inp('tests/data/coupling_load_mode_081.inp', ierr) call assert_ok(ierr, 'read failed for shell pressure') call sph_build_model(ierr) call assert_ok(ierr, 'build failed for shell pressure') ids = (/ 1, 2, 3 /) pressures = (/ 50.0_rk, 30.0_rk, 10.0_rk /) call sph_coupling_apply_facet_pressures(1, 3, ids, pressures, & SPH_COUPLING_DISTRIBUTION_AREA, 401, ierr) call assert_ok(ierr, 'shell pressure import failed') call sph_advance_explicit(1.0e-7_rk, ierr) call assert_ok(ierr, 'shell pressure advance failed') if (v(3,1) <= 0.0_rk) call fail('shell pressure response missing') if (v(3,2) <= 0.0_rk) call fail('shell pressure response missing on facet 2') call sph_finalize(ierr) call assert_ok(ierr, 'finalize failed for shell pressure') contains subroutine assert_ok(ierr_value, message) integer, intent(in) :: ierr_value character(len=*), intent(in) :: message if (ierr_value /= SPH_SUCCESS) call fail(message) end subroutine assert_ok subroutine fail(message) character(len=*), intent(in) :: message write(*, '(A)') trim(message) stop 1 end subroutine fail end program test_coupling_shell_pressure_081