Importing Mesh from COMSOL

Has anyone extracted a mesh from COMSOL and imported it into FreeFem?

I am exporting a 2d mesh from COMSOL. There are different formats that I can extract. I extract and tried all of them, but I cannot import it into FreeFem.

Does anyone know what format I should do and what procedure I should follow?

I appreciate your help.

What format did you try?

Thank you for your reply. I tried all the formats.
mphbin, mphtxt: these two weren’t useful because freefem and also Gmsh cannot open them.

.nas: I could open this with Gmsh and save it as msh file. But I wasn’t able to open it with code.

.vtu: THis one was also not readable in freefem.

Could you please tell me what to do? Thank you.

If you can open with Gmsh and then export to .mesh or .msh, then that should be alright.

Thank you again.

I saved it .msh file, but it is not opening if freefem.

load “gmsh”
mesh Th=gmshload(“Mesh4.msh”);

this is the error:
mshptg bug in number of points 1 > 1 == max nb points
Sorry Error build delaunay triangle error = 1
current line = 3
Exec error : Error mshptg8_
– number :1
Exec error : Error mshptg8_
– number :1
err code 8 , mpirank 0
try getConsole C:\Users\ava\Desktop\My FreeFem\reading.edp
save log in : ‘C:\Users\ava\Desktop\My FreeFem\reading.log’
wait enter ?

Please let me know what I should do.

Can I give you my .nas or .msh file and you check it, please?

Sure, upload the .msh.

Thank you.

I appreciate your help.
Mesh1.mesh (836.8 KB)

Your mesh has no boundary elements, so it cannot be read by FreeFEM. You need to define the surface of the circle.

Could you please help me how I can do that?

The file that I sent you is the result of gmsh from .nas of the COMSOL.

Some time ago I used feconv to convert a 3D mesh from mphtxt format to gmsh format. Check out the software. Maybe it also works for 2D meshes.