4
4
from __future__ import annotations
5
5
6
6
import numpy as np
7
- from rich import print
8
7
9
8
from ..__about__ import __version__
10
9
from .._common import num_nodes_per_cell , warn
@@ -124,8 +123,10 @@ def add_cell(nastran_type, cell, cell_ref):
124
123
chunks .append (c )
125
124
while True :
126
125
next_line = f .readline ()
126
+
127
127
if not next_line :
128
128
raise ReadError ("Premature EOF" )
129
+
129
130
# Blank lines or comments
130
131
if len (next_line ) < 4 or next_line .startswith (("$" , "//" , "#" )):
131
132
continue
@@ -138,7 +139,7 @@ def add_cell(nastran_type, cell, cell_ref):
138
139
# continues on another line.
139
140
c , _ = _chunk_line (next_line )
140
141
chunks .append (c [1 :])
141
- elif len (chunks [- 1 ]) == 10 and chunks [- 1 ][9 ] == " " :
142
+ elif len (chunks [- 1 ]) == 10 and chunks [- 1 ][- 1 ] == " " :
142
143
# automatic continuation: last chunk of previous line and first
143
144
# chunk of current line are spaces
144
145
c , _ = _chunk_line (next_line )
@@ -147,7 +148,7 @@ def add_cell(nastran_type, cell, cell_ref):
147
148
chunks .append (c [1 :])
148
149
else :
149
150
# not a continuation
150
- pass
151
+ chunks . append ( c )
151
152
else :
152
153
break
153
154
@@ -160,8 +161,6 @@ def add_cell(nastran_type, cell, cell_ref):
160
161
# remove empty chunks
161
162
chunks = [c for c in chunks if c != "" ]
162
163
163
- print ("c" , chunks )
164
-
165
164
keyword = chunks [0 ]
166
165
167
166
# Points
@@ -204,9 +203,6 @@ def add_cell(nastran_type, cell, cell_ref):
204
203
# This information is removed.
205
204
cell = chunks [3 :5 ]
206
205
else :
207
- print (keyword )
208
- print (chunks )
209
- exit (1 )
210
206
cell = chunks [3 :]
211
207
212
208
# remove empty chunks
@@ -227,6 +223,7 @@ def add_cell(nastran_type, cell, cell_ref):
227
223
points_id_dict = dict (zip (points_id , np .arange (len (points ), dtype = int )))
228
224
points_id_get = np .vectorize (points_id_dict .__getitem__ )
229
225
for k , c in enumerate (cells ):
226
+ print (c .data )
230
227
cells [k ] = CellBlock (c .type , points_id_get (c .data ))
231
228
232
229
# Construct the mesh object
0 commit comments