Skip to content

Commit b603bed

Browse files
akaszynskigerma89RobPasMue
authored
Add helpful error when failing to read compressed result files (#474)
* add helpful error when failing to read compressed result files * clean up rst header check --------- Co-authored-by: German <[email protected]> Co-authored-by: Roberto Pastor Muela <[email protected]>
1 parent 7da5a49 commit b603bed

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

ansys/mapdl/reader/rst.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,8 +232,15 @@ def _read_result_header(self):
232232
# consider moving this to the main class
233233
standard_header = read_standard_header(self.filename)
234234

235-
# Read .RST FILE HEADER
236-
header = parse_header(self.read_record(103), result_header_keys)
235+
# Read .rst file header. Header must contain 80 items
236+
record = self.read_record(103)
237+
if record.size > 80:
238+
raise RuntimeError(
239+
"Unable to read result header. Try disabling MAPDL compression with:\n\n"
240+
" /FCOMP,RST,0"
241+
)
242+
header = parse_header(record, result_header_keys)
243+
237244
resultheader = merge_two_dicts(header, standard_header)
238245

239246
# Read nodal equivalence table

0 commit comments

Comments
 (0)