sandialabs / seacas

The Sandia Engineering Analysis Code Access System (SEACAS) is a suite of preprocessing, postprocessing, translation, and utility applications supporting finite element analysis software using the Exodus database file format.
Other
137 stars 79 forks source link

summarize function complains about missing variables in exodus class #541

Open adigc opened 3 days ago

adigc commented 3 days ago

Hello all

I am compiling and using version : v2024-11-07 and using the python wrappers to create an exodus file.

I have the following python script doing the same

#!/usr/bin/env python3
import sys
import exodus

ex_pars = exodus.ex_init_params(num_dim=2, num_nodes=9,num_elem=4, num_elem_blk=1, num_assembly=0)
file = exodus.exodus("newexodusfile.e", mode='w+', title=title, array_type='numpy', init_params=ex_pars)
file.summarize()
file.close()

The above script produces the follwing error :

You are using exodus.py v 1.21.3 (seacas-py3), a python wrapper of some of the exodus library.

Copyright (c) 2013-2023 National Technology &
Engineering Solutions of Sandia, LLC (NTESS).  Under the terms of
Contract DE-NA0003525 with NTESS, the U.S. Government retains certain
rights in this software.

Opening exodus file: newexodusfile.e
/home/user/seacas/2024-11-07/lib/exodus.py:1960: RuntimeWarning: A builtin ctypes object gave a PEP3118 format string that does not match its itemsize, so a best-guess will be made of the data type. Newer versions of python may behave correctly.
  ids = self.np.array(ids)
Traceback (most recent call last):
  File "/home/user/test_exo.py", line 20, in <module>
    file.summarize()
  File "/home/user/seacas/2024-11-07/lib/exodus.py", line 825, in summarize
    self.num_blob(), num_blob_vars))
  File "/home/user/seacas/2024-11-07/lib/exodus.py", line 2559, in num_blob
    return self.numBlob.value

I had a look at the exodus3.py and the member variable numBlob is never initialized.

NOTE: Explicitly initializing this variable in the constructor of installed exodus3.py solved the issue. But this should be solved in the repository aswell.

gsjaardema commented 2 days ago

Thanks, I will take a look