Note: This discussion is about an older version of the COMSOL Multiphysics® software. The information provided may be out of date.

Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.

Index of mesh vertices starting from 0 or 1?

Please login with a confirmed email address before reporting spam

Hi,
i obtain the tet-elements of a mesh by

tets = mesh1.getElem('tet');

which gives me a matrix containing the indices of the four vertices that determine each tet-element in each column.
Now I try to get the coordinates of the vertices by using the index-values with matrix

vertices = mesh1.getVertex;

But some tet have a 0 as index-value, so i guess that Comsol starts counting the vertices from 0. If i don't shift the index +1 Matlab gives me an error because it starts counting arrays from 1.

So am I right with my guess or does 0 mean something else (like 'no vertex' ...which would mean that Comsol also puts triangles in the tet set)?
Best regards

2 Replies Last Post 06.05.2011, 13:34 GMT-4
Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 05.05.2011, 15:20 GMT-4
Hi

normally one could export a mesh in txt format (at least i believe to remember) in there you can find the info, indeed COMSOL starts at index "0", that is among the thing written in the comments

--
Good luck
Ivar
Hi normally one could export a mesh in txt format (at least i believe to remember) in there you can find the info, indeed COMSOL starts at index "0", that is among the thing written in the comments -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 06.05.2011, 13:34 GMT-4
Hi Ivar, thank you for your help :)
Hi Ivar, thank you for your help :)

Note that while COMSOL employees may participate in the discussion forum, COMSOL® software users who are on-subscription should submit their questions via the Support Center for a more comprehensive response from the Technical Support team.