@@ -75,7 +75,12 @@ def add_cell(nastran_type, cell, cell_ref):
75
75
76
76
# Treat 2nd order CTETRA, CPYRA, CPENTA, CHEXA elements
77
77
if len (cell ) > num_nodes_per_cell [cell_type ]:
78
- assert cell_type in ["tetra" , "pyramid" , "wedge" , "hexahedron" ]
78
+ assert cell_type in [
79
+ "tetra" ,
80
+ "pyramid" ,
81
+ "wedge" ,
82
+ "hexahedron" ,
83
+ ], f"Illegal cell type { cell_type } "
79
84
if cell_type == "tetra" :
80
85
cell_type = "tetra10"
81
86
nastran_type = "CTETRA_"
@@ -160,31 +165,30 @@ def add_cell(nastran_type, cell, cell_ref):
160
165
# strip chunks
161
166
chunks = [chunk .strip () for chunk in chunks ]
162
167
163
- # remove empty chunks
164
- chunks = [c for c in chunks if c != "" ]
165
-
166
168
keyword = chunks [0 ]
167
169
168
170
# Points
169
171
if keyword == "GRID" :
172
+ # remove empty chunks
173
+ chunks = [c for c in chunks if c != "" ]
170
174
point_id = int (chunks [1 ])
171
175
pref = chunks [2 ].strip ()
172
176
if len (pref ) > 0 :
173
177
point_refs .append (int (pref ))
174
178
points_id .append (point_id )
175
179
points .append ([_nastran_string_to_float (i ) for i in chunks [3 :6 ]])
180
+
176
181
elif keyword == "GRID*" : # large field format: 8 + 16*4 + 8
177
182
point_id = int (chunks [1 ] + chunks [2 ])
178
183
pref = (chunks [3 ] + chunks [4 ]).strip ()
179
184
if len (pref ) > 0 :
180
185
point_refs .append (int (pref ))
181
186
points_id .append (point_id )
182
- chunks2 , _ = _chunk_line (next_line )
183
- next_line = f .readline ()
184
187
points .append (
185
188
[
186
189
_nastran_string_to_float (i + j )
187
- for i , j in [chunks [5 :7 ], chunks [7 :9 ], chunks2 [1 :3 ]]
190
+ # TODO why 10:12, not 9:11? check this in the manual
191
+ for i , j in [chunks [5 :7 ], chunks [7 :9 ], chunks [10 :12 ]]
188
192
]
189
193
)
190
194
0 commit comments