Release FemLite 0.6.1
FemLite CI / build-test (push) Has been cancelled

This commit is contained in:
shenw
2026-07-01 22:41:16 +08:00
parent 175531e24d
commit 5e081806fb
32 changed files with 2819 additions and 238 deletions
+87 -1
View File
@@ -6,7 +6,10 @@ program test_contact
use fem_contact_state, only: CONTACT_PAIR_ACTIVATED, &
CONTACT_PAIR_MAINTAINED, CONTACT_PAIR_RELEASED, &
contact_get_search_stats, contact_get_perf_stats, contact_get_cache_stats, &
contact_get_pair_stats
contact_get_pair_stats, CONTACT_STATE_OPEN, CONTACT_STATE_CLOSED_STICK, &
CONTACT_STATE_CLOSED_SLIP, CONTACT_STATE_CLOSED_RESTICK, &
CONTACT_STATE_SEPARATING, CONTACT_STATE_FAILED_PROJECTION, &
contact_state_name, contact_get_state_summary
use fem_contact_candidate_cache, only: contact_candidate_cache_stats
use fem_contact_history, only: contact_history_stats, &
contact_history_state_stats
@@ -24,6 +27,7 @@ program test_contact
real(rk), parameter :: TOL = 1.0e-10_rk
call check_contact_state_names()
call check_plane_force()
call check_target_node_only()
call check_analytic_pair_plane_force()
@@ -41,6 +45,25 @@ program test_contact
contains
subroutine check_contact_state_names()
character(len=64) :: name
call contact_state_name(CONTACT_STATE_OPEN, name)
if (trim(name) .ne. 'open') call fail(9100)
call contact_state_name(CONTACT_STATE_CLOSED_STICK, name)
if (trim(name) .ne. 'closed-stick') call fail(9101)
call contact_state_name(CONTACT_STATE_CLOSED_SLIP, name)
if (trim(name) .ne. 'closed-slip') call fail(9102)
call contact_state_name(CONTACT_STATE_CLOSED_RESTICK, name)
if (trim(name) .ne. 'closed-restick') call fail(9103)
call contact_state_name(CONTACT_STATE_SEPARATING, name)
if (trim(name) .ne. 'separating') call fail(9104)
call contact_state_name(CONTACT_STATE_FAILED_PROJECTION, name)
if (trim(name) .ne. 'failed-projection') call fail(9105)
call contact_state_name(-999, name)
if (trim(name) .ne. 'unknown') call fail(9106)
end subroutine check_contact_state_names
subroutine check_multiplier_history()
integer :: ierr
integer :: slot_count
@@ -214,6 +237,19 @@ contains
real(rk) :: conv_relative_residual
real(rk) :: conv_contact_gap
real(rk) :: conv_combined_norm
real(rk) :: gap_max
real(rk) :: gap_mean
real(rk) :: gap_l2
real(rk) :: slip_increment
real(rk) :: slip_residual
real(rk) :: friction_residual
integer :: open_count
integer :: closed_stick_count
integer :: closed_slip_count
integer :: closed_restick_count
integer :: separating_count
integer :: failed_projection_count
integer :: active_set_flip_count
call fem_initialize(ierr)
if (ierr .ne. FEM_SUCCESS) call fail(145)
@@ -276,6 +312,24 @@ contains
call check_close(conv_relative_residual, ZERO, 154)
call check_close(conv_contact_gap, 0.01_rk, 155)
call check_close(conv_combined_norm, 0.01_rk, 156)
call fem_get_contact_state_summary(open_count, closed_stick_count, &
closed_slip_count, closed_restick_count, separating_count, &
failed_projection_count, gap_max, gap_mean, gap_l2, slip_increment, &
slip_residual, friction_residual, active_set_flip_count, ierr)
if (ierr .ne. FEM_SUCCESS) call fail(157)
if (open_count .ne. 0) call fail(158)
if (closed_stick_count .ne. 1) call fail(159)
if (closed_slip_count .ne. 0) call fail(160)
if (closed_restick_count .ne. 0) call fail(161)
if (separating_count .ne. 0) call fail(162)
if (failed_projection_count .ne. 0) call fail(163)
call check_close(gap_max, 0.01_rk, 164)
call check_close(gap_mean, 0.01_rk, 165)
call check_close(gap_l2, 0.01_rk, 166)
call check_close(slip_increment, ZERO, 167)
call check_close(slip_residual, ZERO, 168)
call check_close(friction_residual, ZERO, 169)
if (active_set_flip_count .ne. 1) call fail(170)
u(dof) = 0.01_rk
call contact_apply_plane_forces(ierr)
@@ -284,6 +338,13 @@ contains
if (contact_pair_status(1) .ne. CONTACT_PAIR_RELEASED) call fail(141)
if (contact_pair_release_count(1) .ne. 1) call fail(142)
call check_close(contact_pair_aug_lambda(1), ZERO, 143)
call fem_get_contact_state_summary(open_count, closed_stick_count, &
closed_slip_count, closed_restick_count, separating_count, &
failed_projection_count, gap_max, gap_mean, gap_l2, slip_increment, &
slip_residual, friction_residual, active_set_flip_count, ierr)
if (ierr .ne. FEM_SUCCESS) call fail(171)
if (separating_count .ne. 1) call fail(172)
if (active_set_flip_count .ne. 2) call fail(173)
call fem_finalize(ierr)
if (ierr .ne. FEM_SUCCESS) call fail(144)
@@ -469,6 +530,19 @@ contains
integer :: dof
integer :: row
integer :: col
integer :: open_count
integer :: closed_stick_count
integer :: closed_slip_count
integer :: closed_restick_count
integer :: separating_count
integer :: failed_projection_count
integer :: active_set_flip_count
real(rk) :: gap_max
real(rk) :: gap_mean
real(rk) :: gap_l2
real(rk) :: slip_increment
real(rk) :: slip_residual
real(rk) :: friction_residual
real(rk) :: value
call setup_contact_shell_pair(ierr)
@@ -498,6 +572,16 @@ contains
call check_close(contact_friction_work_total, 2.0_rk, 505)
call check_close(contact_pair_friction_work(1), 2.0_rk, 506)
call check_close(contact_pair_fric_work_total(1), 2.0_rk, 507)
call contact_get_state_summary(open_count, closed_stick_count, &
closed_slip_count, closed_restick_count, separating_count, &
failed_projection_count, gap_max, gap_mean, gap_l2, slip_increment, &
slip_residual, friction_residual, active_set_flip_count)
if (closed_slip_count .ne. 1) call fail(508)
if (closed_stick_count .ne. 0) call fail(509)
if (failed_projection_count .ne. 0) call fail(5140)
if (slip_increment .le. ZERO) call fail(5141)
if (slip_residual .le. ZERO) call fail(5142)
if (friction_residual .le. ZERO) call fail(5143)
call csr_init(kmat)
call assembly_build_csr_pattern(kmat, ierr)
@@ -684,6 +768,8 @@ contains
'friction_work,friction_work_total,friction_regularization,ftx,fty,ftz,'// &
'status,activation_count,release_count,gap_residual,gap_mean,'// &
'gap_l2,failed_projection_count,active_set_flip_count,'// &
'open_count,closed_stick_count,closed_slip_count,'// &
'closed_restick_count,separating_count,state_failed_projection_count,'// &
'aug_factor,aug_lambda', 601)
call require_contains('contact_00000910.csv', &
'search_facets,search_masters,search_candidates,search_active,'// &