Coreform-Cubit-Mesh-Export 0.9.5__tar.gz → 0.9.7__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of Coreform-Cubit-Mesh-Export might be problematic. Click here for more details.
- {coreform_cubit_mesh_export-0.9.5 → coreform_cubit_mesh_export-0.9.7}/Coreform_Cubit_Mesh_Export.egg-info/PKG-INFO +161 -161
- {coreform_cubit_mesh_export-0.9.5 → coreform_cubit_mesh_export-0.9.7}/Coreform_Cubit_Mesh_Export.egg-info/SOURCES.txt +1 -2
- {coreform_cubit_mesh_export-0.9.5 → coreform_cubit_mesh_export-0.9.7}/Coreform_Cubit_Mesh_Export.egg-info/dependency_links.txt +0 -0
- {coreform_cubit_mesh_export-0.9.5 → coreform_cubit_mesh_export-0.9.7}/Coreform_Cubit_Mesh_Export.egg-info/requires.txt +0 -0
- {coreform_cubit_mesh_export-0.9.5 → coreform_cubit_mesh_export-0.9.7}/Coreform_Cubit_Mesh_Export.egg-info/top_level.txt +0 -0
- {coreform_cubit_mesh_export-0.9.5 → coreform_cubit_mesh_export-0.9.7}/PKG-INFO +161 -161
- {coreform_cubit_mesh_export-0.9.5 → coreform_cubit_mesh_export-0.9.7}/README.md +0 -0
- {coreform_cubit_mesh_export-0.9.5 → coreform_cubit_mesh_export-0.9.7}/cubit_mesh_export.py +0 -0
- {coreform_cubit_mesh_export-0.9.5 → coreform_cubit_mesh_export-0.9.7}/pyproject.toml +1 -1
- {coreform_cubit_mesh_export-0.9.5 → coreform_cubit_mesh_export-0.9.7}/setup.cfg +4 -4
- coreform_cubit_mesh_export-0.9.5/file_format/ngsolve_read_gmsh.py +0 -218
|
@@ -1,161 +1,161 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: Coreform_Cubit_Mesh_Export
|
|
3
|
-
Version: 0.9.
|
|
4
|
-
Summary: Cubit mesh export to various formats including Gmsh, Nastran, and VTK
|
|
5
|
-
Author-email: Kengo Sugahara <ksugahar@gmail.com>
|
|
6
|
-
Maintainer-email: Kengo Sugahara <ksugahar@gmail.com>
|
|
7
|
-
License: BSD-3-Clause
|
|
8
|
-
Project-URL: Homepage, https://github.com/ksugahar/Coreform_Cubit_Mesh_Export
|
|
9
|
-
Project-URL: Repository, https://github.com/ksugahar/Coreform_Cubit_Mesh_Export
|
|
10
|
-
Project-URL: Bug Tracker, https://github.com/ksugahar/Coreform_Cubit_Mesh_Export/issues
|
|
11
|
-
Keywords: cubit,mesh,gmsh,nastran,vtk,export,coreform
|
|
12
|
-
Classifier: Development Status :: 4 - Beta
|
|
13
|
-
Classifier: Intended Audience :: Science/Research
|
|
14
|
-
Classifier: License :: OSI Approved :: BSD License
|
|
15
|
-
Classifier: Operating System :: OS Independent
|
|
16
|
-
Classifier: Programming Language :: Python :: 3
|
|
17
|
-
Classifier: Programming Language :: Python :: 3.7
|
|
18
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
19
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
20
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
21
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
22
|
-
Classifier: Programming Language :: Python :: 3.12
|
|
23
|
-
Classifier: Topic :: Scientific/Engineering
|
|
24
|
-
Classifier: Topic :: Scientific/Engineering :: Physics
|
|
25
|
-
Requires-Python: >=3.7
|
|
26
|
-
Description-Content-Type: text/markdown
|
|
27
|
-
Requires-Dist: numpy>=1.20.3
|
|
28
|
-
Requires-Dist: scipy>=1.6.3
|
|
29
|
-
|
|
30
|
-
# Coreform Cubit Mesh Export
|
|
31
|
-
|
|
32
|
-
Coreform Cubitから様々な形式のメッシュファイルをエクスポートするPythonライブラリ
|
|
33
|
-
|
|
34
|
-
## インストール方法
|
|
35
|
-
|
|
36
|
-
### PyPIから直接インストール(推奨)
|
|
37
|
-
```bash
|
|
38
|
-
pip install --upgrade coreform-cubit-mesh-export
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
### Cubit内蔵Pythonの場合
|
|
42
|
-
```bash
|
|
43
|
-
cd "C:\Program Files\Coreform Cubit 2025.3\bin\python3\"
|
|
44
|
-
python.exe -m pip install --upgrade coreform-cubit-mesh-export
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
### 開発版をGitHubからインストール
|
|
48
|
-
```bash
|
|
49
|
-
pip install git+https://github.com/ksugahar/Coreform_Cubit_Mesh_Export.git
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
### ローカルインストール(開発用)
|
|
53
|
-
```bash
|
|
54
|
-
git clone https://github.com/ksugahar/Coreform_Cubit_Mesh_Export.git
|
|
55
|
-
cd Coreform_Cubit_Mesh_Export
|
|
56
|
-
pip install -e .
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
## サポートしているファイル形式
|
|
60
|
-
|
|
61
|
-
- **Gmsh形式**
|
|
62
|
-
- バージョン2.2(完全サポート)
|
|
63
|
-
- バージョン4.1(部分サポート)
|
|
64
|
-
- **Nastran形式**
|
|
65
|
-
- 2Dメッシュ
|
|
66
|
-
- 3Dメッシュ
|
|
67
|
-
- **MEG形式**(ELF用)
|
|
68
|
-
- 2Dメッシュ
|
|
69
|
-
- 3Dメッシュ
|
|
70
|
-
- **VTK形式**
|
|
71
|
-
- メッシュのみ(Legacy VTK形式)
|
|
72
|
-
|
|
73
|
-
## 使い方
|
|
74
|
-
|
|
75
|
-
### Cubit内での使用例
|
|
76
|
-
|
|
77
|
-
Cubitでメッシュ生成後、以下のようにPythonスクリプトを実行します:
|
|
78
|
-
|
|
79
|
-
```python
|
|
80
|
-
# Cubitコマンドライン
|
|
81
|
-
play "export_mesh.py"
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
`export_mesh.py`の内容例:
|
|
85
|
-
|
|
86
|
-
```python
|
|
87
|
-
import cubit_mesh_export
|
|
88
|
-
|
|
89
|
-
# Nastran形式でエクスポート
|
|
90
|
-
FileName = 'output/model.nas'
|
|
91
|
-
cubit_mesh_export.export_3D_Nastran(cubit, FileName)
|
|
92
|
-
|
|
93
|
-
# Gmsh形式でエクスポート
|
|
94
|
-
FileName = 'output/model.msh'
|
|
95
|
-
cubit_mesh_export.export_3D_gmsh_ver2(cubit, FileName)
|
|
96
|
-
|
|
97
|
-
# VTK形式でエクスポート
|
|
98
|
-
FileName = 'output/model.vtk'
|
|
99
|
-
cubit_mesh_export.export_3D_vtk(cubit, FileName)
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
## 関数一覧
|
|
103
|
-
|
|
104
|
-
### Gmsh形式
|
|
105
|
-
- `export_3D_gmsh_ver2(cubit, filename)` - Gmsh v2.2形式で3Dメッシュをエクスポート
|
|
106
|
-
- `export_3D_gmsh_ver4(cubit, filename)` - Gmsh v4.1形式で3Dメッシュをエクスポート(部分サポート)
|
|
107
|
-
|
|
108
|
-
### Nastran形式
|
|
109
|
-
- `export_2D_Nastran(cubit, filename)` - 2DメッシュをNastran形式でエクスポート
|
|
110
|
-
- `export_3D_Nastran(cubit, filename)` - 3DメッシュをNastran形式でエクスポート
|
|
111
|
-
|
|
112
|
-
### MEG形式(ELF用)
|
|
113
|
-
- `export_2D_meg(cubit, filename)` - 2DメッシュをMEG形式でエクスポート
|
|
114
|
-
- `export_3D_meg(cubit, filename)` - 3DメッシュをMEG形式でエクスポート
|
|
115
|
-
|
|
116
|
-
### VTK形式
|
|
117
|
-
- `export_3D_vtk(cubit, filename)` - 3DメッシュをVTK形式でエクスポート
|
|
118
|
-
|
|
119
|
-
## 要件
|
|
120
|
-
|
|
121
|
-
- Python 3.7以上
|
|
122
|
-
- NumPy >= 1.20.3
|
|
123
|
-
- SciPy >= 1.6.3
|
|
124
|
-
- Coreform Cubit(メッシュ生成用)
|
|
125
|
-
|
|
126
|
-
## ライセンス
|
|
127
|
-
|
|
128
|
-
BSD 3-Clause License
|
|
129
|
-
|
|
130
|
-
## 作者
|
|
131
|
-
|
|
132
|
-
Kengo Sugahara (ksugahar@gmail.com)
|
|
133
|
-
|
|
134
|
-
## リポジトリ
|
|
135
|
-
|
|
136
|
-
- GitHub: [https://github.com/ksugahar/Coreform_Cubit_Mesh_Export](https://github.com/ksugahar/Coreform_Cubit_Mesh_Export)
|
|
137
|
-
- PyPI: [https://pypi.org/project/coreform-cubit-mesh-export/](https://pypi.org/project/coreform-cubit-mesh-export/)
|
|
138
|
-
|
|
139
|
-
## バグ報告・機能要望
|
|
140
|
-
|
|
141
|
-
[GitHub Issues](https://github.com/ksugahar/Coreform_Cubit_Mesh_Export/issues)にてお願いします。
|
|
142
|
-
|
|
143
|
-
## 変更履歴
|
|
144
|
-
|
|
145
|
-
### v0.9.4 (2025-09-11)
|
|
146
|
-
- **バグ修正**
|
|
147
|
-
- Gmsh v4形式: Wedge要素のノード出力を4個から6個に修正
|
|
148
|
-
- Gmsh v4形式: 要素タグを0ではなく1から開始するよう修正
|
|
149
|
-
- Gmsh v4形式: 空の要素リストでmin/max関数がエラーになる問題を修正
|
|
150
|
-
- VTK形式: WedgeとPyramid要素のconnectivity取得処理が欠落していた問題を修正
|
|
151
|
-
- NASTRAN形式: f-string構文エラーを修正
|
|
152
|
-
- FreeFEM形式: 未定義変数`nodeset_surface_list`の問題を修正
|
|
153
|
-
- geo_mesh形式: 未定義変数`nodes`の初期化を追加
|
|
154
|
-
|
|
155
|
-
### v0.9.3 (2025-01)
|
|
156
|
-
- パッケージ名を`Coreform_Cubit_Mesh_Export`に統一
|
|
157
|
-
- `pyproject.toml`ベースの最新パッケージング方式に移行
|
|
158
|
-
- ドキュメントの改善
|
|
159
|
-
|
|
160
|
-
### v0.9.2
|
|
161
|
-
- 初回PyPIリリース
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: Coreform_Cubit_Mesh_Export
|
|
3
|
+
Version: 0.9.7
|
|
4
|
+
Summary: Cubit mesh export to various formats including Gmsh, Nastran, and VTK
|
|
5
|
+
Author-email: Kengo Sugahara <ksugahar@gmail.com>
|
|
6
|
+
Maintainer-email: Kengo Sugahara <ksugahar@gmail.com>
|
|
7
|
+
License: BSD-3-Clause
|
|
8
|
+
Project-URL: Homepage, https://github.com/ksugahar/Coreform_Cubit_Mesh_Export
|
|
9
|
+
Project-URL: Repository, https://github.com/ksugahar/Coreform_Cubit_Mesh_Export
|
|
10
|
+
Project-URL: Bug Tracker, https://github.com/ksugahar/Coreform_Cubit_Mesh_Export/issues
|
|
11
|
+
Keywords: cubit,mesh,gmsh,nastran,vtk,export,coreform
|
|
12
|
+
Classifier: Development Status :: 4 - Beta
|
|
13
|
+
Classifier: Intended Audience :: Science/Research
|
|
14
|
+
Classifier: License :: OSI Approved :: BSD License
|
|
15
|
+
Classifier: Operating System :: OS Independent
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.7
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
23
|
+
Classifier: Topic :: Scientific/Engineering
|
|
24
|
+
Classifier: Topic :: Scientific/Engineering :: Physics
|
|
25
|
+
Requires-Python: >=3.7
|
|
26
|
+
Description-Content-Type: text/markdown
|
|
27
|
+
Requires-Dist: numpy>=1.20.3
|
|
28
|
+
Requires-Dist: scipy>=1.6.3
|
|
29
|
+
|
|
30
|
+
# Coreform Cubit Mesh Export
|
|
31
|
+
|
|
32
|
+
Coreform Cubitから様々な形式のメッシュファイルをエクスポートするPythonライブラリ
|
|
33
|
+
|
|
34
|
+
## インストール方法
|
|
35
|
+
|
|
36
|
+
### PyPIから直接インストール(推奨)
|
|
37
|
+
```bash
|
|
38
|
+
pip install --upgrade coreform-cubit-mesh-export
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### Cubit内蔵Pythonの場合
|
|
42
|
+
```bash
|
|
43
|
+
cd "C:\Program Files\Coreform Cubit 2025.3\bin\python3\"
|
|
44
|
+
python.exe -m pip install --upgrade coreform-cubit-mesh-export
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### 開発版をGitHubからインストール
|
|
48
|
+
```bash
|
|
49
|
+
pip install git+https://github.com/ksugahar/Coreform_Cubit_Mesh_Export.git
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### ローカルインストール(開発用)
|
|
53
|
+
```bash
|
|
54
|
+
git clone https://github.com/ksugahar/Coreform_Cubit_Mesh_Export.git
|
|
55
|
+
cd Coreform_Cubit_Mesh_Export
|
|
56
|
+
pip install -e .
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## サポートしているファイル形式
|
|
60
|
+
|
|
61
|
+
- **Gmsh形式**
|
|
62
|
+
- バージョン2.2(完全サポート)
|
|
63
|
+
- バージョン4.1(部分サポート)
|
|
64
|
+
- **Nastran形式**
|
|
65
|
+
- 2Dメッシュ
|
|
66
|
+
- 3Dメッシュ
|
|
67
|
+
- **MEG形式**(ELF用)
|
|
68
|
+
- 2Dメッシュ
|
|
69
|
+
- 3Dメッシュ
|
|
70
|
+
- **VTK形式**
|
|
71
|
+
- メッシュのみ(Legacy VTK形式)
|
|
72
|
+
|
|
73
|
+
## 使い方
|
|
74
|
+
|
|
75
|
+
### Cubit内での使用例
|
|
76
|
+
|
|
77
|
+
Cubitでメッシュ生成後、以下のようにPythonスクリプトを実行します:
|
|
78
|
+
|
|
79
|
+
```python
|
|
80
|
+
# Cubitコマンドライン
|
|
81
|
+
play "export_mesh.py"
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
`export_mesh.py`の内容例:
|
|
85
|
+
|
|
86
|
+
```python
|
|
87
|
+
import cubit_mesh_export
|
|
88
|
+
|
|
89
|
+
# Nastran形式でエクスポート
|
|
90
|
+
FileName = 'output/model.nas'
|
|
91
|
+
cubit_mesh_export.export_3D_Nastran(cubit, FileName)
|
|
92
|
+
|
|
93
|
+
# Gmsh形式でエクスポート
|
|
94
|
+
FileName = 'output/model.msh'
|
|
95
|
+
cubit_mesh_export.export_3D_gmsh_ver2(cubit, FileName)
|
|
96
|
+
|
|
97
|
+
# VTK形式でエクスポート
|
|
98
|
+
FileName = 'output/model.vtk'
|
|
99
|
+
cubit_mesh_export.export_3D_vtk(cubit, FileName)
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## 関数一覧
|
|
103
|
+
|
|
104
|
+
### Gmsh形式
|
|
105
|
+
- `export_3D_gmsh_ver2(cubit, filename)` - Gmsh v2.2形式で3Dメッシュをエクスポート
|
|
106
|
+
- `export_3D_gmsh_ver4(cubit, filename)` - Gmsh v4.1形式で3Dメッシュをエクスポート(部分サポート)
|
|
107
|
+
|
|
108
|
+
### Nastran形式
|
|
109
|
+
- `export_2D_Nastran(cubit, filename)` - 2DメッシュをNastran形式でエクスポート
|
|
110
|
+
- `export_3D_Nastran(cubit, filename)` - 3DメッシュをNastran形式でエクスポート
|
|
111
|
+
|
|
112
|
+
### MEG形式(ELF用)
|
|
113
|
+
- `export_2D_meg(cubit, filename)` - 2DメッシュをMEG形式でエクスポート
|
|
114
|
+
- `export_3D_meg(cubit, filename)` - 3DメッシュをMEG形式でエクスポート
|
|
115
|
+
|
|
116
|
+
### VTK形式
|
|
117
|
+
- `export_3D_vtk(cubit, filename)` - 3DメッシュをVTK形式でエクスポート
|
|
118
|
+
|
|
119
|
+
## 要件
|
|
120
|
+
|
|
121
|
+
- Python 3.7以上
|
|
122
|
+
- NumPy >= 1.20.3
|
|
123
|
+
- SciPy >= 1.6.3
|
|
124
|
+
- Coreform Cubit(メッシュ生成用)
|
|
125
|
+
|
|
126
|
+
## ライセンス
|
|
127
|
+
|
|
128
|
+
BSD 3-Clause License
|
|
129
|
+
|
|
130
|
+
## 作者
|
|
131
|
+
|
|
132
|
+
Kengo Sugahara (ksugahar@gmail.com)
|
|
133
|
+
|
|
134
|
+
## リポジトリ
|
|
135
|
+
|
|
136
|
+
- GitHub: [https://github.com/ksugahar/Coreform_Cubit_Mesh_Export](https://github.com/ksugahar/Coreform_Cubit_Mesh_Export)
|
|
137
|
+
- PyPI: [https://pypi.org/project/coreform-cubit-mesh-export/](https://pypi.org/project/coreform-cubit-mesh-export/)
|
|
138
|
+
|
|
139
|
+
## バグ報告・機能要望
|
|
140
|
+
|
|
141
|
+
[GitHub Issues](https://github.com/ksugahar/Coreform_Cubit_Mesh_Export/issues)にてお願いします。
|
|
142
|
+
|
|
143
|
+
## 変更履歴
|
|
144
|
+
|
|
145
|
+
### v0.9.4 (2025-09-11)
|
|
146
|
+
- **バグ修正**
|
|
147
|
+
- Gmsh v4形式: Wedge要素のノード出力を4個から6個に修正
|
|
148
|
+
- Gmsh v4形式: 要素タグを0ではなく1から開始するよう修正
|
|
149
|
+
- Gmsh v4形式: 空の要素リストでmin/max関数がエラーになる問題を修正
|
|
150
|
+
- VTK形式: WedgeとPyramid要素のconnectivity取得処理が欠落していた問題を修正
|
|
151
|
+
- NASTRAN形式: f-string構文エラーを修正
|
|
152
|
+
- FreeFEM形式: 未定義変数`nodeset_surface_list`の問題を修正
|
|
153
|
+
- geo_mesh形式: 未定義変数`nodes`の初期化を追加
|
|
154
|
+
|
|
155
|
+
### v0.9.3 (2025-01)
|
|
156
|
+
- パッケージ名を`Coreform_Cubit_Mesh_Export`に統一
|
|
157
|
+
- `pyproject.toml`ベースの最新パッケージング方式に移行
|
|
158
|
+
- ドキュメントの改善
|
|
159
|
+
|
|
160
|
+
### v0.9.2
|
|
161
|
+
- 初回PyPIリリース
|
|
@@ -5,5 +5,4 @@ Coreform_Cubit_Mesh_Export.egg-info/PKG-INFO
|
|
|
5
5
|
Coreform_Cubit_Mesh_Export.egg-info/SOURCES.txt
|
|
6
6
|
Coreform_Cubit_Mesh_Export.egg-info/dependency_links.txt
|
|
7
7
|
Coreform_Cubit_Mesh_Export.egg-info/requires.txt
|
|
8
|
-
Coreform_Cubit_Mesh_Export.egg-info/top_level.txt
|
|
9
|
-
file_format/ngsolve_read_gmsh.py
|
|
8
|
+
Coreform_Cubit_Mesh_Export.egg-info/top_level.txt
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,161 +1,161 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: Coreform_Cubit_Mesh_Export
|
|
3
|
-
Version: 0.9.
|
|
4
|
-
Summary: Cubit mesh export to various formats including Gmsh, Nastran, and VTK
|
|
5
|
-
Author-email: Kengo Sugahara <ksugahar@gmail.com>
|
|
6
|
-
Maintainer-email: Kengo Sugahara <ksugahar@gmail.com>
|
|
7
|
-
License: BSD-3-Clause
|
|
8
|
-
Project-URL: Homepage, https://github.com/ksugahar/Coreform_Cubit_Mesh_Export
|
|
9
|
-
Project-URL: Repository, https://github.com/ksugahar/Coreform_Cubit_Mesh_Export
|
|
10
|
-
Project-URL: Bug Tracker, https://github.com/ksugahar/Coreform_Cubit_Mesh_Export/issues
|
|
11
|
-
Keywords: cubit,mesh,gmsh,nastran,vtk,export,coreform
|
|
12
|
-
Classifier: Development Status :: 4 - Beta
|
|
13
|
-
Classifier: Intended Audience :: Science/Research
|
|
14
|
-
Classifier: License :: OSI Approved :: BSD License
|
|
15
|
-
Classifier: Operating System :: OS Independent
|
|
16
|
-
Classifier: Programming Language :: Python :: 3
|
|
17
|
-
Classifier: Programming Language :: Python :: 3.7
|
|
18
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
19
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
20
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
21
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
22
|
-
Classifier: Programming Language :: Python :: 3.12
|
|
23
|
-
Classifier: Topic :: Scientific/Engineering
|
|
24
|
-
Classifier: Topic :: Scientific/Engineering :: Physics
|
|
25
|
-
Requires-Python: >=3.7
|
|
26
|
-
Description-Content-Type: text/markdown
|
|
27
|
-
Requires-Dist: numpy>=1.20.3
|
|
28
|
-
Requires-Dist: scipy>=1.6.3
|
|
29
|
-
|
|
30
|
-
# Coreform Cubit Mesh Export
|
|
31
|
-
|
|
32
|
-
Coreform Cubitから様々な形式のメッシュファイルをエクスポートするPythonライブラリ
|
|
33
|
-
|
|
34
|
-
## インストール方法
|
|
35
|
-
|
|
36
|
-
### PyPIから直接インストール(推奨)
|
|
37
|
-
```bash
|
|
38
|
-
pip install --upgrade coreform-cubit-mesh-export
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
### Cubit内蔵Pythonの場合
|
|
42
|
-
```bash
|
|
43
|
-
cd "C:\Program Files\Coreform Cubit 2025.3\bin\python3\"
|
|
44
|
-
python.exe -m pip install --upgrade coreform-cubit-mesh-export
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
### 開発版をGitHubからインストール
|
|
48
|
-
```bash
|
|
49
|
-
pip install git+https://github.com/ksugahar/Coreform_Cubit_Mesh_Export.git
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
### ローカルインストール(開発用)
|
|
53
|
-
```bash
|
|
54
|
-
git clone https://github.com/ksugahar/Coreform_Cubit_Mesh_Export.git
|
|
55
|
-
cd Coreform_Cubit_Mesh_Export
|
|
56
|
-
pip install -e .
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
## サポートしているファイル形式
|
|
60
|
-
|
|
61
|
-
- **Gmsh形式**
|
|
62
|
-
- バージョン2.2(完全サポート)
|
|
63
|
-
- バージョン4.1(部分サポート)
|
|
64
|
-
- **Nastran形式**
|
|
65
|
-
- 2Dメッシュ
|
|
66
|
-
- 3Dメッシュ
|
|
67
|
-
- **MEG形式**(ELF用)
|
|
68
|
-
- 2Dメッシュ
|
|
69
|
-
- 3Dメッシュ
|
|
70
|
-
- **VTK形式**
|
|
71
|
-
- メッシュのみ(Legacy VTK形式)
|
|
72
|
-
|
|
73
|
-
## 使い方
|
|
74
|
-
|
|
75
|
-
### Cubit内での使用例
|
|
76
|
-
|
|
77
|
-
Cubitでメッシュ生成後、以下のようにPythonスクリプトを実行します:
|
|
78
|
-
|
|
79
|
-
```python
|
|
80
|
-
# Cubitコマンドライン
|
|
81
|
-
play "export_mesh.py"
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
`export_mesh.py`の内容例:
|
|
85
|
-
|
|
86
|
-
```python
|
|
87
|
-
import cubit_mesh_export
|
|
88
|
-
|
|
89
|
-
# Nastran形式でエクスポート
|
|
90
|
-
FileName = 'output/model.nas'
|
|
91
|
-
cubit_mesh_export.export_3D_Nastran(cubit, FileName)
|
|
92
|
-
|
|
93
|
-
# Gmsh形式でエクスポート
|
|
94
|
-
FileName = 'output/model.msh'
|
|
95
|
-
cubit_mesh_export.export_3D_gmsh_ver2(cubit, FileName)
|
|
96
|
-
|
|
97
|
-
# VTK形式でエクスポート
|
|
98
|
-
FileName = 'output/model.vtk'
|
|
99
|
-
cubit_mesh_export.export_3D_vtk(cubit, FileName)
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
## 関数一覧
|
|
103
|
-
|
|
104
|
-
### Gmsh形式
|
|
105
|
-
- `export_3D_gmsh_ver2(cubit, filename)` - Gmsh v2.2形式で3Dメッシュをエクスポート
|
|
106
|
-
- `export_3D_gmsh_ver4(cubit, filename)` - Gmsh v4.1形式で3Dメッシュをエクスポート(部分サポート)
|
|
107
|
-
|
|
108
|
-
### Nastran形式
|
|
109
|
-
- `export_2D_Nastran(cubit, filename)` - 2DメッシュをNastran形式でエクスポート
|
|
110
|
-
- `export_3D_Nastran(cubit, filename)` - 3DメッシュをNastran形式でエクスポート
|
|
111
|
-
|
|
112
|
-
### MEG形式(ELF用)
|
|
113
|
-
- `export_2D_meg(cubit, filename)` - 2DメッシュをMEG形式でエクスポート
|
|
114
|
-
- `export_3D_meg(cubit, filename)` - 3DメッシュをMEG形式でエクスポート
|
|
115
|
-
|
|
116
|
-
### VTK形式
|
|
117
|
-
- `export_3D_vtk(cubit, filename)` - 3DメッシュをVTK形式でエクスポート
|
|
118
|
-
|
|
119
|
-
## 要件
|
|
120
|
-
|
|
121
|
-
- Python 3.7以上
|
|
122
|
-
- NumPy >= 1.20.3
|
|
123
|
-
- SciPy >= 1.6.3
|
|
124
|
-
- Coreform Cubit(メッシュ生成用)
|
|
125
|
-
|
|
126
|
-
## ライセンス
|
|
127
|
-
|
|
128
|
-
BSD 3-Clause License
|
|
129
|
-
|
|
130
|
-
## 作者
|
|
131
|
-
|
|
132
|
-
Kengo Sugahara (ksugahar@gmail.com)
|
|
133
|
-
|
|
134
|
-
## リポジトリ
|
|
135
|
-
|
|
136
|
-
- GitHub: [https://github.com/ksugahar/Coreform_Cubit_Mesh_Export](https://github.com/ksugahar/Coreform_Cubit_Mesh_Export)
|
|
137
|
-
- PyPI: [https://pypi.org/project/coreform-cubit-mesh-export/](https://pypi.org/project/coreform-cubit-mesh-export/)
|
|
138
|
-
|
|
139
|
-
## バグ報告・機能要望
|
|
140
|
-
|
|
141
|
-
[GitHub Issues](https://github.com/ksugahar/Coreform_Cubit_Mesh_Export/issues)にてお願いします。
|
|
142
|
-
|
|
143
|
-
## 変更履歴
|
|
144
|
-
|
|
145
|
-
### v0.9.4 (2025-09-11)
|
|
146
|
-
- **バグ修正**
|
|
147
|
-
- Gmsh v4形式: Wedge要素のノード出力を4個から6個に修正
|
|
148
|
-
- Gmsh v4形式: 要素タグを0ではなく1から開始するよう修正
|
|
149
|
-
- Gmsh v4形式: 空の要素リストでmin/max関数がエラーになる問題を修正
|
|
150
|
-
- VTK形式: WedgeとPyramid要素のconnectivity取得処理が欠落していた問題を修正
|
|
151
|
-
- NASTRAN形式: f-string構文エラーを修正
|
|
152
|
-
- FreeFEM形式: 未定義変数`nodeset_surface_list`の問題を修正
|
|
153
|
-
- geo_mesh形式: 未定義変数`nodes`の初期化を追加
|
|
154
|
-
|
|
155
|
-
### v0.9.3 (2025-01)
|
|
156
|
-
- パッケージ名を`Coreform_Cubit_Mesh_Export`に統一
|
|
157
|
-
- `pyproject.toml`ベースの最新パッケージング方式に移行
|
|
158
|
-
- ドキュメントの改善
|
|
159
|
-
|
|
160
|
-
### v0.9.2
|
|
161
|
-
- 初回PyPIリリース
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: Coreform_Cubit_Mesh_Export
|
|
3
|
+
Version: 0.9.7
|
|
4
|
+
Summary: Cubit mesh export to various formats including Gmsh, Nastran, and VTK
|
|
5
|
+
Author-email: Kengo Sugahara <ksugahar@gmail.com>
|
|
6
|
+
Maintainer-email: Kengo Sugahara <ksugahar@gmail.com>
|
|
7
|
+
License: BSD-3-Clause
|
|
8
|
+
Project-URL: Homepage, https://github.com/ksugahar/Coreform_Cubit_Mesh_Export
|
|
9
|
+
Project-URL: Repository, https://github.com/ksugahar/Coreform_Cubit_Mesh_Export
|
|
10
|
+
Project-URL: Bug Tracker, https://github.com/ksugahar/Coreform_Cubit_Mesh_Export/issues
|
|
11
|
+
Keywords: cubit,mesh,gmsh,nastran,vtk,export,coreform
|
|
12
|
+
Classifier: Development Status :: 4 - Beta
|
|
13
|
+
Classifier: Intended Audience :: Science/Research
|
|
14
|
+
Classifier: License :: OSI Approved :: BSD License
|
|
15
|
+
Classifier: Operating System :: OS Independent
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.7
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
23
|
+
Classifier: Topic :: Scientific/Engineering
|
|
24
|
+
Classifier: Topic :: Scientific/Engineering :: Physics
|
|
25
|
+
Requires-Python: >=3.7
|
|
26
|
+
Description-Content-Type: text/markdown
|
|
27
|
+
Requires-Dist: numpy>=1.20.3
|
|
28
|
+
Requires-Dist: scipy>=1.6.3
|
|
29
|
+
|
|
30
|
+
# Coreform Cubit Mesh Export
|
|
31
|
+
|
|
32
|
+
Coreform Cubitから様々な形式のメッシュファイルをエクスポートするPythonライブラリ
|
|
33
|
+
|
|
34
|
+
## インストール方法
|
|
35
|
+
|
|
36
|
+
### PyPIから直接インストール(推奨)
|
|
37
|
+
```bash
|
|
38
|
+
pip install --upgrade coreform-cubit-mesh-export
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### Cubit内蔵Pythonの場合
|
|
42
|
+
```bash
|
|
43
|
+
cd "C:\Program Files\Coreform Cubit 2025.3\bin\python3\"
|
|
44
|
+
python.exe -m pip install --upgrade coreform-cubit-mesh-export
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### 開発版をGitHubからインストール
|
|
48
|
+
```bash
|
|
49
|
+
pip install git+https://github.com/ksugahar/Coreform_Cubit_Mesh_Export.git
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### ローカルインストール(開発用)
|
|
53
|
+
```bash
|
|
54
|
+
git clone https://github.com/ksugahar/Coreform_Cubit_Mesh_Export.git
|
|
55
|
+
cd Coreform_Cubit_Mesh_Export
|
|
56
|
+
pip install -e .
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## サポートしているファイル形式
|
|
60
|
+
|
|
61
|
+
- **Gmsh形式**
|
|
62
|
+
- バージョン2.2(完全サポート)
|
|
63
|
+
- バージョン4.1(部分サポート)
|
|
64
|
+
- **Nastran形式**
|
|
65
|
+
- 2Dメッシュ
|
|
66
|
+
- 3Dメッシュ
|
|
67
|
+
- **MEG形式**(ELF用)
|
|
68
|
+
- 2Dメッシュ
|
|
69
|
+
- 3Dメッシュ
|
|
70
|
+
- **VTK形式**
|
|
71
|
+
- メッシュのみ(Legacy VTK形式)
|
|
72
|
+
|
|
73
|
+
## 使い方
|
|
74
|
+
|
|
75
|
+
### Cubit内での使用例
|
|
76
|
+
|
|
77
|
+
Cubitでメッシュ生成後、以下のようにPythonスクリプトを実行します:
|
|
78
|
+
|
|
79
|
+
```python
|
|
80
|
+
# Cubitコマンドライン
|
|
81
|
+
play "export_mesh.py"
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
`export_mesh.py`の内容例:
|
|
85
|
+
|
|
86
|
+
```python
|
|
87
|
+
import cubit_mesh_export
|
|
88
|
+
|
|
89
|
+
# Nastran形式でエクスポート
|
|
90
|
+
FileName = 'output/model.nas'
|
|
91
|
+
cubit_mesh_export.export_3D_Nastran(cubit, FileName)
|
|
92
|
+
|
|
93
|
+
# Gmsh形式でエクスポート
|
|
94
|
+
FileName = 'output/model.msh'
|
|
95
|
+
cubit_mesh_export.export_3D_gmsh_ver2(cubit, FileName)
|
|
96
|
+
|
|
97
|
+
# VTK形式でエクスポート
|
|
98
|
+
FileName = 'output/model.vtk'
|
|
99
|
+
cubit_mesh_export.export_3D_vtk(cubit, FileName)
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## 関数一覧
|
|
103
|
+
|
|
104
|
+
### Gmsh形式
|
|
105
|
+
- `export_3D_gmsh_ver2(cubit, filename)` - Gmsh v2.2形式で3Dメッシュをエクスポート
|
|
106
|
+
- `export_3D_gmsh_ver4(cubit, filename)` - Gmsh v4.1形式で3Dメッシュをエクスポート(部分サポート)
|
|
107
|
+
|
|
108
|
+
### Nastran形式
|
|
109
|
+
- `export_2D_Nastran(cubit, filename)` - 2DメッシュをNastran形式でエクスポート
|
|
110
|
+
- `export_3D_Nastran(cubit, filename)` - 3DメッシュをNastran形式でエクスポート
|
|
111
|
+
|
|
112
|
+
### MEG形式(ELF用)
|
|
113
|
+
- `export_2D_meg(cubit, filename)` - 2DメッシュをMEG形式でエクスポート
|
|
114
|
+
- `export_3D_meg(cubit, filename)` - 3DメッシュをMEG形式でエクスポート
|
|
115
|
+
|
|
116
|
+
### VTK形式
|
|
117
|
+
- `export_3D_vtk(cubit, filename)` - 3DメッシュをVTK形式でエクスポート
|
|
118
|
+
|
|
119
|
+
## 要件
|
|
120
|
+
|
|
121
|
+
- Python 3.7以上
|
|
122
|
+
- NumPy >= 1.20.3
|
|
123
|
+
- SciPy >= 1.6.3
|
|
124
|
+
- Coreform Cubit(メッシュ生成用)
|
|
125
|
+
|
|
126
|
+
## ライセンス
|
|
127
|
+
|
|
128
|
+
BSD 3-Clause License
|
|
129
|
+
|
|
130
|
+
## 作者
|
|
131
|
+
|
|
132
|
+
Kengo Sugahara (ksugahar@gmail.com)
|
|
133
|
+
|
|
134
|
+
## リポジトリ
|
|
135
|
+
|
|
136
|
+
- GitHub: [https://github.com/ksugahar/Coreform_Cubit_Mesh_Export](https://github.com/ksugahar/Coreform_Cubit_Mesh_Export)
|
|
137
|
+
- PyPI: [https://pypi.org/project/coreform-cubit-mesh-export/](https://pypi.org/project/coreform-cubit-mesh-export/)
|
|
138
|
+
|
|
139
|
+
## バグ報告・機能要望
|
|
140
|
+
|
|
141
|
+
[GitHub Issues](https://github.com/ksugahar/Coreform_Cubit_Mesh_Export/issues)にてお願いします。
|
|
142
|
+
|
|
143
|
+
## 変更履歴
|
|
144
|
+
|
|
145
|
+
### v0.9.4 (2025-09-11)
|
|
146
|
+
- **バグ修正**
|
|
147
|
+
- Gmsh v4形式: Wedge要素のノード出力を4個から6個に修正
|
|
148
|
+
- Gmsh v4形式: 要素タグを0ではなく1から開始するよう修正
|
|
149
|
+
- Gmsh v4形式: 空の要素リストでmin/max関数がエラーになる問題を修正
|
|
150
|
+
- VTK形式: WedgeとPyramid要素のconnectivity取得処理が欠落していた問題を修正
|
|
151
|
+
- NASTRAN形式: f-string構文エラーを修正
|
|
152
|
+
- FreeFEM形式: 未定義変数`nodeset_surface_list`の問題を修正
|
|
153
|
+
- geo_mesh形式: 未定義変数`nodes`の初期化を追加
|
|
154
|
+
|
|
155
|
+
### v0.9.3 (2025-01)
|
|
156
|
+
- パッケージ名を`Coreform_Cubit_Mesh_Export`に統一
|
|
157
|
+
- `pyproject.toml`ベースの最新パッケージング方式に移行
|
|
158
|
+
- ドキュメントの改善
|
|
159
|
+
|
|
160
|
+
### v0.9.2
|
|
161
|
+
- 初回PyPIリリース
|
|
File without changes
|
|
File without changes
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
[egg_info]
|
|
2
|
-
tag_build =
|
|
3
|
-
tag_date = 0
|
|
4
|
-
|
|
1
|
+
[egg_info]
|
|
2
|
+
tag_build =
|
|
3
|
+
tag_date = 0
|
|
4
|
+
|
|
@@ -1,218 +0,0 @@
|
|
|
1
|
-
from netgen.meshing import *
|
|
2
|
-
|
|
3
|
-
def ReadGmsh(filename):
|
|
4
|
-
if not filename.endswith(".msh"):
|
|
5
|
-
filename += ".msh"
|
|
6
|
-
meshdim = 1
|
|
7
|
-
with open(filename, 'r') as f:
|
|
8
|
-
while f.readline().split()[0] != "$Elements":
|
|
9
|
-
pass
|
|
10
|
-
nelem = int(f.readline())
|
|
11
|
-
for i in range(nelem):
|
|
12
|
-
line = f.readline()
|
|
13
|
-
eltype = int(line.split()[1])
|
|
14
|
-
if eltype > 1 and eltype != 15:
|
|
15
|
-
meshdim = 2
|
|
16
|
-
if eltype > 3 and eltype != 15:
|
|
17
|
-
meshdim = 3
|
|
18
|
-
break
|
|
19
|
-
|
|
20
|
-
f = open(filename, 'r')
|
|
21
|
-
mesh = Mesh(dim=meshdim)
|
|
22
|
-
|
|
23
|
-
pointmap = {}
|
|
24
|
-
facedescriptormap = {}
|
|
25
|
-
namemap = { 0 : { 0 : "default" },
|
|
26
|
-
1: { 0 : "default" },
|
|
27
|
-
2: { 0 : "default" },
|
|
28
|
-
3: { 0 : "default" } }
|
|
29
|
-
materialmap = {}
|
|
30
|
-
bbcmap = {}
|
|
31
|
-
|
|
32
|
-
segm = 1
|
|
33
|
-
trig = 2
|
|
34
|
-
quad = 3
|
|
35
|
-
tet = 4
|
|
36
|
-
hex = 5
|
|
37
|
-
prism = 6
|
|
38
|
-
pyramid = 7
|
|
39
|
-
segm3 = 8 # 2nd order line
|
|
40
|
-
trig6 = 9 # 2nd order trig
|
|
41
|
-
tet10 = 11 # 2nd order tet
|
|
42
|
-
point = 15
|
|
43
|
-
quad8 = 16 # 2nd order quad
|
|
44
|
-
hex20 = 17 # 2nd order hex
|
|
45
|
-
prism15 = 18 # 2nd order prism
|
|
46
|
-
pyramid13 = 19 # 2nd order pyramid
|
|
47
|
-
segms = [segm, segm3]
|
|
48
|
-
trigs = [trig, trig6]
|
|
49
|
-
quads = [quad, quad8]
|
|
50
|
-
tets = [tet, tet10]
|
|
51
|
-
hexes = [hex, hex20]
|
|
52
|
-
prisms = [prism, prism15]
|
|
53
|
-
pyramids = [pyramid, pyramid13]
|
|
54
|
-
elem0d = [point]
|
|
55
|
-
elem1d = segms
|
|
56
|
-
elem2d = trigs + quads
|
|
57
|
-
elem3d = tets + hexes + prisms + pyramids
|
|
58
|
-
|
|
59
|
-
num_nodes_map = { segm : 2,
|
|
60
|
-
trig : 3,
|
|
61
|
-
quad : 4,
|
|
62
|
-
tet : 4,
|
|
63
|
-
hex : 8,
|
|
64
|
-
prism : 6,
|
|
65
|
-
pyramid : 5,
|
|
66
|
-
segm3 : 3,
|
|
67
|
-
trig6 : 6,
|
|
68
|
-
tet10 : 10,
|
|
69
|
-
point : 1,
|
|
70
|
-
quad8 : 8,
|
|
71
|
-
hex20 : 20,
|
|
72
|
-
prism15 : 18,
|
|
73
|
-
pyramid13 : 19 }
|
|
74
|
-
|
|
75
|
-
while True:
|
|
76
|
-
line = f.readline()
|
|
77
|
-
if line == "":
|
|
78
|
-
break
|
|
79
|
-
|
|
80
|
-
if line.split()[0] == "$PhysicalNames":
|
|
81
|
-
print('WARNING: Physical groups detected - Be sure to define them for every geometrical entity.')
|
|
82
|
-
numnames = int(f.readline())
|
|
83
|
-
for i in range(numnames):
|
|
84
|
-
f.readline
|
|
85
|
-
line = f.readline()
|
|
86
|
-
namemap[int(line.split()[0])][int(line.split()[1])] = line.split()[2][1:-1]
|
|
87
|
-
|
|
88
|
-
if line.split()[0] == "$Nodes":
|
|
89
|
-
num = int(f.readline().split()[0])
|
|
90
|
-
for i in range(num):
|
|
91
|
-
line = f.readline()
|
|
92
|
-
nodenum, x, y, z = line.split()[0:4]
|
|
93
|
-
!!! pnum = mesh.Add(MeshPoint(Pnt(float(x), float(y), float(z))))
|
|
94
|
-
pointmap[int(nodenum)] = pnum
|
|
95
|
-
|
|
96
|
-
if line.split()[0] == "$Elements":
|
|
97
|
-
num = int(f.readline().split()[0])
|
|
98
|
-
|
|
99
|
-
for i in range(num):
|
|
100
|
-
line = f.readline().split()
|
|
101
|
-
elmnum = int(line[0])
|
|
102
|
-
elmtype = int(line[1])
|
|
103
|
-
numtags = int(line[2])
|
|
104
|
-
# the first tag is the physical group nr, the second tag is the group nr of the dim
|
|
105
|
-
tags = [int(line[3 + k]) for k in range(numtags)]
|
|
106
|
-
|
|
107
|
-
if elmtype not in num_nodes_map:
|
|
108
|
-
raise Exception("element type", elmtype, "not implemented")
|
|
109
|
-
num_nodes = num_nodes_map[elmtype]
|
|
110
|
-
|
|
111
|
-
nodenums = line[3 + numtags:3 + numtags + num_nodes]
|
|
112
|
-
nodenums2 = [pointmap[int(nn)] for nn in nodenums]
|
|
113
|
-
|
|
114
|
-
if elmtype in elem1d:
|
|
115
|
-
if meshdim == 3:
|
|
116
|
-
if tags[1] in bbcmap:
|
|
117
|
-
index = bbcmap[tags[1]]
|
|
118
|
-
else:
|
|
119
|
-
index = len(bbcmap) + 1
|
|
120
|
-
if len(namemap):
|
|
121
|
-
!!! mesh.SetCD2Name(index, namemap[1][tags[0]])
|
|
122
|
-
else:
|
|
123
|
-
!!! mesh.SetCD2Name(index, "line" + str(tags[1]))
|
|
124
|
-
bbcmap[tags[1]] = index
|
|
125
|
-
|
|
126
|
-
elif meshdim == 2:
|
|
127
|
-
if tags[1] in facedescriptormap.keys():
|
|
128
|
-
index = facedescriptormap[tags[1]]
|
|
129
|
-
else:
|
|
130
|
-
index = len(facedescriptormap) + 1
|
|
131
|
-
!!! fd = FaceDescriptor(bc=index)
|
|
132
|
-
if len(namemap):
|
|
133
|
-
!!! fd.bcname = namemap[1][tags[0]]
|
|
134
|
-
else:
|
|
135
|
-
fd.bcname = 'line' + str(tags[1])
|
|
136
|
-
!!! mesh.SetBCName(index - 1, fd.bcname)
|
|
137
|
-
!!! mesh.Add(fd)
|
|
138
|
-
facedescriptormap[tags[1]] = index
|
|
139
|
-
else:
|
|
140
|
-
if tags[1] in materialmap:
|
|
141
|
-
index = materialmap[tags[1]]
|
|
142
|
-
else:
|
|
143
|
-
index = len(materialmap) + 1
|
|
144
|
-
if len(namemap):
|
|
145
|
-
!!! mesh.SetMaterial(index, namemap[1][tags[0]])
|
|
146
|
-
else:
|
|
147
|
-
!!! mesh.SetMaterial(index, "line" + str(tags[1]))
|
|
148
|
-
materialmap[tags[1]] = index
|
|
149
|
-
|
|
150
|
-
!!! mesh.Add(Element1D(index=index, vertices=nodenums2))
|
|
151
|
-
|
|
152
|
-
if elmtype in elem2d: # 2d elements
|
|
153
|
-
if meshdim == 3:
|
|
154
|
-
if tags[1] in facedescriptormap.keys():
|
|
155
|
-
index = facedescriptormap[tags[1]]
|
|
156
|
-
else:
|
|
157
|
-
index = len(facedescriptormap) + 1
|
|
158
|
-
fd = FaceDescriptor(bc=index)
|
|
159
|
-
if len(namemap):
|
|
160
|
-
!!! fd.bcname = namemap[2][tags[0]]
|
|
161
|
-
else:
|
|
162
|
-
!!! fd.bcname = "surf" + str(tags[1])
|
|
163
|
-
!!! mesh.SetBCName(index - 1, fd.bcname)
|
|
164
|
-
!!! mesh.Add(fd)
|
|
165
|
-
facedescriptormap[tags[1]] = index
|
|
166
|
-
else:
|
|
167
|
-
if tags[1] in materialmap:
|
|
168
|
-
index = materialmap[tags[1]]
|
|
169
|
-
else:
|
|
170
|
-
index = len(materialmap) + 1
|
|
171
|
-
if len(namemap):
|
|
172
|
-
!!! mesh.SetMaterial(index, namemap[2][tags[0]])
|
|
173
|
-
else:
|
|
174
|
-
!!! mesh.SetMaterial(index, "surf" + str(tags[1]))
|
|
175
|
-
materialmap[tags[1]] = index
|
|
176
|
-
|
|
177
|
-
if elmtype in trigs:
|
|
178
|
-
ordering = [i for i in range(3)]
|
|
179
|
-
if elmtype == trig6:
|
|
180
|
-
!! ordering += [4,5,3]
|
|
181
|
-
if elmtype in quads:
|
|
182
|
-
ordering = [i for i in range(4)]
|
|
183
|
-
if elmtype == quad8:
|
|
184
|
-
!! ordering += [4, 6, 7, 5]
|
|
185
|
-
!!! mesh.Add(Element2D(index, [nodenums2[i] for i in ordering]))
|
|
186
|
-
|
|
187
|
-
if elmtype in elem3d: # volume elements
|
|
188
|
-
if tags[1] in materialmap:
|
|
189
|
-
index = materialmap[tags[1]]
|
|
190
|
-
else:
|
|
191
|
-
index = len(materialmap) + 1
|
|
192
|
-
if len(namemap):
|
|
193
|
-
!!! mesh.SetMaterial(index, namemap[3][tags[0]])
|
|
194
|
-
else:
|
|
195
|
-
!!! mesh.SetMaterial(index, "vol" + str(tags[1]))
|
|
196
|
-
materialmap[tags[1]] = index
|
|
197
|
-
|
|
198
|
-
nodenums2 = [pointmap[int(nn)] for nn in nodenums]
|
|
199
|
-
|
|
200
|
-
if elmtype in tets:
|
|
201
|
-
!! ordering = [0,1,2,3]
|
|
202
|
-
if elmtype == tet10:
|
|
203
|
-
!! ordering += [4,6,7,5,9,8]
|
|
204
|
-
elif elmtype in hexes:
|
|
205
|
-
!! ordering = [0,1,5,4,3,2,6,7]
|
|
206
|
-
if elmtype == hex20:
|
|
207
|
-
!! ordering += [8,16,10,12,13,19,15,14,9,11,18,17]
|
|
208
|
-
elif elmtype in prisms:
|
|
209
|
-
!! ordering = [0,2,1,3,5,4]
|
|
210
|
-
if elmtype == prism15:
|
|
211
|
-
!! ordering += [7,6,9,8,11,10,13,12,14]
|
|
212
|
-
elif elmtype in pyramids:
|
|
213
|
-
!! ordering = [3,2,1,0,4]
|
|
214
|
-
if elmtype == pyramid13:
|
|
215
|
-
!! ordering += [10,5,6,8,12,11,9,7]
|
|
216
|
-
!!! mesh.Add(Element3D(index, [nodenums2[i] for i in ordering]))
|
|
217
|
-
|
|
218
|
-
return mesh
|