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.

Export Individual Sub-Domain Mesh to MATLAB

Please login with a confirmed email address before reporting spam

Hello Experts,

I have access to multiple versions of Comsol, 3.5a and 4.0. Currently, my model is in the 3.5a version.

In 3.5a, I can use the xmeshinfo command or fem.mesh.p and fem.mesh.t to export the mesh co-ordinates and connections of the complete model to MATLAB workspace.

Is there any way, I can export the same information individually for each subdomain in my model?

Sanket

3 Replies Last Post Oct 7, 2011, 7:34 a.m. EDT
COMSOL Moderator

Hello Sanket Jain

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 Oct 5, 2011, 7:47 a.m. EDT
Hi everybody,
I've got a similar problem: I want to export the single domain meshes (via the Matlab livelink, where I will have to refer to the mesh node tags).
To do this, I've to define multiple mesh nodes under the mesh branch. But it seems that the single mesh nodes are somehow independent one from each other.
For example, I have 2 blocks and I mesh the first one with a mesh node. Then, I add a second mesh node and I select 'Remaining'. At this very point, the second block is meshed but the first block is meshed again, as if the first mesh node didn't exist.
Therefore, my question is:
- how I can I make the mesh nodes behave in a complementar way? I need different mesh nodes because each of them has a different tag which I can refer to in Matlab.
Thank you in advance for any help.
Regards,
PM
Hi everybody, I've got a similar problem: I want to export the single domain meshes (via the Matlab livelink, where I will have to refer to the mesh node tags). To do this, I've to define multiple mesh nodes under the mesh branch. But it seems that the single mesh nodes are somehow independent one from each other. For example, I have 2 blocks and I mesh the first one with a mesh node. Then, I add a second mesh node and I select 'Remaining'. At this very point, the second block is meshed but the first block is meshed again, as if the first mesh node didn't exist. Therefore, my question is: - how I can I make the mesh nodes behave in a complementar way? I need different mesh nodes because each of them has a different tag which I can refer to in Matlab. Thank you in advance for any help. Regards, PM


Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Oct 5, 2011, 10:44 a.m. EDT
Sorry! I can't be of much help. I used xmeshinfo in 3.5a to take out the co-ordinates and connections of the mesh. Generally, the 5th column of the connection indicated the domain to which each element belong to. I think I used that to find the domain number.

Generally in 4.1, all previous function of 3.5a are preceded by 'mph'. But I haven't tested for it yet!
Sorry! I can't be of much help. I used xmeshinfo in 3.5a to take out the co-ordinates and connections of the mesh. Generally, the 5th column of the connection indicated the domain to which each element belong to. I think I used that to find the domain number. Generally in 4.1, all previous function of 3.5a are preceded by 'mph'. But I haven't tested for it yet!

Lars Gregersen COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Oct 7, 2011, 7:34 a.m. EDT
Hi

In Comsol 4.2 you'll find the function mphmeshstats that will return the information you need for the meshes.

Comsol 4.2 also added a new function mphxmeshinfo that makes access to the xmeshinfo easier. However, for the xmeshinfo there is no easy way to obtain the information from independent domains separately. Write to support if you need help with this.


Lars Gregersen
Comsol Denmark
Hi In Comsol 4.2 you'll find the function mphmeshstats that will return the information you need for the meshes. Comsol 4.2 also added a new function mphxmeshinfo that makes access to the xmeshinfo easier. However, for the xmeshinfo there is no easy way to obtain the information from independent domains separately. Write to support if you need help with this. Lars Gregersen Comsol Denmark

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.