Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Difference between NLIST and mapdl.mesh.nodes #1548

Closed
3 tasks done
germa89 opened this issue Oct 13, 2022 · 1 comment
Closed
3 tasks done

Difference between NLIST and mapdl.mesh.nodes #1548

germa89 opened this issue Oct 13, 2022 · 1 comment
Labels
MAPDL Requires changes in MAPDL

Comments

@germa89
Copy link
Collaborator

germa89 commented Oct 13, 2022

Before submitting the issue

  • I have searched among the existing issues
  • I am using a Python virtual environment
  • I have a fully updated virtual environment (i.e. pip install --upgrade --upgrade-strategy eager ansys-mapdl-core)

Description of the bug

Basically, in beam elements (and I presume any kind of element which has hidden nodes), the mapdl.mesh.nodes returns those hidden nodes.

This is not desirable.

Steps To Reproduce

from ansys.mapdl.core import launch_mapdl
mapdl = launch_mapdl()

mapdl.mute = True
mapdl.finish()
mapdl.clear()
mapdl.input(examples.verif_files.vmfiles["vm10"])

mapdl.post1()
mapdl.set(1, 2)
mapdl.mute = False

text = "\n".join(mapdl.nlist().splitlines()[5:])
nlist = np.array([np.fromstring(each, sep=" ") for each in text.splitlines()])


assert np.allclose(nlist[:, 1:4], mapdl.mesh.nodes, rtol=1E-3)
Traceback (most recent call last):
  File "C:\ProgramData\Miniconda3\envs\pymapdl_0\lib\site-packages\numpy\core\numeric.py", line 2375, in isclose
    return within_tol(x, y, atol, rtol)
  File "C:\ProgramData\Miniconda3\envs\pymapdl_0\lib\site-packages\numpy\core\numeric.py", line 2356, in within_tol
    return less_equal(abs(x-y), atol + rtol * abs(y))
ValueError: operands could not be broadcast together with shapes (3,3) (5,3)

So, it seems to me that the NLIST command does not retrieve the midside nodes, whereas mapdl.mesh.nodes (which use the grpc method) does it.

For more info, mapdl.mesh.nodes returns:

>>> mapdl.mesh.nodes
array([[  0.        ,   0.        ,   0.        ],
       [100.        ,   0.        ,   0.        ],
       [  0.        ,   1.        ,   0.        ],
       [ 33.33333333,   0.        ,   0.        ],
       [ 66.66666667,   0.        ,   0.        ]])

The extra nodes, are indeed, in the middle elements.

The FE element is 188 (a 2D beam element), hence these middle nodes are supposed to be hidden. Hence, they should not be retrieved (at least by default) by mapdl.mesh.nodes.

@FredAns do you think you can implement an optional argument to the gRPC method that allows us to choose if we want midside nodes or not?

Pinging @akaszynski for visibility.

Which Operating System are you using?

Windows

Which Python version are you using?

3.9

PyMAPDL Report

NA

Installed packages

NA

@germa89 germa89 added the MAPDL Requires changes in MAPDL label Oct 13, 2022
@germa89
Copy link
Collaborator Author

germa89 commented Apr 13, 2023

Closing issue, we can obtain same result using:

nlist = mapdl.nlist(kinternal="internal")
assert np.allclose(nlist.to_array()[:, 1:4], mapdl.mesh.nodes)

@germa89 germa89 closed this as completed Apr 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
MAPDL Requires changes in MAPDL
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant