Release FemLite 0.5.2 V5 closeout
FemLite CI / build-test (push) Has been cancelled

This commit is contained in:
shenw
2026-07-01 14:51:40 +08:00
parent 5e90d58d0e
commit 75d4e735b1
82 changed files with 9972 additions and 2613 deletions
+93 -15
View File
@@ -13,6 +13,8 @@ program perf_contact_pair
integer :: ierr
integer :: nfacet
integer :: do_tangent
integer :: step_count
integer :: step
integer :: active_count
integer :: search_facets
integer :: search_masters
@@ -21,6 +23,17 @@ program perf_contact_pair
integer :: search_bvh_nodes
integer :: cache_used
integer :: cache_overflow
integer :: path_active_total
integer :: path_bvh_nodes_total
integer :: path_cache_used_total
integer :: path_cache_overflow_total
integer :: step_search_facets
integer :: step_search_masters
integer :: step_search_broad
integer :: step_search_active
integer :: step_search_bvh_nodes
integer :: step_cache_used
integer :: step_cache_overflow
real(rk) :: search_time
real(rk) :: force_time
real(rk) :: tangent_time
@@ -29,25 +42,41 @@ program perf_contact_pair
nfacet = 64
do_tangent = 1
call parse_args(nfacet, do_tangent)
step_count = 1
call parse_args(nfacet, do_tangent, step_count)
call setup_contact_perf_model(nfacet, ierr)
call exit_if_error(ierr, 'setup_contact_perf_model')
path_active_total = 0
path_bvh_nodes_total = 0
path_cache_used_total = 0
path_cache_overflow_total = 0
call cpu_time(t0)
call contact_apply_plane_forces(ierr)
do step = 1, step_count
call update_slave_path(step, step_count)
call contact_apply_plane_forces(ierr)
call exit_if_error(ierr, 'contact_apply_plane_forces')
if (do_tangent .ne. 0) then
call csr_init(kmat)
call assembly_build_csr_pattern(kmat, ierr)
call exit_if_error(ierr, 'assembly_build_csr_pattern')
call contact_apply_plane_tangent(kmat, ZERO, ierr)
call exit_if_error(ierr, 'contact_apply_plane_tangent')
call csr_free(kmat, ierr)
call exit_if_error(ierr, 'csr_free')
end if
path_active_total = path_active_total + contact_active_count
call contact_get_search_stats(step_search_facets, step_search_masters, &
step_search_broad, step_search_active, &
step_search_bvh_nodes)
call contact_get_cache_stats(step_cache_used, step_cache_overflow)
path_bvh_nodes_total = path_bvh_nodes_total + step_search_bvh_nodes
path_cache_used_total = path_cache_used_total + step_cache_used
path_cache_overflow_total = path_cache_overflow_total + &
step_cache_overflow
end do
call cpu_time(t1)
call exit_if_error(ierr, 'contact_apply_plane_forces')
if (do_tangent .ne. 0) then
call csr_init(kmat)
call assembly_build_csr_pattern(kmat, ierr)
call exit_if_error(ierr, 'assembly_build_csr_pattern')
call contact_apply_plane_tangent(kmat, ZERO, ierr)
call exit_if_error(ierr, 'contact_apply_plane_tangent')
call csr_free(kmat, ierr)
call exit_if_error(ierr, 'csr_free')
end if
active_count = contact_active_count
call contact_get_search_stats(search_facets, search_masters, search_broad, &
@@ -56,12 +85,24 @@ program perf_contact_pair
call contact_get_perf_stats(search_time, force_time, tangent_time)
call require_positive(active_count, 'active_count')
call require_positive(search_bvh_nodes, 'search_bvh_nodes')
if (step_count .eq. 1) then
call require_positive(search_bvh_nodes, 'search_bvh_nodes')
end if
call require_positive(cache_used, 'cache_used')
if (cache_overflow .ne. 0) call die('unexpected contact cache overflow')
call require_positive(path_active_total, 'path_active_total')
call require_positive(path_bvh_nodes_total, 'path_bvh_nodes_total')
call require_positive(path_cache_used_total, 'path_cache_used_total')
if (path_cache_overflow_total .ne. 0) then
call die('unexpected path contact cache overflow')
end if
write(*,'(A)') 'FemLite contact pair performance'
write(*,'(A,I8)') ' facets_per_side: ', nfacet
write(*,'(A,I8)') ' path_steps: ', step_count
write(*,'(A,I8)') ' path_active: ', path_active_total
write(*,'(A,I8)') ' path_bvh_nodes: ', path_bvh_nodes_total
write(*,'(A,I8)') ' path_cache_used: ', path_cache_used_total
write(*,'(A,I8)') ' active_count: ', active_count
write(*,'(A,I8)') ' search_facets: ', search_facets
write(*,'(A,I8)') ' search_masters: ', search_masters
@@ -80,9 +121,10 @@ program perf_contact_pair
contains
subroutine parse_args(nfacet_out, do_tangent_out)
subroutine parse_args(nfacet_out, do_tangent_out, step_count_out)
integer, intent(inout) :: nfacet_out
integer, intent(inout) :: do_tangent_out
integer, intent(inout) :: step_count_out
character(len=64) :: arg
integer :: argc
integer :: ios
@@ -101,9 +143,45 @@ contains
read(arg, *, iostat=ios) do_tangent_out
if (ios .ne. 0) call die('invalid tangent flag argument')
end if
if (argc .ge. 3) then
call getarg(3, arg)
read(arg, *, iostat=ios) step_count_out
if (ios .ne. 0) call die('invalid path step count argument')
end if
if (nfacet_out .lt. 17) call die('facet count must be at least 17')
if (step_count_out .lt. 1) call die('path step count must be positive')
end subroutine parse_args
subroutine update_slave_path(step, step_count_in)
integer, intent(in) :: step
integer, intent(in) :: step_count_in
integer :: elem
integer :: local_node
integer :: node
integer :: dof_z
real(rk) :: phase
real(rk) :: penetration
if (step_count_in .le. 1) then
phase = ZERO
else
phase = real(step - 1, rk) / real(step_count_in - 1, rk)
end if
penetration = 0.01_rk + 0.004_rk * phase
do elem = nfacet + 1, 2 * nfacet
do local_node = 1, elem_nnode(elem)
node = elem_conn(local_node, elem)
dof_z = dof_id(3, node)
if (dof_z .gt. 0) then
u(dof_z) = -penetration
v(dof_z) = -0.004_rk
end if
end do
end do
coord = coord0
end subroutine update_slave_path
subroutine setup_contact_perf_model(nfacet_in, ierr)
integer, intent(in) :: nfacet_in
integer, intent(out) :: ierr
+1 -1
View File
@@ -40,7 +40,7 @@ program perf_p1
call fem_get_version(major, minor, patch, ierr)
call exit_if_error(ierr)
if (major .ne. 0 .or. minor .ne. 5 .or. patch .ne. 1) then
if (major .ne. 0 .or. minor .ne. 5 .or. patch .ne. 2) then
write(*,'(A,I1,A,I1,A,I1)') 'unexpected FemLite version ', major, '.', minor, '.', patch
call exit(3)
end if