## Preprocessing

Topics relate to geometry, meshing, and CAD

#### Number of nodes incoherent

• Yassine Naffeti
Subscriber

Hi,

I am using PyMAPDL on python to process a modal analysis and optimize it.
I solved the same model previously on the software ANSYS Mechanical directly and the number of nodes was 616169 in the software.
Then I exported the simulation file using cdwrite with the option "ALL" containing all geometry, material property, load, and component data. Then I loaded it with python and solved it again but I get a small difference in the number of nodes, but the results like eigenfrequencies are the same. The problem is not only the number of nodes is different from what I could see on ANSYS Mechanical, it is also incoherent within some arrays/variables that I get from APDL. I will explain this more as follows, this is a python code:

1) print(mapdl.mesh)

Output:
ANSYS Mesh
Number of Nodes:              616211
Number of Elements:           322069
Number of Element Types:      220
Number of Node Components:    0
Number of Element Components: 0

2)  also when getting the number of nodes using mapdl.mesh.n_node it gives back the same number

number_nodes = mapdl.mesh.n_node
print(number_nodes)

Output: 616211

3) However when I store the nodes in an array the length of it which should correspond to the number of nodes is different from we got previously

nodes = mapdl.mesh.nodes
print(len(nodes))

Output: 616256

4) using mapdl.db.nodes

print(mapdl.db.nodes)

MAPDL Database Nodes
Number of nodes: 616256
Number of selected nodes: 616256
Maximum node number: 616256

5) and again when I retrieve the displacements for all the nodes I get an array not matching the number of nodes that I get previously from mapdl.mesh.nodes  ; I get the displacements for 616211 nodes only which is different from 616256

all_displacements = mapdl.post_processing.nodal_displacement("ALL")
print(len(all_displacements))
Output: 616211

To put you in context: this is causing me a problem because I have the coordinates of some points where I want to get the displacement. But first what I do is that I determine the closest node to the point and then get the displacement of it from the array all_displacement. But in this case the number of nodes is varying in this interval [1, 616256] and the displacements I get are for only for 616211 nodes. So let's say I want the displacement for the node number 600000, if I use the nodal displacement array that I get from postprocessing I don't know if it actually corresponds to the same node.

Every help is appreciated. Thank very much in advance.

• Aniket
Ansys Employee

PyAnsys project is developed and supported through GitHub. You can post issues and request new features on the Issues page for each package, or contact PyAnsys support. For more details, please refer to PyAnsys GitHub page:
https://github.com/pyansys

-Aniket

How to access Ansys help links

Guidelines for Posting on Ansys Learning Forum