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.

Importing tetrahedral meshes

Please login with a confirmed email address before reporting spam

I'm working on a barycentric mesh refinement code in MATLAB of triangular and tetrahedral COMSOL meshes. The code works perfectly for the 2-d case, just the 3-d case has a big problem: when I try and import the refined mesh (provided as a .mphtxt file) I get following error message:

Failed to enrich mesh:
- Detail: Two elements connect to the same side of the shared element face.

After playing around with some minimal tetrahedral meshes created with COMSOL, I have discovered, that the problem seems to be the order in which nodes that make up an element are given in the .mphtxt file in the section #Elements (e.g. 0 3 1 4; 0 4 1 2). Unfortunately, I have not been able to discover the pattern, the ordering of the nodes that make up an element follows.

Does any one know, how I have to order the four nodes that make up a tetrahedron, so that COMSOL loads the refined mesh?

2 Replies Last Post Nov 19, 2016, 8:36 a.m. EST
Bjorn Bretz COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 7 years ago Nov 7, 2016, 2:31 a.m. EST
See the documentation: Programming Reference Manual > Mesh > Getting and Setting Mesh Data > Element Numbering Conventions.
See the documentation: Programming Reference Manual > Mesh > Getting and Setting Mesh Data > Element Numbering Conventions.

Please login with a confirmed email address before reporting spam

Posted: 7 years ago Nov 19, 2016, 8:36 a.m. EST
Thank you! So all the elements have to follow the same orientation for COMSOL to import the mesh.
Thank you! So all the elements have to follow the same orientation for COMSOL to import the mesh.

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.