diff --git a/packages/seacas/scripts/exodus3.in.py b/packages/seacas/scripts/exodus3.in.py index 7075b31438..8a63dc321a 100644 --- a/packages/seacas/scripts/exodus3.in.py +++ b/packages/seacas/scripts/exodus3.in.py @@ -164,13 +164,12 @@ class ex_options(Enum): if os.name == 'nt': so_prefix = '' so_suffix = 'dll' +elif os.uname()[0] == 'Darwin': + so_prefix = 'lib' + so_suffix = 'dylib' else: - if os.uname()[0] == 'Darwin': - so_prefix = 'lib' - so_suffix = 'dylib' - else: - so_prefix = 'lib' - so_suffix = 'so' + so_prefix = 'lib' + so_suffix = 'so' pip_path = os.path.dirname(__file__) pip_so_path = os.path.join(pip_path, f"{so_prefix}exodus.{so_suffix}") try: @@ -673,7 +672,7 @@ def __init__(self, file, mode=None, array_type='ctype', title=None, >>> ex_pars = ex_init_params(num_dim=numDims, num_nodes=numNodes, - ... num_elem=numElems, num_elem_blk=numElemBlocks, num_assembly=numAssembly) + ... num_elem=numElems, num_elem_blk=numElemBlocks, num_assembly=numAssembly, num_blob=numBlob) >>> exo = exodus(file_name, mode=mode, title=title, ... array_type=array_type, init_params=ex_pars) >>> with exodus(file_name, mode=mode, title=title,\ @@ -729,7 +728,10 @@ def __init__(self, file, mode=None, array_type='ctype', title=None, numElems = 0 if numBlocks is None: numBlocks = 0 - + if numBlob is None: + numBlob = 0 + if numAssembly is None: + numAssembly = 0 info = [title, numDims, numNodes, numElems, numBlocks, numNodeSets, numSideSets] if None not in info: @@ -842,6 +844,7 @@ def put_info_ext(self, p): self.numNodeSets = ctypes.c_longlong(p.num_node_sets) self.numSideSets = ctypes.c_longlong(p.num_side_sets) self.numAssembly = ctypes.c_longlong(p.num_assembly) + self.numBlob = ctypes.c_longlong(p.num_blob) EXODUS_LIB.ex_put_init_ext(self.fileId, ctypes.byref(p)) return True diff --git a/packages/seacas/scripts/tests/test_exodus3.py b/packages/seacas/scripts/tests/test_exodus3.py index 72cc16ad04..69b008f0a5 100755 --- a/packages/seacas/scripts/tests/test_exodus3.py +++ b/packages/seacas/scripts/tests/test_exodus3.py @@ -17,6 +17,7 @@ ACCESS = os.getenv("ACCESS", "@ACCESSDIR@") sys.path.append(os.path.join(ACCESS, "lib")) +sys.path.append(os.path.join(ACCESS, "lib64")) import exodus as exo @@ -59,6 +60,19 @@ def test_exodus_context_manager_reraises_exceptions(self): with exo.exodus(self.temp_exo_path, mode="r"): self.assertFalse(True) + def test_ex_init_params(self): + ex_pars = exo.ex_init_params( + num_dim=2, + num_nodes=9, + num_elem=4, + num_elem_blk=1, + num_assembly=0, + num_blob=0, + ) + new_temp_exo_path = os.path.join(self.tempdir.name, "newexodusfile.e") + with exo.exodus(new_temp_exo_path, mode="w+", init_params=ex_pars) as exo_file: + exo_file.summarize() + def test_copy_opened_in_append_mode(self): new = exo.assembly( name="Unit_test", type=exo.ex_entity_type.EX_ASSEMBLY, id=444