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?
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 ?
Hello,
I recently have tried feconv that @henkel suggested and it worked! Thanks to him!
I wanted to import in freefem a mesh of a 2d square with a slit from COMSOL.
Firstly, you need to choose .mphtxt and check all the 4 first vâs on the export menu, that is:
domain elements
boundary elements
vertex elements
geometric entity information
But then all I had to do was to write in cmd (though installing feconv is a bit hard):
cd <go to a place where feconv is>
feconv -ff <yourfile.mphtxt> <newfile.msh>
-ff is for when .msh file appears, you choose for freefem. You could also write -gm for gmsh.
And then you just read it in freefem: mesh Th = readmesh("newfile.msh"); plot(Th, wait=1);
P.S. At least thatâs what I had come to, through trying and failing.
P.S.S. If you need to deal with labels, I just printed them out with cout << labels(Th)<< endl; and itâs just numbers. I deformed the square by the numbers one by one until I finally discovered every sidesâ labels.
P.S.S.S. If you read somewhere that for importing 2d-mesh you need to remove z-axis from your file because freefem canât read because of it, donât trust them. Freefem reads 2d meshes just fine with readmesh().