This already reads in the mesh, it’s unclear to me why you would need the rest of the code, considering that dolfinx has XDMFFile to write the mesh and its mesh tags out.
Dear, are you saying that calculations can be performed without converting to an XDMF file? I’m just following the tutorial in the link(https://jsdokken.com/dolfinx-tutorial/chapter3/subdomains.html#) below and hoping to convert the quadrilateral mesh to XDMF as well. (I only know that XDMF is a suitable format for reading meshes, such as for visualization in ParaView.) Could you help me?
To address the error mentioned above, I changed the keyword from “quadrilateral” to “quad”, and it seems to be running now. However, I encountered an error related to the lack of “h5py”. I am using a conda environment and installed h5py with the following command:
pip3 install h5py
The code runs normally and generates mesh file. When I visualize the mesh using Paraview, the mesh looks normal, but why does the color bar show numerical values?
Thank you for providing the simpler method and helpful explanation. As shown in the figure, I did indeed make markings in Gmsh because it is necessary to determine the numbering of boundary conditions when writing the variational formula:
L = f * v * dx - g * v * ds(561)
Will these markings affect the calculation results? If they do not, I will ignore this issue.