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.

Creating meshes in Matlab with given set of vertices, tetrahedra and faces

Please login with a confirmed email address before reporting spam

Hello everyone!

I have a procedure which generates a tetrahedral mesh externally. So now I have a set of vertices, tetrahedra and faces. Can anyone tell me what would be the Matlab syntax to create a Comsol 4.1 compatible model containing this mesh? I have done this previously with Comsol 3.4, but have not yet been able to find an equivalent in COOMSOL 4.1 Livelink with Matlab. I was planning to have every tetrahedra as a single domain...


I hope this makes sense.
Thanks!

2 Replies Last Post Nov 19, 2014, 12:43 a.m. EST
Lars Gregersen COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Oct 5, 2011, 5:29 a.m. EDT
Hi

You can find the method to use in the COMSOL API Reference Guide in the chapter on Meshing. There is a subseciton on "Getting and Setting Mesh Data" that shows what to do.

You should probably start with a simple mesh to learn the required syntax and data structures.


Lars Gregersen
Comsol Denmark
Hi You can find the method to use in the COMSOL API Reference Guide in the chapter on Meshing. There is a subseciton on "Getting and Setting Mesh Data" that shows what to do. You should probably start with a simple mesh to learn the required syntax and data structures. Lars Gregersen Comsol Denmark

Please login with a confirmed email address before reporting spam

Posted: 10 years ago Nov 19, 2014, 12:43 a.m. EST
Just a note for anybody else considering following this trail.

I found that the API mentioned is quite powerful, however when it comes to elements with curved edges, setting the mesh properly suddenly becomes a big project of its own. In my case, these curved fillets are essential to avoid singularities at concave corners and at corners that are not at 90° to each other where the BCs change. I imagine similar things will be necessary in all but the most trivial geometries.

While I dealt with my particular problem by using mapped mesh everywhere, this isn't going to work for all cases. So I hope that future versions of the mesh import API are more friendly for setting curved edge and boundary parameters.
Just a note for anybody else considering following this trail. I found that the API mentioned is quite powerful, however when it comes to elements with curved edges, setting the mesh properly suddenly becomes a big project of its own. In my case, these curved fillets are essential to avoid singularities at concave corners and at corners that are not at 90° to each other where the BCs change. I imagine similar things will be necessary in all but the most trivial geometries. While I dealt with my particular problem by using mapped mesh everywhere, this isn't going to work for all cases. So I hope that future versions of the mesh import API are more friendly for setting curved edge and boundary parameters.

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.