Mesh element numbering
I am new to using Salome. I have a problem that I need to create a cylinder with hexahedral mesh - that is not a problem. The example script helped out and it is ok for me. Then need to convert it to Openfoam and then for calculations I have to add nonuniform value field for the outside of the cylinder. The thing is that I have to put my values at exact element on the cylinder. So I have to know where each of the elements are located. How can I do that?
Well actually I need to know xyz position for specific elements... but it is ok if I can get xyz for all the elements also
Hello Janis
The following code iterates over all 2D elements of the mesh and then over nodes of each element that allows you knowing element position and ID (== f)
faces = mesh.GetElementsByType( smesh.SMESH.FACE )
for f in faces:
nodes = mesh.GetElemNodes( f )
for n in nodes:
x,y,z = mesh.GetNodeXYZ( n )
