Skip to content

Commit

Permalink
fix: Bug located in VSEL using KSWP field (#3753)
Browse files Browse the repository at this point in the history
* fix Bug located in VSEL using KSWP field

* chore: adding changelog file 3753.fixed.md [dependabot-skip]

---------

Co-authored-by: pyansys-ci-bot <[email protected]>
  • Loading branch information
kmkoshy and pyansys-ci-bot authored Feb 19, 2025
1 parent 62b3786 commit 4c6e65a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions doc/changelog.d/3753.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
fix: Bug located in VSEL using KSWP field
2 changes: 1 addition & 1 deletion src/ansys/mapdl/core/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ def _get_args_xsel(*args: Tuple[str], **kwargs: Dict[str, str]) -> Tuple[str]:
vmin = kwargs.pop("vmin", args[3] if len(args) > 3 else "")
vmax = kwargs.pop("vmax", args[4] if len(args) > 4 else "")
vinc = kwargs.pop("vinc", args[5] if len(args) > 5 else "")
kabs = kwargs.pop("kabs", args[6] if len(args) > 6 else "")
kabs = kwargs.pop("kabs", kwargs.pop("kswp", args[6] if len(args) > 6 else ""))
return type_, item, comp, vmin, vmax, vinc, kabs, kwargs


Expand Down
6 changes: 5 additions & 1 deletion tests/test_plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -938,11 +938,15 @@ def test_asel_iterable(mapdl, make_block):
)


def test_vsel_iterable(mapdl, make_block):
def test_vsel_iterable_and_kswp(mapdl, make_block):
mapdl.run("VGEN, 5, 1, , , 100, , , , , ")
assert np.allclose(
mapdl.vsel("S", "volu", "", [1, 2, 4], "", ""), np.array([1, 2, 4])
)
mapdl.vsel("S", "volu", "", [1], "", "", kswp=1)
assert np.allclose(mapdl.geometry.vnum, [1]) and np.allclose(
mapdl.geometry.anum, [1, 2, 3, 4, 5, 6]
)


def test_color_areas(mapdl, make_block):
Expand Down

0 comments on commit 4c6e65a

Please sign in to comment.