Skip to content

Commit 19a40ce

Browse files
rileychallakaszynski
authored andcommitted
Correct misnamed nnum to enum (#1359)
* Correct misnamed `nnum` to `enum` * add test Co-authored-by: Alex Kaszynski <[email protected]>
1 parent fc81582 commit 19a40ce

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

src/ansys/mapdl/core/post.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -615,10 +615,10 @@ def _all_nnum(self):
615615
def _all_enum(self):
616616
self._mapdl.cm("__TMP_ELEM__", "ELEM")
617617
self._mapdl.allsel()
618-
nnum = self._mapdl.get_array("ELEM", item1="ELIST")
618+
enum = self._mapdl.get_array("ELEM", item1="ELIST")
619619

620620
# rerun if encountered weird edge case of negative first index.
621-
if nnum[0] == -1:
621+
if enum[0] == -1:
622622
enum = self._mapdl.get_array("ELEM", item1="ELIST")
623623
self._mapdl.cmsel("S", "__TMP_ELEM__", "ELEM")
624624
return enum.astype(np.int32, copy=False)

tests/test_post.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,19 @@ def test_disp(mapdl, static_solve, comp):
431431
assert np.allclose(disp_from_grpc, disp_from_prns)
432432

433433

434+
def test_enum_all(mapdl, static_solve):
435+
# ensure that element selection status has no effect on the all_enum
436+
try:
437+
n_elem = mapdl.mesh.n_elem
438+
mapdl.esel("S", "ELEM", vmin=10, vmax=19, mute=True)
439+
mapdl.post_processing._all_enum
440+
assert len(mapdl.post_processing._all_enum) == n_elem
441+
finally:
442+
# static solve is a module fixture, change in state here will affect
443+
# downstream tests unless reset
444+
mapdl.allsel(mute=True)
445+
446+
434447
def test_disp_norm_all(mapdl, static_solve):
435448

436449
# test norm

0 commit comments

Comments
 (0)