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 Mesh of selected domain via MATLAB

Please login with a confirmed email address before reporting spam

Dear all,

I'm currently working on a simulation approach which requires to export the COMSOL-mesh to a Abaqus Inputfile (.inp). Fortunately I already have some code lines that allows me to do so, since I have zero programming experience.

The problem with the exisiting code is, that it only writes out ~3000 nodes of the COMSOL-mesh regardless of the mesh settings (e.g. if I set the mesh to "very fine" it exports the same number of nodes as with "fine").

I think that this is caused by the function mpheval which is used. I tried to use mphmeshstats instead but couldn't get it to work.

What I need is quite simple. After some information lines the code should write out the node numbers of a selected domain (via domain numbers) and the corresponding coordinates x,y,z separated by a decimal comma. This is followed by another text line: *Elements, type=C3D10, elset=set1
After that the element numbers and information gets written. Finally some material definitions are set (not important).

I attached the existing code as MATLAB and Document to make sure that you can open it. Additionally I upload a example of how the Inputfile should look like at the end.

Anyone knows how to export the mesh properly? The export function which is implemented in COMSOL doesn't help, because you can't export a Abaqus Inputfile.

Thank you very much for your help!!

Best regards,
Maximilian




2 Replies Last Post 30 août 2016, 03:35 UTC−4
Walter Frei COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 8 years ago 29 août 2016, 11:07 UTC−4
Hello Maximilian,
In terms of writing COMSOL data out to an arbitrary other file format, you may find this article helpful:
www.comsol.com/blogs/exporting-meshes-and-solutions-using-the-application-builder/
Best Regards,
Hello Maximilian, In terms of writing COMSOL data out to an arbitrary other file format, you may find this article helpful: https://www.comsol.com/blogs/exporting-meshes-and-solutions-using-the-application-builder/ Best Regards,

Please login with a confirmed email address before reporting spam

Posted: 8 years ago 30 août 2016, 03:35 UTC−4
HI Maximilian,

you could also try to export to the VTK format (using COMSOL 5.2a) and then import/export using free software such as Paraview.

Best regards,

Gilles
HI Maximilian, you could also try to export to the VTK format (using COMSOL 5.2a) and then import/export using free software such as Paraview. Best regards, Gilles

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.