Complete V4.7 shell stabilization and benchmarks
FemLite CI / build-test (push) Has been cancelled

This commit is contained in:
shenw
2026-06-25 10:07:48 +08:00
parent c2db5f59c6
commit d8dbc0b346
22 changed files with 1434 additions and 24 deletions
+86
View File
@@ -671,6 +671,92 @@ contains
residual_norm, status_code, ierr)
end subroutine fem_get_linear_solver_stats
subroutine fem_set_shell_stabilization(drilling_factor, s3_shear_factor, &
s3_shear_min_scale, ierr)
real(rk), intent(in) :: drilling_factor
real(rk), intent(in) :: s3_shear_factor
real(rk), intent(in) :: s3_shear_min_scale
integer, intent(out) :: ierr
if (.not. api_initialized) then
call error_set(FEM_ERR_INTERNAL, &
'fem_set_shell_stabilization called before fem_initialize', ierr)
return
end if
if (drilling_factor .lt. ZERO .or. drilling_factor .gt. ONE) then
call error_set(FEM_ERR_INPUT, 'shell drilling factor is out of range', ierr)
return
end if
if (s3_shear_factor .lt. ZERO) then
call error_set(FEM_ERR_INPUT, 'S3 shear locking factor is negative', ierr)
return
end if
if (s3_shear_min_scale .le. ZERO .or. s3_shear_min_scale .gt. ONE) then
call error_set(FEM_ERR_INPUT, 'S3 shear minimum scale is out of range', ierr)
return
end if
shell_drilling_stiffness_factor = drilling_factor
shell3_shear_locking_factor = s3_shear_factor
shell3_shear_locking_min_scale = s3_shear_min_scale
ierr = FEM_SUCCESS
end subroutine fem_set_shell_stabilization
subroutine fem_get_shell_stabilization(drilling_factor, s3_shear_factor, &
s3_shear_min_scale, ierr)
real(rk), intent(out) :: drilling_factor
real(rk), intent(out) :: s3_shear_factor
real(rk), intent(out) :: s3_shear_min_scale
integer, intent(out) :: ierr
drilling_factor = 1.0e-4_rk
s3_shear_factor = 0.0625_rk
s3_shear_min_scale = 1.0e-4_rk
if (.not. api_initialized) then
call error_set(FEM_ERR_INTERNAL, &
'fem_get_shell_stabilization called before fem_initialize', ierr)
return
end if
drilling_factor = shell_drilling_stiffness_factor
s3_shear_factor = shell3_shear_locking_factor
s3_shear_min_scale = shell3_shear_locking_min_scale
ierr = FEM_SUCCESS
end subroutine fem_get_shell_stabilization
subroutine fem_get_shell_stability_stats(sample_count, last_element, &
last_drilling_stiffness, &
last_shear_scale, min_shear_scale, &
max_drilling_stiffness, ierr)
integer, intent(out) :: sample_count
integer, intent(out) :: last_element
real(rk), intent(out) :: last_drilling_stiffness
real(rk), intent(out) :: last_shear_scale
real(rk), intent(out) :: min_shear_scale
real(rk), intent(out) :: max_drilling_stiffness
integer, intent(out) :: ierr
sample_count = 0
last_element = 0
last_drilling_stiffness = ZERO
last_shear_scale = ONE
min_shear_scale = ONE
max_drilling_stiffness = ZERO
if (.not. api_initialized) then
call error_set(FEM_ERR_INTERNAL, &
'fem_get_shell_stability_stats called before fem_initialize', ierr)
return
end if
sample_count = shell_stability_sample_count
last_element = shell_stability_last_elem
last_drilling_stiffness = shell_stability_last_drilling
last_shear_scale = shell_stab_last_shear_scale
min_shear_scale = shell_stability_min_shear_scale
max_drilling_stiffness = shell_stability_max_drilling
ierr = FEM_SUCCESS
end subroutine fem_get_shell_stability_stats
subroutine fem_get_boundary_facet_count(num_facets, max_face_nodes, ierr)
integer, intent(out) :: num_facets
integer, intent(out) :: max_face_nodes
+18
View File
@@ -45,6 +45,9 @@ module fem_control
real(rk) :: line_search_reduction = 0.5_rk
real(rk) :: line_search_accept_ratio = 0.95_rk
real(rk) :: cutback_factor = 0.5_rk
real(rk) :: shell_drilling_stiffness_factor = 1.0e-4_rk
real(rk) :: shell3_shear_locking_factor = 0.0625_rk
real(rk) :: shell3_shear_locking_min_scale = 1.0e-4_rk
integer :: current_step = 0
integer :: nstep_max = 0
integer :: analysis_type = ANALYSIS_EXPLICIT_DYNAMIC
@@ -58,6 +61,8 @@ module fem_control
integer :: linear_solver_last_prec = LPRECOND_JACOBI
integer :: linear_solver_last_iter = 0
integer :: linear_solver_last_status = LS_STATUS_IDLE
integer :: shell_stability_sample_count = 0
integer :: shell_stability_last_elem = 0
integer :: convergence_increment = 0
integer :: convergence_iteration = 0
integer :: convergence_cutback_count = 0
@@ -69,6 +74,10 @@ module fem_control
real(rk) :: convergence_contact_gap_norm = ZERO
real(rk) :: convergence_combined_norm = ZERO
real(rk) :: linear_solver_last_resid = ZERO
real(rk) :: shell_stability_last_drilling = ZERO
real(rk) :: shell_stab_last_shear_scale = ONE
real(rk) :: shell_stability_min_shear_scale = ONE
real(rk) :: shell_stability_max_drilling = ZERO
real(rk) :: convergence_last_dt = ZERO
real(rk) :: convergence_last_accepted_time = ZERO
logical :: convergence_converged = .false.
@@ -101,6 +110,9 @@ contains
line_search_reduction = 0.5_rk
line_search_accept_ratio = 0.95_rk
cutback_factor = 0.5_rk
shell_drilling_stiffness_factor = 1.0e-4_rk
shell3_shear_locking_factor = 0.0625_rk
shell3_shear_locking_min_scale = 1.0e-4_rk
current_step = 0
nstep_max = 0
analysis_type = ANALYSIS_EXPLICIT_DYNAMIC
@@ -114,6 +126,8 @@ contains
linear_solver_last_prec = LPRECOND_JACOBI
linear_solver_last_iter = 0
linear_solver_last_status = LS_STATUS_IDLE
shell_stability_sample_count = 0
shell_stability_last_elem = 0
convergence_increment = 0
convergence_iteration = 0
convergence_cutback_count = 0
@@ -125,6 +139,10 @@ contains
convergence_contact_gap_norm = ZERO
convergence_combined_norm = ZERO
linear_solver_last_resid = ZERO
shell_stability_last_drilling = ZERO
shell_stab_last_shear_scale = ONE
shell_stability_min_shear_scale = ONE
shell_stability_max_drilling = ZERO
convergence_last_dt = ZERO
convergence_last_accepted_time = ZERO
convergence_converged = .false.
+8 -3
View File
@@ -1553,9 +1553,9 @@ contains
end if
eps = ZERO
eps(1) = strain_mem(1)
eps(2) = strain_mem(2)
eps(4) = strain_mem(3)
eps(1) = strain_mem(1) + HALF * thickness * strain_ben(1)
eps(2) = strain_mem(2) + HALF * thickness * strain_ben(2)
eps(4) = strain_mem(3) + HALF * thickness * strain_ben(3)
eps(5) = strain_shr(1)
eps(6) = strain_shr(2)
deps = eps - strain(:,gp)
@@ -1576,6 +1576,11 @@ contains
force_mem(3) = thickness * sig(4)
force_shr(1) = (5.0_rk / 6.0_rk) * thickness * sig(5)
force_shr(2) = (5.0_rk / 6.0_rk) * thickness * sig(6)
if (maxval(abs(strain_ben)) .gt. tiny(ONE)) then
force_ben(1) = thickness * thickness * sig(1) / 6.0_rk
force_ben(2) = thickness * thickness * sig(2) / 6.0_rk
force_ben(3) = thickness * thickness * sig(4) / 6.0_rk
end if
if (state_new(4) .ge. HALF) then
elem_status(elem) = 1
+29 -7
View File
@@ -1,6 +1,7 @@
module fem_element_stiffness
use fem_precision
use fem_error
use fem_control
use fem_database
use fem_element_topology
use fem_quadrature
@@ -10,8 +11,6 @@ module fem_element_stiffness
private
real(rk), parameter :: SHELL_DRILLING_STIFFNESS_FACTOR = 1.0e-4_rk
public :: element_linear_stiffness
contains
@@ -195,7 +194,10 @@ contains
ke(1:n_elem_dof,1:n_elem_dof) = matmul(transpose(transform), tmp)
call add_shell_drilling_stiffness(NLOCAL, basis, &
coeff_mem * weight * &
SHELL_DRILLING_STIFFNESS_FACTOR, ke)
shell_drilling_stiffness_factor, ke)
call record_shell_stability(elem, coeff_mem * weight * &
shell_drilling_stiffness_factor, &
shell3_shear_locking_scale(thickness, weight))
ierr = FEM_SUCCESS
end subroutine shell3_linear_stiffness
@@ -306,7 +308,9 @@ contains
ke(1:n_elem_dof,1:n_elem_dof) = matmul(transpose(transform), tmp)
call add_shell_drilling_stiffness(NLOCAL, basis, &
coeff_mem * area * &
SHELL_DRILLING_STIFFNESS_FACTOR, ke)
shell_drilling_stiffness_factor, ke)
call record_shell_stability(elem, coeff_mem * area * &
shell_drilling_stiffness_factor, ONE)
ierr = FEM_SUCCESS
end subroutine shell4_linear_stiffness
@@ -404,7 +408,9 @@ contains
ke(1:n_elem_dof,1:n_elem_dof) = matmul(transpose(transform), tmp)
call add_shell_drilling_stiffness(nlocal, basis, &
coeff_mem * area * &
SHELL_DRILLING_STIFFNESS_FACTOR, ke)
shell_drilling_stiffness_factor, ke)
call record_shell_stability(elem, coeff_mem * area * &
shell_drilling_stiffness_factor, ONE)
ierr = FEM_SUCCESS
end subroutine shell_general_linear_stiffness
@@ -929,10 +935,26 @@ contains
! Linear triangular Mindlin shells are prone to thin-shell shear locking.
ratio = thickness / hchar
shell3_shear_locking_scale = min(ONE, max(1.0e-4_rk, &
0.0625_rk * ratio * ratio))
shell3_shear_locking_scale = min(ONE, &
max(shell3_shear_locking_min_scale, &
shell3_shear_locking_factor * ratio * ratio))
end function shell3_shear_locking_scale
subroutine record_shell_stability(elem, drilling_stiffness, shear_scale)
integer, intent(in) :: elem
real(rk), intent(in) :: drilling_stiffness
real(rk), intent(in) :: shear_scale
shell_stability_sample_count = shell_stability_sample_count + 1
shell_stability_last_elem = elem
shell_stability_last_drilling = drilling_stiffness
shell_stab_last_shear_scale = shear_scale
shell_stability_min_shear_scale = &
min(shell_stability_min_shear_scale, shear_scale)
shell_stability_max_drilling = &
max(shell_stability_max_drilling, drilling_stiffness)
end subroutine record_shell_stability
subroutine shell_apply_section_tangent(mat, thickness, gp, dmem, dben, dshr, ierr)
integer, intent(in) :: mat
real(rk), intent(in) :: thickness
+59
View File
@@ -26,6 +26,9 @@
#define F_SET_LINSOL FC_GLOBAL(femlite_f_set_linsol, FEMLITE_F_SET_LINSOL)
#define F_GET_LINSOL_SETTINGS FC_GLOBAL(femlite_f_get_linsol_settings, FEMLITE_F_GET_LINSOL_SETTINGS)
#define F_GET_LINSOL_STATS FC_GLOBAL(femlite_f_get_linsol_stats, FEMLITE_F_GET_LINSOL_STATS)
#define F_SET_SHELL_STAB FC_GLOBAL(femlite_f_set_shell_stab, FEMLITE_F_SET_SHELL_STAB)
#define F_GET_SHELL_STAB FC_GLOBAL(femlite_f_get_shell_stab, FEMLITE_F_GET_SHELL_STAB)
#define F_GET_SHELL_STAB_STATS FC_GLOBAL(femlite_f_get_shell_stab_stats, FEMLITE_F_GET_SHELL_STAB_STATS)
#define F_GET_CONTACT_SUMMARY FC_GLOBAL(femlite_f_get_contact_summary, FEMLITE_F_GET_CONTACT_SUMMARY)
#define F_GET_CONTACT_DIAG FC_GLOBAL(femlite_f_get_contact_diag, FEMLITE_F_GET_CONTACT_DIAG)
#define F_GET_CONTACT_FRICTION FC_GLOBAL(femlite_f_get_contact_friction, FEMLITE_F_GET_CONTACT_FRICTION)
@@ -78,6 +81,21 @@ extern void F_GET_LINSOL_STATS(int *method,
double *residual_norm,
int *status_code,
int *ierr);
extern void F_SET_SHELL_STAB(double *drilling_factor,
double *s3_shear_factor,
double *s3_shear_min_scale,
int *ierr);
extern void F_GET_SHELL_STAB(double *drilling_factor,
double *s3_shear_factor,
double *s3_shear_min_scale,
int *ierr);
extern void F_GET_SHELL_STAB_STATS(int *sample_count,
int *last_element,
double *last_drilling_stiffness,
double *last_shear_scale,
double *min_shear_scale,
double *max_drilling_stiffness,
int *ierr);
extern void F_GET_CONTACT_SUMMARY(int *active_count,
double *work_step,
double *work_total,
@@ -348,6 +366,47 @@ int femlite_get_linear_solver_stats(int *method,
return ierr;
}
int femlite_set_shell_stabilization(double drilling_factor,
double s3_shear_factor,
double s3_shear_min_scale)
{
int ierr = 0;
F_SET_SHELL_STAB(&drilling_factor, &s3_shear_factor,
&s3_shear_min_scale, &ierr);
return ierr;
}
int femlite_get_shell_stabilization(double *drilling_factor,
double *s3_shear_factor,
double *s3_shear_min_scale)
{
int ierr = 0;
if (!drilling_factor || !s3_shear_factor || !s3_shear_min_scale) {
return -1;
}
F_GET_SHELL_STAB(drilling_factor, s3_shear_factor,
s3_shear_min_scale, &ierr);
return ierr;
}
int femlite_get_shell_stability_stats(int *sample_count,
int *last_element,
double *last_drilling_stiffness,
double *last_shear_scale,
double *min_shear_scale,
double *max_drilling_stiffness)
{
int ierr = 0;
if (!sample_count || !last_element || !last_drilling_stiffness ||
!last_shear_scale || !min_shear_scale || !max_drilling_stiffness) {
return -1;
}
F_GET_SHELL_STAB_STATS(sample_count, last_element,
last_drilling_stiffness, last_shear_scale,
min_shear_scale, max_drilling_stiffness, &ierr);
return ierr;
}
int femlite_get_contact_summary(int *active_count,
double *work_step,
double *work_total,
+49
View File
@@ -248,6 +248,55 @@ subroutine femlite_f_get_linsol_stats(method, preconditioner, iteration, &
residual_norm, status_code, ierr)
end subroutine femlite_f_get_linsol_stats
subroutine femlite_f_set_shell_stab(drilling_factor, s3_shear_factor, &
s3_shear_min_scale, ierr)
use fem_api
use fem_precision
implicit none
real(rk), intent(in) :: drilling_factor
real(rk), intent(in) :: s3_shear_factor
real(rk), intent(in) :: s3_shear_min_scale
integer, intent(out) :: ierr
call fem_set_shell_stabilization(drilling_factor, s3_shear_factor, &
s3_shear_min_scale, ierr)
end subroutine femlite_f_set_shell_stab
subroutine femlite_f_get_shell_stab(drilling_factor, s3_shear_factor, &
s3_shear_min_scale, ierr)
use fem_api
use fem_precision
implicit none
real(rk), intent(out) :: drilling_factor
real(rk), intent(out) :: s3_shear_factor
real(rk), intent(out) :: s3_shear_min_scale
integer, intent(out) :: ierr
call fem_get_shell_stabilization(drilling_factor, s3_shear_factor, &
s3_shear_min_scale, ierr)
end subroutine femlite_f_get_shell_stab
subroutine femlite_f_get_shell_stab_stats(sample_count, last_element, &
last_drilling_stiffness, &
last_shear_scale, min_shear_scale, &
max_drilling_stiffness, ierr)
use fem_api
use fem_precision
implicit none
integer, intent(out) :: sample_count
integer, intent(out) :: last_element
real(rk), intent(out) :: last_drilling_stiffness
real(rk), intent(out) :: last_shear_scale
real(rk), intent(out) :: min_shear_scale
real(rk), intent(out) :: max_drilling_stiffness
integer, intent(out) :: ierr
call fem_get_shell_stability_stats(sample_count, last_element, &
last_drilling_stiffness, &
last_shear_scale, min_shear_scale, &
max_drilling_stiffness, ierr)
end subroutine femlite_f_get_shell_stab_stats
subroutine femlite_f_clear_sph(ierr)
use fem_api
implicit none