Files
FemLite/docs/13_cclite_coupling_api_inventory.md
T
shenw 0440ed5a64
FemLite CI / build-test (push) Has been cancelled
Release FemLite 0.6.4
2026-07-05 17:23:34 +08:00

80 lines
3.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 13 CCLite Coupling API 盘点
文档状态:阶段 A 初始盘点
## 1. Boundary Facet 接口现状
已有 Fortran API:
- `fem_get_boundary_facet_count(num_facets, max_face_nodes, ierr)`
- `fem_get_boundary_facets(nfacet_in, max_face_nodes_in, facet_id, elem_id, face_id, facet_nnode, facet_conn, x, vnod, normal, area, ierr)`
已有 C ABI:
- `femlite_get_boundary_facet_count`
- `femlite_get_boundary_facets`
已有测试:
- `test_c_api` 覆盖 C3D4 边界 facet 数量和基础字段。
- `test_facet_nodal_c_api` 覆盖 facet 查询后施加 facet nodal load。
- `test_smoke` 覆盖 Fortran API 的实体和壳边界 facet 查询。
当前缺口:
- 接口命名偏内部 boundary,不是 CCLite 中立 coupling surface。
- 当前不携带 `surface_id`、`material_id`、`section_id` 和 `valid_flags`。
- surface 名称过滤留到后续阶段。
- 壳厚度和 mass per area 留到后续阶段。
## 2. Facet/Load 接口现状
已有 Fortran API:
- `fem_clear_sph_forces(ierr)`
- `fem_apply_sph_nodal_force(node_id, force, ierr)`
- `fem_apply_sph_nodal_forces(num_force_nodes, node_ids, force, ierr)`
- `fem_get_sph_force_summary(total_force, ierr)`
- `fem_apply_sph_facet_pressure`
- `fem_apply_sph_facet_tractions`
- `fem_apply_sph_facet_nodal_loads`
已有 C ABI:
- `femlite_clear_sph_forces`
- `femlite_apply_sph_nodal_forces`
- `femlite_get_sph_force_summary`
- `femlite_apply_sph_facet_pressure`
- `femlite_apply_sph_facet_tractions`
- `femlite_apply_sph_facet_nodal_loads`
已有测试:
- `test_c_api` 覆盖 nodal force 后显式推进。
- `test_facet_nodal_c_api` 覆盖 facet nodal load 的总力和错误边界。
- `test_particle_fem_coupling` 覆盖 Fortran 侧 facet load 与 particle coupling 小闭环。
当前缺口:
- `sph` 命名不适合作为 CCLite 长期公共接口。
- 当前节点力接口不记录 source id、load mode 和 valid flags。
- 当前总力查询只有 force,没有 moment、接受计数和拒绝计数。
- 非有限载荷、节点未匹配、容量不足等诊断尚未统一为 coupling load 诊断。
## 3. 阶段 A 处理策略
- 新增中立 coupling wrapper,先复用现有 boundary facet 和 sph load 实现。
- 保留旧 `sph` 命名接口,避免破坏历史调用。
- 先提供全部边界 facet 导出,不在阶段 A 做 surface 名称过滤。
- 先提供节点力导入和基础诊断,不在阶段 A 做 facet pressure 的中立包装。
- C ABI smoke 覆盖新 wrapper,旧测试继续保留。
## 4. 当前完成状态
- 中立 coupling surface/facet wrapper 已补齐,旧 `boundary` 和 `sph` 命名接口继续保留兼容。
- 扩展 facet 导出已包含 `surface_id`、`material_id`、`section_id`、`valid_flags`、`shell_thickness` 和 `mass_per_area`。
- 节点力导入已记录 `source_id`、`load_mode` 和 `valid_flags`,并维护独立诊断缓存。
- 诊断已覆盖本步总力、总力矩、接受记录数、非有限载荷、未知节点、容量/metadata 错误和按 `source_id` 汇总。
- C API 已提供 `femlite_get_coupling_source_load_diagnostics` 与 `femlite_write_coupling_reports`。
- worker mock 已在 VTU/PVD 输出目录同步生成 `femlite_cclite_load_report.csv` 和 `femlite_cclite_surface_report.csv`。