Add Chinese README section
Browse files150 unmodified lines151152153150 unmodified lines- Paper: [A Point-Cloud Deep Learning Framework for Prediction of Fluid Flow Fields on Irregular Geometries](https://arxiv.org/abs/2010.09469), [DOI: 10.1063/5.0033376](https://doi.org/10.1063/5.0033376)- This repository preserves the attribution and copyright information of the original paper and official implementation. The official code is licensed under the MIT License; the paper, dataset, and other related resources remain subject to their respective copyright notices and terms of use.150 unmodified lines151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294150 unmodified lines- Paper: [A Point-Cloud Deep Learning Framework for Prediction of Fluid Flow Fields on Irregular Geometries](https://arxiv.org/abs/2010.09469), [DOI: 10.1063/5.0033376](https://doi.org/10.1063/5.0033376)- This repository preserves the attribution and copyright information of the original paper and official implementation. The official code is licensed under the MIT License; the paper, dataset, and other related resources remain subject to their respective copyright notices and terms of use.---# 中文说明## 模型简介PointNetCFD 是由 Ali Kashefi、Davis Rempe 和 Leonidas J. Guibas 提出的流场预测点云模型。它直接将不规则几何域中非结构化计算流体力学(CFD)网格的节点表述为点云,使用 PointNet 编码几何和空间位置,并预测各点的两个速度分量和压力。本仓库以论文为依据,通过 OneScience 技能工作流独立复现。论文:[面向不规则几何域流场预测的点云深度学习框架](https://arxiv.org/abs/2010.09469)## 模型描述PointNetCFD 是面向非结构化网格的逐点计算流体力学回归模型。每个样本包含 1,024 个点。模型接收节点坐标 `(x, y)`,并预测各点的 `(u, v, p)`。T-Nets 对齐输入及特征,共享 MLP 与全局最大池化提取局部和全局特征,`512 → 256 → 128 → 128 → 3` 解码器从融合表征预测流场。坐标保留原始物理尺度,输出变量使用训练集统计量归一化到 `[0, 1]`。### 使用场景| 使用场景 | 说明 || --- | --- || 计算流体力学流场预测 | 根据非结构化网格节点的二维坐标 `(x, y)`,逐点预测速度分量 `(u, v)` 和压力 `p`。 || 不规则几何域建模 | 直接以点云表征物体边界及非结构化网格,无需将计算流体力学数据插值到规则网格。 || 几何泛化 | 相应实验评估模型在先前未见过的几何形状上的预测性能。 |## 使用指南### 1. 使用 OneCode通过 OneCode 在线环境体验智能一键 AI4S 编程。[体验智能一键 AI4S 编程](https://web-2069360198568017922-iaaj.ksai.scnet.cn:58043/home)### 2. 手动安装与使用**硬件要求**- 建议使用 GPU 或 DCU。- CPU 可用于导入检查和小规模连通性测试,完整训练和推理(inference)速度较慢。- DCU 用户须提前安装 DTK。建议使用 DTK 25.04.2 或更高版本,或使用 OneScience 推荐的适配当前集群的版本。#### 下载模型包```bashmodelscope download --model OneScience/PointNetCFD --local_dir ./PointNetCFDcd PointNetCFD```#### 配置运行环境**DCU 环境**```bash# Activate DTK and Conda firstconda create -n onescience311 python=3.11 -yconda activate onescience311# Installation with uv is also supportedpip install onescience[cfd-dcu] -i http://mirrors.onescience.ai:3141/pypi/simple/ --trusted-host mirrors.onescience.ai```**GPU 环境**```bash# Activate Conda firstconda create -n onescience311 python=3.11 -y libstdcxx-ng=12 libgcc-ng=12 gcc_linux-64=12 gxx_linux-64=12conda activate onescience311# Installation with uv is also supportedpip install onescience[cfd-gpu] -i http://mirrors.onescience.ai:3141/pypi/simple/ --trusted-host mirrors.onescience.ai```#### 训练数据OneScience 社区提供 PointNetCFD 训练数据。使用以下命令下载,并确保 `config/config.yaml` 中的 `paths.data_dir` 指向下载的数据目录。```bashmodelscope download --dataset OneScience/pointnet_cfd --local_dir ./data````CFDdata.npy` 的每个样本都是 1,024 × 5 点云数据矩阵,包含列 `[x, y, p, u, v]`。同时提供训练集、验证集和测试集的索引文件。#### 训练默认 `config/config.yaml` 对应论文主要实验设置。```bashpython scripts/train.py --config config/config.yaml```训练期间,将每轮的训练损失、验证损失和评估指标打印到标准输出。验证 MSE 最佳的模型权重(检查点)(checkpoint)保存到以下位置。```textweight/best_model.pth```训练历史、实际采用的配置和训练摘要均存放于 `results/` 目录。若要检查环境连通性,请运行使用独立输出路径的最小冒烟测试。```bashpython scripts/train.py --smoke-test```#### 训练权重`weight/` 目录包含在 PointNetCFD 数据上预训练得到的权重,可直接用于推理。#### 推理运行推理前,请确认 `config/config.yaml` 中的数据路径有效,而且 `weight/best_model.pth` 存在。以下命令对固定测试集运行推理,并实时打印归一化 MSE、各物理变量的 RMSE 及相对 L2 误差。```bashpython scripts/inference.py \--config config/config.yaml \--checkpoint weight/best_model.pth \--device auto \--output-dir results```推理输出保存为以下文件。- `results/test_metrics.json` 包含测试指标及论文参考指标- `results/predictions.npz` 包含坐��、预测结果、真值和样本索引。#### 评估与可视化数值评估由 `scripts/inference.py` 在推理过程中执行。可视化脚本依赖 `results/predictions.npz`,因此请先完成上述推理步骤,再运行下列命令。```bashpython scripts/result.py \--predictions results/predictions.npz \--output-dir results/figures \--num-cases 3```## OneScience 官方资源| 平台 | OneScience 主仓库 | Skills 仓库 || --- | --- | --- || Gitee | https://gitee.com/onescience-ai/onescience | https://gitee.com/onescience-ai/oneskills || GitHub | https://github.com/onescience-ai/OneScience | https://github.com/onescience-ai/oneskills |## 引用与许可证- 论文:[面向不规则几何域流场预测的点云深度学习框架](https://arxiv.org/abs/2010.09469),[DOI: 10.1063/5.0033376](https://doi.org/10.1063/5.0033376)- 本仓库保留原始论文及官方实现的署名与版权信息。官方代码采用 MIT 许可证,论文、数据集和其他相关资源仍受各自版权声明和使用条款约束。
README.md+141