# pyfem
pyfem是一个完全基于python语言实现的极简有限元求解器。依赖的第三方库包括numpy、scipy和meshio等,主要用于有限元方法的学习、有限元算法验证和快速建立材料本构模型的程序原型。
Github仓库:https://github.com/sunwhale/pyfem
[](https://app.codacy.com/gh/sunwhale/pyfem/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)
## Contact 联系方式
电子邮箱 E-mail:sunjingyu@imech.ac.cn
作者主页 Homepage: https://people.ucas.edu.cn/~sunjingyu
## Installation 安装
支持的操作系统包括:Windows,Linux和MacOS。
### Recommend 推荐
Use the package manager [pip](https://pypi.org/project/pyfem/) to install pyfem:
使用pip命令安装:
```bash
pip install -U pyfem
```
If you have no root access on Linux/MacOS, please try
如果你在Linux/MacOS上没有root访问权限,请尝试
```bash
python -m pip install -U pyfem
```
Users in China can install pyfem from mirrors such as:
中国用户可以使用以下镜像:
- [Aliyun](https://developer.aliyun.com/mirror/pypi)
- [Tsinghua](https://mirrors.tuna.tsinghua.edu.cn/help/pypi/)
### From Source 基于源代码
```bash
git clone https://github.com/sunwhale/pyfem.git
cd pyfem
pip install .
```
or 或者
```bash
git clone https://github.com/sunwhale/pyfem.git
cd pyfem
python install.py
```
Using the "From Source" approach will generate executable files or batch files, which can then have their paths added to the system environment variables.
采用基于源代码的方法会生成可执行文件或批处理文件,可将其路径写入系统环境变量。
## Quickstart 快速开始
### Run in command line 在命令行运行:
```bash
pyfem --help
```
### Run the first example 执行第一个算例:
当前算例文件存储目录 examples/tutorial,该算例定义了一个二维平面应变模型,材料为塑性随动强化,载荷为y方向的循环拉伸-压缩。
```bash
cd examples/tutorial
pyfem -i Job-1.toml
```
## Postproc 后处理
算例计算完成后将在配置文件所在目录下生成 .pvd 或 .vtu文件,可以使用开源可视化软件 [paraview](https://www.paraview.org/download/) 进行查看。
## Preproc 前处理
本项目暂不提供前处理模块,基于 meshio 库,可以识别[gmsh](https://www.gmsh.info/)、abaqus 和 ansys等有限元软件的网格文件。
## Documents 帮助文档
[帮助文档](https://pyfem-doc.readthedocs.io/)中给出了详细的理论公式和函数说明。
## Development 开发
### ToDo list
- [ ] 增加如何建立toml算例文件的帮助文档
- [x] 增加hdf5计算结果输出格式
- [ ] 处理平面应力状态的面外应力平衡
- [ ] 增加内聚区单元
- [ ] 增加动力学求解器
- [ ] 建立前处理界面
### Bug list
- [ ] 采用abaqus网格文件时,如果存在node不属于任何element则在计算时会导致全局刚度矩阵奇异。
Raw data
{
"_id": null,
"home_page": "https://github.com/sunwhale/pyfem",
"name": "pyfem",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": null,
"author": "Jingyu Sun",
"author_email": "sun.jingyu@outlook.com",
"download_url": "https://files.pythonhosted.org/packages/83/f4/2f497655ab97aaa461eae19ee8602e0bc93fe97c3a481823bd1a330e5ecc/pyfem-0.3.0.tar.gz",
"platform": null,
"description": "# pyfem\r\n\r\npyfem\u662f\u4e00\u4e2a\u5b8c\u5168\u57fa\u4e8epython\u8bed\u8a00\u5b9e\u73b0\u7684\u6781\u7b80\u6709\u9650\u5143\u6c42\u89e3\u5668\u3002\u4f9d\u8d56\u7684\u7b2c\u4e09\u65b9\u5e93\u5305\u62ecnumpy\u3001scipy\u548cmeshio\u7b49\uff0c\u4e3b\u8981\u7528\u4e8e\u6709\u9650\u5143\u65b9\u6cd5\u7684\u5b66\u4e60\u3001\u6709\u9650\u5143\u7b97\u6cd5\u9a8c\u8bc1\u548c\u5feb\u901f\u5efa\u7acb\u6750\u6599\u672c\u6784\u6a21\u578b\u7684\u7a0b\u5e8f\u539f\u578b\u3002\r\n\r\nGithub\u4ed3\u5e93\uff1ahttps://github.com/sunwhale/pyfem\r\n\r\n[](https://app.codacy.com/gh/sunwhale/pyfem/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)\r\n\r\n## Contact \u8054\u7cfb\u65b9\u5f0f\r\n\u7535\u5b50\u90ae\u7bb1 E-mail\uff1asunjingyu@imech.ac.cn\r\n\r\n\u4f5c\u8005\u4e3b\u9875 Homepage: https://people.ucas.edu.cn/~sunjingyu\r\n\r\n## Installation \u5b89\u88c5\r\n\r\n\u652f\u6301\u7684\u64cd\u4f5c\u7cfb\u7edf\u5305\u62ec\uff1aWindows\uff0cLinux\u548cMacOS\u3002\r\n\r\n### Recommend \u63a8\u8350\r\n\r\nUse the package manager [pip](https://pypi.org/project/pyfem/) to install pyfem:\r\n\r\n\u4f7f\u7528pip\u547d\u4ee4\u5b89\u88c5:\r\n\r\n```bash\r\npip install -U pyfem\r\n```\r\n\r\nIf you have no root access on Linux/MacOS, please try\r\n\r\n\u5982\u679c\u4f60\u5728Linux/MacOS\u4e0a\u6ca1\u6709root\u8bbf\u95ee\u6743\u9650\uff0c\u8bf7\u5c1d\u8bd5\r\n\r\n```bash\r\npython -m pip install -U pyfem\r\n```\r\n\r\nUsers in China can install pyfem from mirrors such as:\r\n\r\n\u4e2d\u56fd\u7528\u6237\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u955c\u50cf:\r\n- [Aliyun](https://developer.aliyun.com/mirror/pypi)\r\n- [Tsinghua](https://mirrors.tuna.tsinghua.edu.cn/help/pypi/)\r\n\r\n### From Source \u57fa\u4e8e\u6e90\u4ee3\u7801\r\n\r\n```bash\r\ngit clone https://github.com/sunwhale/pyfem.git\r\ncd pyfem\r\npip install .\r\n```\r\n\r\nor \u6216\u8005\r\n\r\n```bash\r\ngit clone https://github.com/sunwhale/pyfem.git\r\ncd pyfem\r\npython install.py\r\n```\r\n\r\nUsing the \"From Source\" approach will generate executable files or batch files, which can then have their paths added to the system environment variables.\r\n\r\n\u91c7\u7528\u57fa\u4e8e\u6e90\u4ee3\u7801\u7684\u65b9\u6cd5\u4f1a\u751f\u6210\u53ef\u6267\u884c\u6587\u4ef6\u6216\u6279\u5904\u7406\u6587\u4ef6\uff0c\u53ef\u5c06\u5176\u8def\u5f84\u5199\u5165\u7cfb\u7edf\u73af\u5883\u53d8\u91cf\u3002\r\n\r\n## Quickstart \u5feb\u901f\u5f00\u59cb\r\n\r\n### Run in command line \u5728\u547d\u4ee4\u884c\u8fd0\u884c:\r\n\r\n```bash\r\npyfem --help\r\n```\r\n\r\n### Run the first example \u6267\u884c\u7b2c\u4e00\u4e2a\u7b97\u4f8b:\r\n\r\n\u5f53\u524d\u7b97\u4f8b\u6587\u4ef6\u5b58\u50a8\u76ee\u5f55 examples/tutorial\uff0c\u8be5\u7b97\u4f8b\u5b9a\u4e49\u4e86\u4e00\u4e2a\u4e8c\u7ef4\u5e73\u9762\u5e94\u53d8\u6a21\u578b\uff0c\u6750\u6599\u4e3a\u5851\u6027\u968f\u52a8\u5f3a\u5316\uff0c\u8f7d\u8377\u4e3ay\u65b9\u5411\u7684\u5faa\u73af\u62c9\u4f38-\u538b\u7f29\u3002\r\n\r\n```bash\r\ncd examples/tutorial\r\npyfem -i Job-1.toml\r\n```\r\n\r\n## Postproc \u540e\u5904\u7406\r\n\r\n\u7b97\u4f8b\u8ba1\u7b97\u5b8c\u6210\u540e\u5c06\u5728\u914d\u7f6e\u6587\u4ef6\u6240\u5728\u76ee\u5f55\u4e0b\u751f\u6210 .pvd \u6216 .vtu\u6587\u4ef6\uff0c\u53ef\u4ee5\u4f7f\u7528\u5f00\u6e90\u53ef\u89c6\u5316\u8f6f\u4ef6 [paraview](https://www.paraview.org/download/) \u8fdb\u884c\u67e5\u770b\u3002\r\n\r\n## Preproc \u524d\u5904\u7406\r\n\r\n\u672c\u9879\u76ee\u6682\u4e0d\u63d0\u4f9b\u524d\u5904\u7406\u6a21\u5757\uff0c\u57fa\u4e8e meshio \u5e93\uff0c\u53ef\u4ee5\u8bc6\u522b[gmsh](https://www.gmsh.info/)\u3001abaqus \u548c ansys\u7b49\u6709\u9650\u5143\u8f6f\u4ef6\u7684\u7f51\u683c\u6587\u4ef6\u3002\r\n\r\n## Documents \u5e2e\u52a9\u6587\u6863\r\n\r\n[\u5e2e\u52a9\u6587\u6863](https://pyfem-doc.readthedocs.io/)\u4e2d\u7ed9\u51fa\u4e86\u8be6\u7ec6\u7684\u7406\u8bba\u516c\u5f0f\u548c\u51fd\u6570\u8bf4\u660e\u3002\r\n\r\n\r\n\r\n## Development \u5f00\u53d1\r\n\r\n### ToDo list\r\n\r\n- [ ] \u589e\u52a0\u5982\u4f55\u5efa\u7acbtoml\u7b97\u4f8b\u6587\u4ef6\u7684\u5e2e\u52a9\u6587\u6863\r\n- [x] \u589e\u52a0hdf5\u8ba1\u7b97\u7ed3\u679c\u8f93\u51fa\u683c\u5f0f\r\n- [ ] \u5904\u7406\u5e73\u9762\u5e94\u529b\u72b6\u6001\u7684\u9762\u5916\u5e94\u529b\u5e73\u8861\r\n- [ ] \u589e\u52a0\u5185\u805a\u533a\u5355\u5143\r\n- [ ] \u589e\u52a0\u52a8\u529b\u5b66\u6c42\u89e3\u5668\r\n- [ ] \u5efa\u7acb\u524d\u5904\u7406\u754c\u9762\r\n\r\n### Bug list\r\n\r\n- [ ] \u91c7\u7528abaqus\u7f51\u683c\u6587\u4ef6\u65f6\uff0c\u5982\u679c\u5b58\u5728node\u4e0d\u5c5e\u4e8e\u4efb\u4f55element\u5219\u5728\u8ba1\u7b97\u65f6\u4f1a\u5bfc\u81f4\u5168\u5c40\u521a\u5ea6\u77e9\u9635\u5947\u5f02\u3002\r\n",
"bugtrack_url": null,
"license": null,
"summary": "Python Finite Element Method",
"version": "0.3.0",
"project_urls": {
"Bug Tracker": "https://github.com/sunwhale/pyfem/issues",
"Homepage": "https://github.com/sunwhale/pyfem"
},
"split_keywords": [],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "d9f7f1c06d15cbbcffd20da366bbd9a982e92eb78a276b921f4a3c1394768c8e",
"md5": "890a3eef862259d5b1eebc39710d9d4b",
"sha256": "6f524ba2f5c5009bce2059448ae95992ffaf4c97d3e5b0f0e77f8e758c5a9a5b"
},
"downloads": -1,
"filename": "pyfem-0.3.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "890a3eef862259d5b1eebc39710d9d4b",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 208191,
"upload_time": "2025-02-08T10:11:25",
"upload_time_iso_8601": "2025-02-08T10:11:25.233076Z",
"url": "https://files.pythonhosted.org/packages/d9/f7/f1c06d15cbbcffd20da366bbd9a982e92eb78a276b921f4a3c1394768c8e/pyfem-0.3.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "83f42f497655ab97aaa461eae19ee8602e0bc93fe97c3a481823bd1a330e5ecc",
"md5": "39de29804bd4ce5a139edffadc67207d",
"sha256": "f4a24b090df2972c12c6e4392467545f998ed3815283d425c692ba1660ef0337"
},
"downloads": -1,
"filename": "pyfem-0.3.0.tar.gz",
"has_sig": false,
"md5_digest": "39de29804bd4ce5a139edffadc67207d",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 139700,
"upload_time": "2025-02-08T10:11:26",
"upload_time_iso_8601": "2025-02-08T10:11:26.694834Z",
"url": "https://files.pythonhosted.org/packages/83/f4/2f497655ab97aaa461eae19ee8602e0bc93fe97c3a481823bd1a330e5ecc/pyfem-0.3.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-02-08 10:11:26",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "sunwhale",
"github_project": "pyfem",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [],
"lcname": "pyfem"
}