Hi everyone,
I want to use some ALE-method with remeshing, but I have problems writing my velocity field, which is composed of second order Lagrange-elements, in a single output file.
I have tried all 3 types of writers (dolfinx.io.VTKFile, dolfinx.io.VTXWriter, dolfinx.io.XDMFFile), but each of them has its drawbacks in this case:
dolfinx.io.VTKFileis here practically the best one. The mesh geometry/topology can be updated every time step and you can write second order elements directly to the output files. It’s just annoying how many output files you produce, if you have many time steps. Would it be possible to move everything except thepvd-file (vtuandpvtufiles) into a subdirectory of the output directory to avoid the clutter of files there? Further the simplevtuFormat seems to be worse than the other two formats.dolfinx.io.VTXWriterseems to work, if you initialize the writer with the argumentmesh_policy=VTXMeshPolicy.update. Also quadratic elements and changes in the mesh’s geometry are allowed, but you cannot change the topology of the mesh, e. g. applying remeshing or mesh refinment, (orparaview(Version 6.1.1) fails in the visualization of the topology change. I’m not sure since I don’t know the details of the file format). After each change in topology you have to create a new output file, which is not what I want for the visualization inparaview.dolfinx.io.XDMFFilealso seems to work using the suggestion of the discussion in https://fenicsproject.discourse.group/t/update-mesh-over-time/13827, but it seems, that the xdmf-format is not ideal for changes in the geometry or topology of the mesh and the implementation is quite tricky (the solution in the post above suggest renaming the mesh every time step and settingmesh_xpath=f"/Xdmf/Domain/Grid[@Name='{mesh.name}']"as argument, when callingdolfinx.io.XDMFFile.write_function). Further the xdmf-format does not support quadratic Lagrange elements, so higher order elements must be interpolated or projected into a lower order space. This works, but then you loose some information.
To summarize this into a single question: Is there an output file format, that supports quadratic elements, changes in the mesh’s geometry and topology in time and do not blow up your output directory with files?
In my opinion the simplest solution would be using dolfinx.io.VTKFile as writer, but allow to create an additional subdirectory for all the vtuand pvtu files. You just need to add the (relative) path to this subdirectory to the filenames in your pvd-file.
Thanks in advance.