This commit is contained in:
@@ -29,6 +29,15 @@
|
||||
- 高斯点结果查询接口。
|
||||
- VTK 和 restart 相关接口。
|
||||
|
||||
第三版提供:
|
||||
|
||||
- 线性静力求解接口。
|
||||
- 非线性静力求解接口。
|
||||
- 隐式 Newmark 动力学推进接口。
|
||||
- 静力收敛历史查询接口。
|
||||
- 节点反力查询接口。
|
||||
- 接触状态、接触力和接触功查询接口。
|
||||
|
||||
## 3. 接口设计原则
|
||||
|
||||
接口设计遵循:
|
||||
@@ -220,6 +229,79 @@ fem_advance_explicit(dt)
|
||||
|
||||
在 SPH 驱动模式下,时间步长由外部程序传入。
|
||||
|
||||
第三版静力和隐式动力接口:
|
||||
|
||||
```fortran
|
||||
subroutine fem_solve_static_linear(max_iter, tol, iter, res_norm, ierr)
|
||||
integer, intent(in) :: max_iter
|
||||
real(rk), intent(in) :: tol
|
||||
integer, intent(out) :: iter
|
||||
real(rk), intent(out) :: res_norm
|
||||
integer, intent(out) :: ierr
|
||||
end subroutine
|
||||
|
||||
subroutine fem_solve_static_nonlinear(max_increment, max_iter, tol, &
|
||||
iter, res_norm, ierr)
|
||||
integer, intent(in) :: max_increment
|
||||
integer, intent(in) :: max_iter
|
||||
real(rk), intent(in) :: tol
|
||||
integer, intent(out) :: iter
|
||||
real(rk), intent(out) :: res_norm
|
||||
integer, intent(out) :: ierr
|
||||
end subroutine
|
||||
|
||||
subroutine fem_advance_implicit_newmark(dt, max_iter, tol, iter, res_norm, ierr)
|
||||
real(rk), intent(in) :: dt
|
||||
integer, intent(in) :: max_iter
|
||||
real(rk), intent(in) :: tol
|
||||
integer, intent(out) :: iter
|
||||
real(rk), intent(out) :: res_norm
|
||||
integer, intent(out) :: ierr
|
||||
end subroutine
|
||||
|
||||
subroutine fem_run_implicit_newmark(max_iter, tol, iter_total, res_norm, ierr)
|
||||
integer, intent(in) :: max_iter
|
||||
real(rk), intent(in) :: tol
|
||||
integer, intent(out) :: iter_total
|
||||
real(rk), intent(out) :: res_norm
|
||||
integer, intent(out) :: ierr
|
||||
end subroutine
|
||||
|
||||
subroutine fem_advance_newmark_nonlinear(dt, max_iter, tol, iter, res_norm, ierr)
|
||||
real(rk), intent(in) :: dt
|
||||
integer, intent(in) :: max_iter
|
||||
real(rk), intent(in) :: tol
|
||||
integer, intent(out) :: iter
|
||||
real(rk), intent(out) :: res_norm
|
||||
integer, intent(out) :: ierr
|
||||
end subroutine
|
||||
|
||||
subroutine fem_run_newmark_nonlinear(max_iter, tol, iter_total, res_norm, ierr)
|
||||
integer, intent(in) :: max_iter
|
||||
real(rk), intent(in) :: tol
|
||||
integer, intent(out) :: iter_total
|
||||
real(rk), intent(out) :: res_norm
|
||||
integer, intent(out) :: ierr
|
||||
end subroutine
|
||||
|
||||
subroutine fem_set_rayleigh_damping(alpha_mass, beta_stiffness, ierr)
|
||||
real(rk), intent(in) :: alpha_mass
|
||||
real(rk), intent(in) :: beta_stiffness
|
||||
integer, intent(out) :: ierr
|
||||
end subroutine
|
||||
```
|
||||
|
||||
说明:
|
||||
|
||||
- 静力接口不要求调用 `fem_compute_lumped_mass`。
|
||||
- 隐式动力接口可复用质量矩阵、阻尼矩阵、CSR 矩阵和边界条件数据库。
|
||||
- `fem_solve_static_linear` 与命令行 `--static-linear` 对应。
|
||||
- `--implicit-linear` 保留为 `--static-linear` 的兼容别名。
|
||||
- `fem_run_implicit_newmark` 使用输入文件中的时间控制运行到 `time_end`。
|
||||
- `fem_run_newmark_nonlinear` 使用输入文件中的时间控制运行到 `time_end`,对应命令行 `--implicit-newmark-nonlinear`。
|
||||
- `fem_set_rayleigh_damping` 设置 `C = alpha_mass M + beta_stiffness K`。
|
||||
- 非线性 Newmark Fortran95 接口当前接入实体 J2 算法切线、壳膜内 J2/J2_JC 切线、trial/restore/commit、线搜索、可选步长缩减、Robin/MPC 切线、刚性平面 penalty contact 切线和面-面 contact pair 切线;C ABI 和 Python 调试接口跟随扩展。
|
||||
|
||||
## 10. 载荷接口
|
||||
|
||||
### 10.1 外力清零
|
||||
@@ -422,6 +504,73 @@ end subroutine
|
||||
- 第一版返回单元平均值。
|
||||
- 高斯点查询作为第二版高级接口实现。
|
||||
|
||||
### 12.4 节点反力
|
||||
|
||||
第三版提供节点反力查询:
|
||||
|
||||
```fortran
|
||||
subroutine fem_get_nodal_reactions(nnode_in, node_id, reaction, ierr)
|
||||
integer, intent(in) :: nnode_in
|
||||
integer, intent(in) :: node_id(nnode_in)
|
||||
real(rk), intent(out) :: reaction(6,nnode_in)
|
||||
integer, intent(out) :: ierr
|
||||
end subroutine
|
||||
```
|
||||
|
||||
说明:
|
||||
|
||||
- `reaction(1:3,:)` 为平动反力。
|
||||
- `reaction(4:6,:)` 为转动反力或力矩。
|
||||
- 实体单元未激活转动自由度时,对应分量返回 0。
|
||||
|
||||
### 12.5 静力收敛历史
|
||||
|
||||
第三版提供当前或最近一次静力/隐式求解收敛状态查询:
|
||||
|
||||
```fortran
|
||||
subroutine fem_get_convergence_status(increment, iteration, residual_norm, &
|
||||
correction_norm, converged, ierr)
|
||||
integer, intent(out) :: increment
|
||||
integer, intent(out) :: iteration
|
||||
real(rk), intent(out) :: residual_norm
|
||||
real(rk), intent(out) :: correction_norm
|
||||
logical, intent(out) :: converged
|
||||
integer, intent(out) :: ierr
|
||||
end subroutine
|
||||
```
|
||||
|
||||
### 12.6 接触状态
|
||||
|
||||
第三版提供接触结果查询接口:
|
||||
|
||||
```fortran
|
||||
subroutine fem_get_contact_summary(nactive_contact, contact_work, max_penetration, ierr)
|
||||
integer, intent(out) :: nactive_contact
|
||||
real(rk), intent(out) :: contact_work
|
||||
real(rk), intent(out) :: max_penetration
|
||||
integer, intent(out) :: ierr
|
||||
end subroutine
|
||||
```
|
||||
|
||||
第三版当前 contact pair 采用 Fortran95 核心数据库接口配置:
|
||||
|
||||
```fortran
|
||||
subroutine database_allocate_contact_pair(num_pairs, ierr)
|
||||
integer, intent(in) :: num_pairs
|
||||
integer, intent(out) :: ierr
|
||||
end subroutine
|
||||
```
|
||||
|
||||
配置数组包括:
|
||||
|
||||
- `contact_pair_slave(pair)`:slave 接触目标,可为 elset 名称、element id 字符串或 `ALL`。
|
||||
- `contact_pair_master(pair)`:master 接触目标,可为 elset 名称、element id 字符串或 `ALL`。
|
||||
- `contact_pair_penalty(pair)`:法向 penalty 刚度,必须大于 0。
|
||||
- `contact_pair_damping(pair)`:法向阻尼,必须非负。
|
||||
- `contact_pair_search(pair)`:搜索距离,0 表示只按 facet 等效半径过滤。
|
||||
|
||||
当前 contact pair 查询统计仍以 `fem_get_contact_summary` 为目标接口,完整激活数量、最大穿透量和接触功统计将在接触输出阶段补齐。
|
||||
|
||||
## 13. 输出控制接口
|
||||
|
||||
```fortran
|
||||
@@ -446,6 +595,7 @@ end subroutine
|
||||
|
||||
- 第一版输出 CSV 和日志。
|
||||
- 第二版扩展 VTK 和 restart。
|
||||
- 第三版扩展静力收敛历史、反力和接触结果输出。
|
||||
- 外部程序可关闭自动输出并显式调用 `fem_write_output`。
|
||||
|
||||
## 14. 版本与错误查询接口
|
||||
@@ -559,3 +709,7 @@ fem_finalize
|
||||
- 对三维数组接口提供扁平化视图。
|
||||
- 包装层单独测试,不污染 FEM 核心。
|
||||
|
||||
第三版包装层扩展:
|
||||
|
||||
- C ABI 暴露静力求解、反力查询和收敛状态查询。
|
||||
- Python 调试接口支持运行静力算例并导出关键位移、反力和残差历史。
|
||||
|
||||
Reference in New Issue
Block a user