I’ve got a question regarding remeshing in fenics. I generate my mesh using gmsh (and meshio), and solve a shape optimization problem where I want to be able to remesh my geometry (using whatever conditions) after it has been deformed.

I wanted to ask whether there is a “simple” way of converting my deformed mesh / geometry into a mesh or geometry file for gmsh so that I can remesh the whole thing there. Of course, I can use meshio again to generate, e.g., an .xdmf file of my mesh and convert this to a .msh file, but gmsh cannot really work with a mesh file as input, and the CreateGeometry command (which is available in newer versions) does not do the trick.

Maybe someone has had similar issues and can give me a hint how to do this remeshing in a simple manner. Thank you.

@dokken I’m working on the optimization of a continuous flow reactor, so I have a mixture of transport and fluid equations as constraints.
I knew that there exist certain possibilities for computing gradients of optimal control problems with dolfin-adjoint, but I wasn’t aware that it can also be used for shape optimization. Anyway, I’m considering a optimize then discretize approach, so I don’t think I’d use this for the computation, but I may use this as a validation tool.

I started working on the shape optimization implementation in dolfin-adjoint ~1.5 years ago. We released it to master in february. Currently wrapping up a paper on the subject.