This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

converting dolfin mesh file to gmsh geo file for remeshing

0 votes

Hi,

I'm doing shape optimization with dolfin and as my computational domain deforms, the mesh quality deteriorates so much so that my result becomes inaccurate. I have explored the option of discarding deformed mesh and creating new mesh. So far, that looks impossible in fenics and my only option of smoothing does not yield much improvement. I want to generate my mesh using gmsh and dolfin-convert. However, I want to know if it is possible to convert/transfer my dolfin mesh back to gmsh for re-meshing?

asked Mar 20, 2015 by chuckdii2002 FEniCS Novice (270 points)

Is your problem 2d or 3d? fixing a mesh within dolfin might be a reasonable thing to try first.

My problem is 2d. I'm presently using a mesh generated within dolfin and it's limiting convergence of my optimization scheme since mesh quality deteriorates with time. All I can do at this point is refine and for a badly deformed mesh, it doesn't do much to improve the overall mesh quality

how are you refining? You might try using Edge markers instead of Cell markers. I'll try and post some Mesh improvement algorithms next week some time...

I do a combination of uniform refinement, mesh smoothing and automatic goal oriented error control of my pde.

You could try just selective edge refinement on the longest edges. You can't always refine your way out of trouble, but it's a good starting point. Other algorithms would be 'edge swap' across two cells joined by a long edge, and 'edge collapse' where two points which are too close can merge. The application of these can usually fix most problems, although it is a bit heuristic.
I'm planning on implementing these in the future in dolfin...

Okay. Thanks for the insight. I think I'll go with interfacing fenics and triangle for exchange of mesh information and remeshing by triangle. That way, I'm sure to maintain good mesh quality throughout my optimization. Thanks again.

...