Coreform-Cubit-Mesh-Export 1.0.2__tar.gz → 1.0.4__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-1.0.2 → coreform_cubit_mesh_export-1.0.4}/Coreform_Cubit_Mesh_Export.egg-info/PKG-INFO +1 -1
- {coreform_cubit_mesh_export-1.0.2 → coreform_cubit_mesh_export-1.0.4}/PKG-INFO +1 -1
- {coreform_cubit_mesh_export-1.0.2 → coreform_cubit_mesh_export-1.0.4}/cubit_mesh_export.py +93 -35
- {coreform_cubit_mesh_export-1.0.2 → coreform_cubit_mesh_export-1.0.4}/pyproject.toml +1 -1
- {coreform_cubit_mesh_export-1.0.2 → coreform_cubit_mesh_export-1.0.4}/Coreform_Cubit_Mesh_Export.egg-info/SOURCES.txt +0 -0
- {coreform_cubit_mesh_export-1.0.2 → coreform_cubit_mesh_export-1.0.4}/Coreform_Cubit_Mesh_Export.egg-info/dependency_links.txt +0 -0
- {coreform_cubit_mesh_export-1.0.2 → coreform_cubit_mesh_export-1.0.4}/Coreform_Cubit_Mesh_Export.egg-info/requires.txt +0 -0
- {coreform_cubit_mesh_export-1.0.2 → coreform_cubit_mesh_export-1.0.4}/Coreform_Cubit_Mesh_Export.egg-info/top_level.txt +0 -0
- {coreform_cubit_mesh_export-1.0.2 → coreform_cubit_mesh_export-1.0.4}/README.md +0 -0
- {coreform_cubit_mesh_export-1.0.2 → coreform_cubit_mesh_export-1.0.4}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: Coreform_Cubit_Mesh_Export
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.4
|
|
4
4
|
Summary: Cubit mesh export to various formats including Gmsh, Nastran, and VTK
|
|
5
5
|
Author-email: Kengo Sugahara <ksugahar@gmail.com>
|
|
6
6
|
Maintainer-email: Kengo Sugahara <ksugahar@gmail.com>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: Coreform_Cubit_Mesh_Export
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.4
|
|
4
4
|
Summary: Cubit mesh export to various formats including Gmsh, Nastran, and VTK
|
|
5
5
|
Author-email: Kengo Sugahara <ksugahar@gmail.com>
|
|
6
6
|
Maintainer-email: Kengo Sugahara <ksugahar@gmail.com>
|
|
@@ -30,8 +30,15 @@ def export_3D_mesh(cubit, FileName):
|
|
|
30
30
|
|
|
31
31
|
node_set = set()
|
|
32
32
|
for block_id in cubit.get_block_id_list():
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
elem_types = ["hex", "tet", "wedge", "pyramid"]
|
|
34
|
+
for elem_type in elem_types:
|
|
35
|
+
if elem_type == "hex":
|
|
36
|
+
func = getattr(cubit, f"get_block_{elem_type}es")
|
|
37
|
+
else:
|
|
38
|
+
func = getattr(cubit, f"get_block_{elem_type}s")
|
|
39
|
+
for element_id in func(block_id):
|
|
40
|
+
node_ids = cubit.get_connectivity(elem_type, element_id)
|
|
41
|
+
node_set.update(node_ids)
|
|
35
42
|
for node_id in node_set:
|
|
36
43
|
coord = cubit.get_nodal_coordinates(node_id)
|
|
37
44
|
fid.write(f'{coord[0]} {coord[1]} {coord[2]} {0}\n')
|
|
@@ -104,8 +111,12 @@ def export_2D_gmsh_ver2(cubit, FileName):
|
|
|
104
111
|
|
|
105
112
|
node_set = set()
|
|
106
113
|
for block_id in cubit.get_block_id_list():
|
|
107
|
-
|
|
108
|
-
|
|
114
|
+
elem_types = ["tri", "quad"]
|
|
115
|
+
for elem_type in elem_types:
|
|
116
|
+
func = getattr(cubit, f"get_block_{elem_type}s")
|
|
117
|
+
for element_id in func(block_id):
|
|
118
|
+
node_ids = cubit.get_connectivity(elem_type, element_id)
|
|
119
|
+
node_set.update(node_ids)
|
|
109
120
|
fid.write(f'{len(node_set)}\n')
|
|
110
121
|
for node_id in node_set:
|
|
111
122
|
coord = cubit.get_nodal_coordinates(node_id)
|
|
@@ -201,8 +212,15 @@ def export_3D_gmsh_ver2(cubit, FileName):
|
|
|
201
212
|
|
|
202
213
|
node_set = set()
|
|
203
214
|
for block_id in cubit.get_block_id_list():
|
|
204
|
-
|
|
205
|
-
|
|
215
|
+
elem_types = ["hex", "tet", "wedge", "pyramid"]
|
|
216
|
+
for elem_type in elem_types:
|
|
217
|
+
if elem_type == "hex":
|
|
218
|
+
func = getattr(cubit, f"get_block_{elem_type}es")
|
|
219
|
+
else:
|
|
220
|
+
func = getattr(cubit, f"get_block_{elem_type}s")
|
|
221
|
+
for element_id in func(block_id):
|
|
222
|
+
node_ids = cubit.get_connectivity(elem_type, element_id)
|
|
223
|
+
node_set.update(node_ids)
|
|
206
224
|
fid.write(f'{len(node_set)}\n')
|
|
207
225
|
for node_id in node_set:
|
|
208
226
|
coord = cubit.get_nodal_coordinates(node_id)
|
|
@@ -600,8 +618,12 @@ def export_1D_Nastran(cubit, FileName):
|
|
|
600
618
|
|
|
601
619
|
node_set = set()
|
|
602
620
|
for block_id in cubit.get_block_id_list():
|
|
603
|
-
|
|
604
|
-
|
|
621
|
+
elem_types = ["beam"]
|
|
622
|
+
for elem_type in elem_types:
|
|
623
|
+
func = getattr(cubit, f"get_block_{elem_type}s")
|
|
624
|
+
for element_id in func(block_id):
|
|
625
|
+
node_ids = cubit.get_connectivity(elem_type, element_id)
|
|
626
|
+
node_set.update(node_ids)
|
|
605
627
|
for node_id in node_set:
|
|
606
628
|
coord = cubit.get_nodal_coordinates(node_id)
|
|
607
629
|
fid.write(f"GRID* {node_id:>16}{0:>16}{coord[0]:>16.5f}{coord[1]:>16.5f}\n* {coord[2]:>16.5f}\n")
|
|
@@ -696,8 +718,12 @@ def export_2D_Nastran(cubit, FileName):
|
|
|
696
718
|
|
|
697
719
|
node_set = set()
|
|
698
720
|
for block_id in cubit.get_block_id_list():
|
|
699
|
-
|
|
700
|
-
|
|
721
|
+
elem_types = ["tri", "quad"]
|
|
722
|
+
for elem_type in elem_types:
|
|
723
|
+
func = getattr(cubit, f"get_block_{elem_type}s")
|
|
724
|
+
for element_id in func(block_id):
|
|
725
|
+
node_ids = cubit.get_connectivity(elem_type, element_id)
|
|
726
|
+
node_set.update(node_ids)
|
|
701
727
|
for node_id in node_set:
|
|
702
728
|
coord = cubit.get_nodal_coordinates(node_id)
|
|
703
729
|
fid.write(f"GRID* {node_id:>16}{0:>16}{coord[0]:>16.5f}{coord[1]:>16.5f}\n* {coord[2]:>16.5f}\n")
|
|
@@ -807,8 +833,15 @@ def export_3D_Nastran(cubit, FileName, Pyram=True):
|
|
|
807
833
|
|
|
808
834
|
node_set = set()
|
|
809
835
|
for block_id in cubit.get_block_id_list():
|
|
810
|
-
|
|
811
|
-
|
|
836
|
+
elem_types = ["hex", "tet", "wedge", "pyramid"]
|
|
837
|
+
for elem_type in elem_types:
|
|
838
|
+
if elem_type == "hex":
|
|
839
|
+
func = getattr(cubit, f"get_block_{elem_type}es")
|
|
840
|
+
else:
|
|
841
|
+
func = getattr(cubit, f"get_block_{elem_type}s")
|
|
842
|
+
for element_id in func(block_id):
|
|
843
|
+
node_ids = cubit.get_connectivity(elem_type, element_id)
|
|
844
|
+
node_set.update(node_ids)
|
|
812
845
|
fid.write(f'{len(node_set)}\n')
|
|
813
846
|
for node_id in node_set:
|
|
814
847
|
coord = cubit.get_nodal_coordinates(node_id)
|
|
@@ -839,7 +872,7 @@ def export_3D_Nastran(cubit, FileName, Pyram=True):
|
|
|
839
872
|
for wedge_id in wedge_list:
|
|
840
873
|
node_list = cubit.get_connectivity('wedge',wedge_id)
|
|
841
874
|
element_id += 1
|
|
842
|
-
fid.write(f"
|
|
875
|
+
fid.write(f"CPENTA {element_id:>8}{block_id:>8}{node_list[0]:>8}{node_list[1]:>8}{node_list[2]:>8}{node_list[3]:>8}{node_list[4]:>8}{node_list[5]:>8}\n")
|
|
843
876
|
pyramid_list = cubit.get_volume_pyramids(volume_id)
|
|
844
877
|
for pyramid_id in pyramid_list:
|
|
845
878
|
node_list = cubit.get_connectivity('pyramid',pyramid_id)
|
|
@@ -895,8 +928,15 @@ def export_3D_CDB(cubit, FileName):
|
|
|
895
928
|
|
|
896
929
|
node_set = set()
|
|
897
930
|
for block_id in cubit.get_block_id_list():
|
|
898
|
-
|
|
899
|
-
|
|
931
|
+
elem_types = ["hex", "tet", "wedge", "pyramid"]
|
|
932
|
+
for elem_type in elem_types:
|
|
933
|
+
if elem_type == "hex":
|
|
934
|
+
func = getattr(cubit, f"get_block_{elem_type}es")
|
|
935
|
+
else:
|
|
936
|
+
func = getattr(cubit, f"get_block_{elem_type}s")
|
|
937
|
+
for element_id in func(block_id):
|
|
938
|
+
node_ids = cubit.get_connectivity(elem_type, element_id)
|
|
939
|
+
node_set.update(node_ids)
|
|
900
940
|
fid.write(f'{len(node_set)}\n')
|
|
901
941
|
for node_id in node_set:
|
|
902
942
|
coord = cubit.get_nodal_coordinates(node_id)
|
|
@@ -959,16 +999,13 @@ def export_3D_CDB(cubit, FileName):
|
|
|
959
999
|
name = cubit.get_exodus_entity_name("nodeset",nodeset_id)
|
|
960
1000
|
|
|
961
1001
|
node_set.clear()
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
for tri_id in tri_list:
|
|
970
|
-
node_list = cubit.get_connectivity("tri", tri_id)
|
|
971
|
-
node_set.update(node_list)
|
|
1002
|
+
for block_id in cubit.get_block_id_list():
|
|
1003
|
+
elem_types = ["tri", "quad"]
|
|
1004
|
+
for elem_type in elem_types:
|
|
1005
|
+
func = getattr(cubit, f"get_block_{elem_type}s")
|
|
1006
|
+
for element_id in func(block_id):
|
|
1007
|
+
node_ids = cubit.get_connectivity(elem_type, element_id)
|
|
1008
|
+
node_set.update(node_ids)
|
|
972
1009
|
|
|
973
1010
|
fid.write(f'CMBLOCK,{name:<8},NODE,{len(node_set):8d}\n')
|
|
974
1011
|
fid.write(f'(8i10)\n')
|
|
@@ -996,8 +1033,12 @@ def export_1D_meg(cubit, FileName, Dim='T', MGR2=[] ):
|
|
|
996
1033
|
|
|
997
1034
|
node_set = set()
|
|
998
1035
|
for block_id in cubit.get_block_id_list():
|
|
999
|
-
|
|
1000
|
-
|
|
1036
|
+
elem_types = ["beam"]
|
|
1037
|
+
for elem_type in elem_types:
|
|
1038
|
+
func = getattr(cubit, f"get_block_{elem_type}s")
|
|
1039
|
+
for element_id in func(block_id):
|
|
1040
|
+
node_ids = cubit.get_connectivity(elem_type, element_id)
|
|
1041
|
+
node_set.update(node_ids)
|
|
1001
1042
|
for node_id in node_set:
|
|
1002
1043
|
coord = cubit.get_nodal_coordinates(node_id)
|
|
1003
1044
|
if Dim=='T':
|
|
@@ -1038,10 +1079,14 @@ def export_2D_meg(cubit, FileName, Dim='T', MGR2=[]):
|
|
|
1038
1079
|
fid.write("MGSC 0.001\n")
|
|
1039
1080
|
fid.write("* NODE\n")
|
|
1040
1081
|
|
|
1041
|
-
node_set
|
|
1082
|
+
node_set.clear()
|
|
1042
1083
|
for block_id in cubit.get_block_id_list():
|
|
1043
|
-
|
|
1044
|
-
|
|
1084
|
+
elem_types = ["tri", "quad"]
|
|
1085
|
+
for elem_type in elem_types:
|
|
1086
|
+
func = getattr(cubit, f"get_block_{elem_type}s")
|
|
1087
|
+
for element_id in func(block_id):
|
|
1088
|
+
node_ids = cubit.get_connectivity(elem_type, element_id)
|
|
1089
|
+
node_set.update(node_ids)
|
|
1045
1090
|
for node_id in node_set:
|
|
1046
1091
|
coord = cubit.get_nodal_coordinates(node_id)
|
|
1047
1092
|
if Dim=='T':
|
|
@@ -1090,8 +1135,15 @@ def export_3D_meg(cubit, FileName, Dim='T', MGR2=[], Pyram=True):
|
|
|
1090
1135
|
|
|
1091
1136
|
node_set = set()
|
|
1092
1137
|
for block_id in cubit.get_block_id_list():
|
|
1093
|
-
|
|
1094
|
-
|
|
1138
|
+
elem_types = ["hex", "tet", "wedge", "pyramid"]
|
|
1139
|
+
for elem_type in elem_types:
|
|
1140
|
+
if elem_type == "hex":
|
|
1141
|
+
func = getattr(cubit, f"get_block_{elem_type}es")
|
|
1142
|
+
else:
|
|
1143
|
+
func = getattr(cubit, f"get_block_{elem_type}s")
|
|
1144
|
+
for element_id in func(block_id):
|
|
1145
|
+
node_ids = cubit.get_connectivity(elem_type, element_id)
|
|
1146
|
+
node_set.update(node_ids)
|
|
1095
1147
|
for node_id in node_set:
|
|
1096
1148
|
coord = cubit.get_nodal_coordinates(node_id)
|
|
1097
1149
|
if Dim=='T':
|
|
@@ -1238,9 +1290,15 @@ def export_2D_geo_mesh(cubit, FileName):
|
|
|
1238
1290
|
|
|
1239
1291
|
node_set = set()
|
|
1240
1292
|
for block_id in cubit.get_block_id_list():
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1293
|
+
elem_types = ["hex", "tet", "wedge", "pyramid"]
|
|
1294
|
+
for elem_type in elem_types:
|
|
1295
|
+
if elem_type == "hex":
|
|
1296
|
+
func = getattr(cubit, f"get_block_{elem_type}es")
|
|
1297
|
+
else:
|
|
1298
|
+
func = getattr(cubit, f"get_block_{elem_type}s")
|
|
1299
|
+
for element_id in func(block_id):
|
|
1300
|
+
node_ids = cubit.get_connectivity(elem_type, element_id)
|
|
1301
|
+
node_set.update(node_ids)
|
|
1244
1302
|
for node_id in node_set:
|
|
1245
1303
|
coord = cubit.get_nodal_coordinates(node_id)
|
|
1246
1304
|
nodes.append([coord[0],coord[1]])
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|