Differences between getNode and getNodes
Hello,
I have a question regarding two functions of gmsh: getNode and getNodes. I have the following two codes where I use them.
#FIRST VERSION
dim = -1 #dimensions of the entities, 0 for points, 1 for curves/edge/lines, 2 for surfaces, 3 for volumes, -1 for all the entities
tag = -1 #all the nodes of the room
nodeTags, coords, parametricCoord = gmsh.model.mesh.getNodes(dim,tag) #gets the tags for each node and the coordinates of each node
nodecoords = coords.reshape((-1,3)) #coordinates reshaped in a matrix 3xnumber of nodes
#If I want the coordinates of a specific nodes, I take them directly from the "nodecoords" variable.
bc0 = nodecoords[int(nodes[0]-1)] #coordinates of vertix 0
bc1 = nodecoords[int(nodes[1]-1)] #coordinates of vertix 1
bc2 = nodecoords[int(nodes[2]-1)] #coordinates of vertix 2
The first version includes the "-1" because Python starts at zero while the node tags start at 1.
Another way that I tried is the following:
#SECOND VERSION
dim = -1 #dimensions of the entities, 0 for points, 1 for curves/edge/lines, 2 for surfaces, 3 for volumes, -1 for all the entities
tag = -1 #all the nodes of the room
nodeTags, coords, parametricCoord = gmsh.model.mesh.getNodes(dim,tag) #gets the tags for each node and the coordinates of each node
nodecoords = coords.reshape((-1,3)) #coordinates reshaped in a matrix 3xnumber of nodes
#If I want the coordinates of a specific nodes, I take them using the fucntion getNode
bc0 = gmsh.model.mesh.getNode(nodes[0])[0] #coordinates of vertix 0
bc1 = gmsh.model.mesh.getNode(nodes[1])[0] #coordinates of vertix 1
bc2 = gmsh.model.mesh.getNode(nodes[2])[0] #coordinates of vertix 2
For some 3D rooms, the two versions of the code give the same results, but for others no.
I also noticed that if I use a different msh file version, the bc0 coordinates etc... do not match.
Is there a difference in the two ways of obtaining the coordinates of each node?
Thank you very much