Skip to content

Commit 1c1ae2f

Browse files
committed
more nastran fixes
1 parent f666ad3 commit 1c1ae2f

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

src/meshio/nastran/_nastran.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
from __future__ import annotations
55

66
import numpy as np
7-
from rich import print
87

98
from ..__about__ import __version__
109
from .._common import num_nodes_per_cell, warn
@@ -124,8 +123,10 @@ def add_cell(nastran_type, cell, cell_ref):
124123
chunks.append(c)
125124
while True:
126125
next_line = f.readline()
126+
127127
if not next_line:
128128
raise ReadError("Premature EOF")
129+
129130
# Blank lines or comments
130131
if len(next_line) < 4 or next_line.startswith(("$", "//", "#")):
131132
continue
@@ -138,7 +139,7 @@ def add_cell(nastran_type, cell, cell_ref):
138139
# continues on another line.
139140
c, _ = _chunk_line(next_line)
140141
chunks.append(c[1:])
141-
elif len(chunks[-1]) == 10 and chunks[-1][9] == " ":
142+
elif len(chunks[-1]) == 10 and chunks[-1][-1] == " ":
142143
# automatic continuation: last chunk of previous line and first
143144
# chunk of current line are spaces
144145
c, _ = _chunk_line(next_line)
@@ -147,7 +148,7 @@ def add_cell(nastran_type, cell, cell_ref):
147148
chunks.append(c[1:])
148149
else:
149150
# not a continuation
150-
pass
151+
chunks.append(c)
151152
else:
152153
break
153154

@@ -160,8 +161,6 @@ def add_cell(nastran_type, cell, cell_ref):
160161
# remove empty chunks
161162
chunks = [c for c in chunks if c != ""]
162163

163-
print("c", chunks)
164-
165164
keyword = chunks[0]
166165

167166
# Points
@@ -204,9 +203,6 @@ def add_cell(nastran_type, cell, cell_ref):
204203
# This information is removed.
205204
cell = chunks[3:5]
206205
else:
207-
print(keyword)
208-
print(chunks)
209-
exit(1)
210206
cell = chunks[3:]
211207

212208
# remove empty chunks
@@ -227,6 +223,7 @@ def add_cell(nastran_type, cell, cell_ref):
227223
points_id_dict = dict(zip(points_id, np.arange(len(points), dtype=int)))
228224
points_id_get = np.vectorize(points_id_dict.__getitem__)
229225
for k, c in enumerate(cells):
226+
print(c.data)
230227
cells[k] = CellBlock(c.type, points_id_get(c.data))
231228

232229
# Construct the mesh object

0 commit comments

Comments
 (0)