Add contact property inp support

This commit is contained in:
shenw
2026-06-24 19:01:13 +08:00
parent aff82622f0
commit 7c16004a60
10 changed files with 666 additions and 194 deletions
+34 -1
View File
@@ -7,7 +7,11 @@ program test_implicit_inp
contact_pair_damping, contact_pair_search, &
contact_pair_friction, n_surface, surface_name, &
surface_start, surface_count, surface_target, &
surface_face, surface_owner, surface_type
surface_face, surface_owner, surface_type, &
n_contact_property, contact_property_name, &
contact_property_penalty, contact_property_damping, &
contact_property_search, contact_property_friction, &
contact_pair_property
use fem_database_surface, only: db_contact_facet_match, &
db_contact_facet_normal_sign, &
db_contact_facet_has_side
@@ -457,15 +461,44 @@ contains
if (ierr .ne. 0) call fail(478)
call check_node_surface_inp()
call check_contact_property_inp()
call check_contact_pair_input_errors()
end subroutine check_contact_pair_inp
subroutine check_contact_property_inp()
integer :: ierr
call fem_initialize(ierr)
if (ierr .ne. 0) call fail(530)
call fem_read_inp('tests/data/s4_contact_property.inp', ierr)
if (ierr .ne. 0) call fail(531)
if (n_contact_property .ne. 1) call fail(532)
if (trim(contact_property_name(1)) .ne. 'PROP1') call fail(533)
call check_close(contact_property_penalty(1), 1000.0_rk, 534)
call check_close(contact_property_damping(1), 2.0_rk, 535)
call check_close(contact_property_search(1), 0.1_rk, 536)
call check_close(contact_property_friction(1), 0.2_rk, 537)
if (trim(contact_pair_property(1)) .ne. 'PROP1') call fail(538)
call fem_build_model(ierr)
if (ierr .ne. 0) call fail(539)
call check_close(contact_pair_penalty(1), 1000.0_rk, 540)
call check_close(contact_pair_damping(1), 2.0_rk, 541)
call check_close(contact_pair_search(1), 0.1_rk, 542)
call check_close(contact_pair_friction(1), 0.2_rk, 543)
call fem_finalize(ierr)
if (ierr .ne. 0) call fail(544)
end subroutine check_contact_property_inp
subroutine check_contact_pair_input_errors()
call check_contact_pair_inp_error('tests/data/s4_contact_pair_missing_slave.inp', 401)
call check_contact_pair_inp_error('tests/data/s4_contact_pair_missing_master.inp', 404)
call check_contact_pair_inp_error('tests/data/s4_contact_pair_missing_penalty.inp', 407)
call check_contact_pair_build_error('tests/data/s4_contact_pair_surface_bad_face.inp', 415)
call check_contact_pair_inp_error('tests/data/s4_contact_pair_surface_bad_type.inp', 445)
call check_contact_pair_build_error('tests/data/s4_contact_pair_unknown_property.inp', 548)
end subroutine check_contact_pair_input_errors
subroutine check_node_surface_inp()