Complete V5 acceptance milestone

This commit is contained in:
shenw
2026-06-26 12:54:40 +08:00
parent 26639d8dc2
commit a01a4fda24
105 changed files with 8694 additions and 8922 deletions
+248 -16
View File
@@ -43,7 +43,7 @@
- node-based surface、analytical rigid plane surface 和 contact property 查询/输入子集。
- contact pair active-set、gap residual 和 augmented penalty 诊断接口。
- contact pair 搜索统计接口,用于 V4.4 搜索/并行性能验收。
- 线性求解器设置和最近一次线性求解统计接口,用于 V4.6 内部/外部求解路径切换验收。
- 线性求解器设置和最近一次线性求解统计接口,用于 V4.6 内部求解路径切换验收。
- 壳 drilling/S3 剪切锁定控制和稳定性统计接口,用于 V4.7 壳基准验收。
## 3. 接口设计原则
@@ -200,6 +200,148 @@ fem_compute_lumped_mass
- `fem_build_model` 负责内部编号、自由度、facet 和状态变量数据库构建。
- `fem_compute_lumped_mass` 负责形成显式动力学所需集中质量。
### 8.1 Mohr-Coulomb 材料输入子集
第五版当前支持 Abaqus 风格材料块中的 `*MOHR COULOMB` 子集。该关键字必须位于
`*MATERIAL` 块内,且材料仍需通过 `*ELASTIC` 提供弹性模量和泊松比。数据行格式为:
```inp
*MOHR COULOMB
friction_angle_deg, cohesion, dilation_angle_deg, tensile_strength
residual_friction_angle_deg, residual_cohesion, residual_dilation_angle_deg, reduction_factor
```
约定:
- 角度以 degree 输入,内部转换为 radian。
- `friction_angle_deg` 必须在 `(0, 90)` 内。
- `cohesion`、`tensile_strength` 和 `residual_cohesion` 必须非负。
- `dilation_angle_deg` 必须在 `[0, friction_angle_deg]` 内。
- `reduction_factor < 1` 按 1 处理;大于 1 时用于强度折减材料参数。
- 残余摩擦角、残余黏聚力和残余膨胀角作为折减下限。
解析后数据库字段包括 `mat_mc_phi`、`mat_mc_cohesion`、`mat_mc_dilation`、
`mat_mc_tension`、`mat_mc_res_phi`、`mat_mc_res_cohesion`、
`mat_mc_res_dilation` 和 `mat_mc_reduction`。材料模型名称写入
`mat_plastic_model='MOHR_COULOMB'`,由材料分发层进入 Mohr-Coulomb 更新和切线路径。
### 8.2 Benchmark 工具输入子集
`tools/benchmarks` 下的程序是验收编排工具,不属于 `fem_read_inp` 的通用
Abaqus 子集。它们可以读取小型专用输入以驱动核心模块验证,但不得把专用
keyword 宣称为主求解器接口。
`euler_column_buckling_benchmark` 当前读取如下专用块:
```inp
*BUCKLING COLUMN
E, I, L, element_count, effective_length_factor
```
字段含义:
- `E`:弹性模量。
- `I`:梁截面二次矩。
- `L`:柱长。
- `element_count`:Euler-Bernoulli 梁单元数量,当前要求不少于 2。
- `effective_length_factor`:Euler 解析临界载荷中的有效长度系数。
该工具装配梁弯曲刚度,调用生产 `geom_beam2d_column_stiffness` 和
`buckling_dense_solve`,输出 `buckling_summary.csv` 与 `buckling_mode_1.csv`。
主 `femlite` 可执行程序当前尚未承诺通用 `*BUCKLING` step 解析、预载 step
联动或模态 VTK 输出;这些仍属于 V5.5 后续工程接口。
`corrugated_shell_buckling_benchmark` 当前读取如下专用块:
```inp
*CORRUGATED SHELL BUCKLING
sectors, selected_wave, output_mode_count, bottom_radius, top_radius, height, thickness
young, poisson, stiffness_coupling_ratio, geometric_coupling_ratio, corrugation_factor
```
字段含义:
- `sectors`:周期扇区数。
- `selected_wave`:要与全模型特征值比较的循环波数。
- `output_mode_count`:写入 modal CSV 的低阶模态数量。
- `bottom_radius`、`top_radius`、`height`、`thickness`:参考波纹锥壳尺度。
- `young`、`poisson`:材料弹性参数。
- `stiffness_coupling_ratio`、`geometric_coupling_ratio`:周期相邻扇区刚度和几何刚度耦合比例。
- `corrugation_factor`:波纹增强因子,用于形成紧凑 benchmark 的基础弯曲刚度。
该工具输出 `corrugated_buckling_summary.csv`、`corrugated_buckling_waves.csv`、
`corrugated_buckling_modes.csv` 和 `corrugated_buckling_profile.csv`。它用于
验证内部屈曲求解、循环波数一致性和 modal CSV 输出,不代表主求解器已经支持
完整 Abaqus 风格屈曲 step。
`roll_forming_kinematics_benchmark` 当前读取如下专用块:
```inp
*ROLLER KINEMATICS
radius, normal_force, mu, feed_rate, down_rate, angular_speed, reference_speed, duration, samples
```
字段含义:
- `radius`:刚体辊半径。
- `normal_force`:用于牵引和压力指标的参考法向力。
- `mu`:摩擦系数。
- `feed_rate`、`down_rate`:进给和下压速度。
- `angular_speed`:绕辊轴角速度。
- `reference_speed`:正则化牵引中的滑移速度尺度;0 表示经典 Coulomb 幅值。
- `duration`、`samples`:输出历史采样时间和采样数。
该工具输出 `roller_kinematics_history.csv` 和
`roller_kinematics_summary.csv`,用于验证角速度进入接触相对切向速度、正则化
牵引、摩擦能、压力和扭矩指标。它不是主 `femlite` 输入语法的一部分。
`roll_forming_springback_benchmark` 当前读取如下专用块:
```inp
*ROLL FORMING SPRINGBACK
thickness, half_width, strips, layers, length, radius, feed_total, down_total,
angular_speed, normal_force, mu, reference_speed, duration, E, nu, yield,
hardening, target_curvature, samples
```
字段含义:
- `thickness`、`half_width`、`strips`、`layers`:紧凑多层工件截面离散。
- `length`:用于残余位移和回弹位移指标的跨距。
- `radius`、`feed_total`、`down_total`、`angular_speed`、`normal_force`、`mu`、
`reference_speed`、`duration` 和 `samples`:滚压运动学、牵引和历史采样参数。
- `E`、`nu`、`yield` 和 `hardening`:J2 小应变材料点参数。
- `target_curvature`:成形目标曲率。
该工具输出 `springback_history.csv`、`springback_summary.csv` 和
`plastic_zone.csv`,用于验证塑性功、塑性区、成形力、卸载残余弯矩、残余位移
和 springback ratio。它同样不是主 `femlite` 输入语法的一部分。
`ball_adhesion_cohesive_benchmark` 当前读取如下专用块:
```inp
*BALL ADHESION COHESIVE
ball_radius, contact_radius, rings, samples, duration, max_indentation,
max_opening, normal_stiffness, tangent_stiffness, normal_strength,
tangent_strength, fracture_energy_i, fracture_energy_ii, mode_mix_eta,
compression_factor, slip_ratio
```
字段含义:
- `ball_radius`、`contact_radius`:球半径和 compact 粘附区半径。
- `rings`、`samples`:同心环数量和 force-displacement 采样点数。
- `max_indentation`、`max_opening`:压入和拉脱位移幅值。
- `normal/tangent_stiffness`、`normal/tangent_strength`、`fracture_energy_i/ii`、
`mode_mix_eta` 和 `compression_factor`:传给 `cohesive_params_init` 的
traction-separation 参数。
- `slip_ratio`:拉脱阶段切向滑移与正开口的比例。
该工具输出 `adhesion_history.csv`、`adhesion_summary.csv` 和
`decohesion_profile.csv`,用于验证 force-displacement hysteresis、peak pull-off
force、cohesive energy、damage 和 decohesion area。它同样不是主 `femlite`
输入语法的一部分。
## 9. 求解控制接口
```fortran
@@ -609,26 +751,30 @@ subroutine fem_get_linear_solver_stats(method, preconditioner, iteration, &
integer, intent(out) :: status_code
integer, intent(out) :: ierr
end subroutine
subroutine fem_get_linsol_diagnostics(matrix_class, initial_residual, &
final_residual, relative_residual, &
status_code, ierr)
integer, intent(out) :: matrix_class
real(rk), intent(out) :: initial_residual
real(rk), intent(out) :: final_residual
real(rk), intent(out) :: relative_residual
integer, intent(out) :: status_code
integer, intent(out) :: ierr
end subroutine
```
说明:
- `method` 使用 `LSOLVER_CG=1`、`LSOLVER_BICGSTAB=2`、`LSOLVER_GMRES=3`、`LSOLVER_EXTERNAL=100`。
- `method` 使用 `LSOLVER_CG=1`、`LSOLVER_BICGSTAB=2`、`LSOLVER_GMRES=3`。
- `preconditioner` 使用 `LPRECOND_NONE=0`、`LPRECOND_JACOBI=1`。
- `status_code` 使用 `LS_STATUS_IDLE=0`、`LS_STATUS_CONVERGED=1`、`LS_STATUS_FAILED=-1`、`LS_STATUS_UNSUPPORTED=-2`。
- `status_code` 使用 `LS_STATUS_IDLE=0`、`LS_STATUS_CONVERGED=1`、`LS_STATUS_FAILED=-1`。
- CG 主要面向对称正定系统;BiCGSTAB 和 GMRES 可用于非对称 CSR 小系统。
- `LSOLVER_EXTERNAL` 通过独立 backend 枚举选择外部求解路径。当前接口包含
`NONE`、`SUPERLU`、`MUMPS`、`MKL_PARDISO`、`REF_DIRECT` 和 `FILE`;未编译
的第三方库后端返回 unavailable/unsupported,`REF_DIRECT` 和 `FILE` 用于默认
构建下的 adapter 验证。
- file-exchange 后端由 `femlite_configure_linear_solver_external_file` 配置 prefix、
command、auto-run、keep-files、index-base 和 storage。command 支持 `{matrix}`、
`{rhs}`、`{solution}`、`{csr}`、`{manifest}`、`{tol}`、`{max_iter}` 等模板 token,
并支持 `{manifest:q}` 形式的命令行引用。
- `femlite_get_linear_solver_external_info` 查询当前外部 backend、可用性和能力位;
`femlite_get_linear_solver_external_diag` 查询最近一次外部 CSR 请求摘要;
`femlite_get_linear_solver_external_file_diag` 查询 file-exchange 的导出、命令和
residual audit 摘要。
- `matrix_class` 使用 `FEMLITE_CSR_CLASS_GENERAL=1`、`STRUCT_SYM=2`、
`SYMMETRIC=3`、`SPD_CAND=4`。分发层在调用内部 Krylov 求解器前
分析 CSR 图案、对角项和数值对称性,并记录初始残差、最终残差和最终相对残差。
- 非上述 method 值为非法配置;旧外部求解器 method 数值也必须返回错误,并保持当前
method/preconditioner 设置不变。
- 静力、隐式 Newmark 和非线性 Newton 修正方程均通过同一分发层求解。
### 12.7 壳稳定控制
@@ -820,6 +966,90 @@ Restart 说明:
- v2 在 DOF、单元状态和高斯点状态之后追加 `CONTACT_HISTORY` 段,用于保存 mortar 积分点摩擦历史槽。
- 读入端兼容旧的 v1 文件;若旧文件没有 `CONTACT_HISTORY` 段,则读入时清空当前接触历史。
V5.7 cohesive 生产模块当前提供 Fortran 内部接口,尚未新增 C ABI 包装:
```fortran
subroutine cohesive_params_init(kn, kt, tn0, tt0, gi, gii, eta, &
comp_factor, params, ierr)
subroutine cohesive_trial_update(params, opening, slip, old_damage, &
old_max_eff, traction_n, traction_t, &
tangent_n, tangent_t, new_damage, &
new_max_eff, dissipated, status, ierr)
subroutine cohesive_state_store_trial(pair, selem, sface, melem, mface, &
point_id, damage, max_opening, &
max_effective, energy_delta, status, &
ierr)
subroutine cohesive_state_write(unit_id, ios)
subroutine cohesive_state_read(unit_id, count_in, ierr)
subroutine cohesive_metrics_add(state, status, damage, opening, effective, &
area, cohesive_energy, elastic_energy, ierr)
```
`cohesive_trial_update` 的状态码为 `OPEN=0`、`BONDED=1`、`DAMAGING=2`、
`FAILED=3`、`COMPRESS=4`。`energy_delta` 必须为非负耗散增量;state 层会将
damage、最大开口、最大有效分离和能量做不可逆累计。独立 cohesive state
restart 段的文本头为 `COHESIVE_STATE count`,随后逐槽写出 pair/slave/master
索引、point id、status、damage、maximum opening、maximum effective separation、
energy 和 trial energy。主 `femlite` restart 文件尚未接入 cohesive state 段;
当前 V5.7 单点验收通过模块级 write/read 验证 restart 语义。
V5.8 颗粒生产模块当前提供 Fortran 内部接口,尚未新增 C ABI 包装:
```fortran
subroutine particle_add(ext_id, position, velocity, radius, mass, slot, ierr)
subroutine particle_kinetic_energy(energy, ierr)
subroutine particle_momentum(momentum, total_mass, ierr)
subroutine particle_contact_init(kn, cn, kt, mu, kwall, cwall, params, ierr)
subroutine pstep_advance(ctrl, params, walls, nwall, diag, ierr)
subroutine pstep_diag_values(diag, dt, mass_before, mass_after, &
momentum_before, momentum_after, &
kinetic_before, kinetic_after, &
dissipated_energy, max_overlap, ierr)
subroutine pfacet_step_cloud(nparticle, slots, nfacet, max_nodes, &
facet_nnode, coords, velocities, params, &
node_loads, stats, ierr)
subroutine pfacet_step_summary(stats, particle_count, contact_count, &
max_overlap, total_energy, total_power, &
force_norm, ierr)
subroutine particle_fem_apply_all(params, clear_particle_forces, stats, ierr)
subroutine particle_fem_stats_summary(stats, particle_count, contact_count, &
max_overlap, total_energy, total_power, &
force_norm, ierr)
subroutine particle_fem_stats_force_norms(stats, particle_force_norm, &
node_force_norm, ierr)
subroutine pfacet_force_balance(nnode, node_forces, particle_force, &
residual, ierr)
```
`pstep_diag_values` 使用 `particle_step_diag%dissipated_power * dt` 输出单步
`dissipated_energy`;质量、动量和动能分别来自 step 前后状态。facet coupling
路径的总质量、动量和动能通过 `particle_momentum` 与 `particle_kinetic_energy`
查询,节点载荷平衡通过 `pfacet_force_balance` 查询。`test_particle_acceptance`
覆盖这些 Fortran 输出路径。`particle_fem_apply_all` 从当前 FEM 边界 facet
收集坐标/速度,计算所有激活颗粒的 facet 接触,按节点写回 `fsph`,并返回
contact count、最大重叠、能量、耗散功率和力范数统计。
V5.8 dynamic grain container benchmark 工具命令行:
```text
dynamic_grain_container_benchmark INPUT.inp OUTPUT_DIR
```
`INPUT.inp` 使用 benchmark 专用控制块:
```inp
*DYNAMIC GRAIN CONTAINER
structure_file, steps, dt, gx, gy, gz, damping, search_gap, probe_node
*PARTICLE CONTACT
kn, cn, kt, mu, kwall, cwall
*PARTICLES
id, x, y, z, vx, vy, vz, radius, mass
```
工具输出 `grain_container_history.csv` 和 `grain_container_summary.csv`。该
benchmark 输入格式服务于 `examples/` 验收,不是主 `femlite` 应用程序的通用 INP
keyword。
第三版当前 contact pair 支持两种配置方式:
1. INP 文件中的 FemLite 子集:
@@ -1050,5 +1280,7 @@ fem_finalize
- C ABI 暴露 `femlite_get_convergence_status`,其中 `converged` 使用 `int` 返回 0/1。
- C ABI 暴露 `femlite_get_convergence_metrics`,返回相对力残差、contact gap residual 和 combined norm。
- C ABI 暴露 `femlite_get_convergence_diagnostics`,返回 cutback 次数、最后步长、最后有效时间、收敛状态码和失败原因码。
- C ABI 暴露 `femlite_set_linear_solver`、`femlite_get_linear_solver_settings` 和 `femlite_get_linear_solver_stats`,返回/设置值与 Fortran API 常量一致。
- C ABI 暴露 `femlite_set_linear_solver`、`femlite_get_linear_solver_settings`、
`femlite_get_linear_solver_stats` 和 `femlite_get_linear_solver_diagnostics`,
返回/设置值与 Fortran API 常量一致。
- 上述函数只追加新符号,不改变 `femlite_get_contact_summary` 的签名和含义。