ansys / pymapdl

Pythonic interface to MAPDL
https://mapdl.docs.pyansys.com
MIT License
419 stars 117 forks source link

Node numbering is inconsistent #3120

Open mikerife opened 1 month ago

mikerife commented 1 month ago

Discussed in https://github.com/ansys/pymapdl/discussions/3119

Originally posted by **YMDONG23** May 23, 2024 hello :) When I use the BEAM188 unit to calculate, the node number displayed in the eplot window is not the same as the node number when vtk=False. What is the reason? If you could discuss with me, thank you very much for your help! ![Figure_1](https://github.com/ansys/pymapdl/assets/167749638/3b1ba69e-6771-406e-b615-5613421329da) ![image](https://github.com/ansys/pymapdl/assets/167749638/dca7480e-7d79-459a-b4c7-d68965541f64)
germa89 commented 1 month ago

Code to replicate this issue in: https://github.com/ansys/pymapdl/discussions/3119?notification_referrer_id=NT_kwDOAa2IUbQxMDc3OTQwNTU0MToyODE0OTg0MQ#discussioncomment-9571309

GitHub
Node numbering is inconsistent · ansys pymapdl · Discussion #3119
hello :) When I use the BEAM188 unit to calculate, the node number displayed in the eplot window is not the same as the node number when vtk=False. What is the reason? If you could discuss with me,...
germa89 commented 1 month ago

Further more, I am getting this error:

>>> mapdl.nplot(vtk=True, show_node_numbering=True)
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Cell In[4], line 1
----> 1 mapdl.nplot(vtk=True, show_node_numbering=True)

File ~/Other_pymapdls/pymapdl_0/pymapdl/src/ansys/mapdl/core/mapdl_extended.py:1104, in _MapdlCommandExtended.nplot(self, nnum, vtk, **kwargs)
   1102         labels = [{"points": pcloud.points, "labels": pcloud["labels"]}]
   1103     points = [{"points": self.mesh.nodes}]
-> 1104     return general_plotter([], points, labels, mapdl=self, **kwargs)
   1106 # otherwise, use the built-in nplot
   1107 if isinstance(nnum, bool):

TypeError: general_plotter() got an unexpected keyword argument 'show_node_numbering'
germa89 commented 1 month ago

I think the error comes when plotting the labels. The node IDs seems correct.

brunotessaro commented 3 weeks ago

This issue seems to happen not only on element numbering, but with general geometrical entities. Here is a minimal example creating 3 keypoints and connecting the first two with a line:

from ansys.mapdl.core import launch_mapdl

# Launch MAPDL instance
mapdl = launch_mapdl()

# Enter pre-processing mode
mapdl.prep7()

# Create keypoints 3 keypoints
mapdl.k(1, 0, 0, 0)
mapdl.k(2, 1, 0, 0)
mapdl.k(3, 1, 1, 0)

# Create line connecting keypoints 1 and 2
mapdl.l(1, 2)

# Plot the geometry
mapdl.lplot(show_line_numbering=False, show_keypoint_numbering=True, color_lines=True)

The output shows keypoint 1 connected to keypoint 3 instead of 2:

image

This is an import issue, specially when setting boundary conditions and/or mesh refinement over complex geometries.