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.

Extract mesh information in Matlab

Please login with a confirmed email address before reporting spam

Hello,

I'm new to Comsol. Can anybody explain how to extract surface mesh info from Comsol? I'm using version 3.5.
The following is what I did:
(1) load a 2D curve y=f(x) into Comsol.
(2) Revolve and generate an axi-symmatric 3D object.
(3) Use init mesh to generate mesh. (But not sure it is the volume mesh or surface mesh)
(4) Export mesh to fem structure.

The information I need from the exported fem structure includes:
(1) x,y,z coordinates of nodes on the surface only.
(2) element connection.
(3) edge list.

Now I can see that "fem" is in my matlab workspace. But I don't know how to go further to dig out more. I
thought there should be something called "fem.mesh.p" or "fem.mesh.t". But it seems in my fem structure,
there is only something called "fem.xmesh".

Another problem is I don't know whether the mesh generated in comsol is volume mesh or surface mesh.
I only need surface mesh.

Thanks for your help.


3 Replies Last Post 27 gen 2012, 12:17 GMT-5
COMSOL Moderator

Hello Tony Gao

Your Discussion has gone 30 days without a reply. If you still need help with COMSOL and have an on-subscription license, please visit our Support Center for help.

If you do not hold an on-subscription license, you may find an answer in another Discussion or in the Knowledge Base.


Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 26 gen 2012, 22:05 GMT-5
Hi Tony,

with a simple command like

ComsolMesh = get(mesh1);

mesh data is accessible and you can get vertex points with

vertex = ComsolMesh.Vertex

But there is no clue how these points should be connected together!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

I've done this with comsol 4.2 and matlab 2007.
Hi Tony, with a simple command like ComsolMesh = get(mesh1); mesh data is accessible and you can get vertex points with vertex = ComsolMesh.Vertex But there is no clue how these points should be connected together!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! I've done this with comsol 4.2 and matlab 2007.

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 26 gen 2012, 22:05 GMT-5
Hi Tony,

with a simple command like

ComsolMesh = get(mesh1);

mesh data is accessible and you can get vertex points with

vertex = ComsolMesh.Vertex

But there is no clue how these points should be connected together!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

I've done this with comsol 4.2 and matlab 2007.
Hi Tony, with a simple command like ComsolMesh = get(mesh1); mesh data is accessible and you can get vertex points with vertex = ComsolMesh.Vertex But there is no clue how these points should be connected together!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! I've done this with comsol 4.2 and matlab 2007.

Masoud Ghorbani Moghaddam

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 27 gen 2012, 12:17 GMT-5
Hi,

You can also have access to all mesh information from the GUI. There you can find also the way the elements are attached. You just need to do right-Click on the Mesh (In Gui) and Export it to a file. (It has all the information about your mesh). This is possible in Comsol 4.2. I hope it is also available in 3.5 version for you.

Masoud
Hi, You can also have access to all mesh information from the GUI. There you can find also the way the elements are attached. You just need to do right-Click on the Mesh (In Gui) and Export it to a file. (It has all the information about your mesh). This is possible in Comsol 4.2. I hope it is also available in 3.5 version for you. Masoud

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.