Trouble Visualizing Separate Domains in ParaView with FEniCS XDMF Output

Hello,

I am currently working on a simulation in FEniCS that involves multiple domains, and I am encountering difficulties in visualizing these domains separately in ParaView. I have attempted to save the simulation results using the XDMF format, hoping to utilize the “Extract Subset” option in ParaView. However, this option is not active, which suggests that perhaps the domain tags are not being saved or recognized correctly.

Could anyone guide me on how to properly save the results, so that I can visualize each domain separately in ParaView?

Any advice or suggested workflows would be greatly appreciated!

Thank you!

Hi @Mehran, welcome to ParaView!

Do you have a sample dataset you can post here (or on a file sharing site if too big) to help us understand what problems you are running into?

Hello Cory,

Thank you for your prompt response! I have uploaded the sample dataset named output.xdmf. This file contains two separate domains: domain1 and domain2, which were initially tagged in Gmsh and then exported as a mesh in .msh format to FEniCS.

I saved these files using the following command in FEniCS:

file = XDMFFile(path_results + “output.xdmf”)
file.write(p)

I appreciate any guidance or suggestions you can provide on how to effectively visualize these domains separately in ParaView.

Thanks in advance!

output.xdmf (673 Bytes)
output.h5 (67.6 KB)

Thanks for the data @Mehran. When I open it, it contains a single Unstructured Grid dataset with a single node-centered dataset “f_1913-1”. Extract Subset takes as input a regular grid, so it cannot be used on an unstructured grid.

I’m afraid I don’t see any way to distinguish your two domains in this file.

Yes, that describes my problem accurately. The key issue seems to be how I’m saving the data, which isn’t suitable for the “Extract Subset” operation in ParaView. Could you advise on the proper method to save the results in FEniCS so that they can be compatible with operations like “Extract Subset” in ParaView? Specifically, is there a way to save the data in a format that would allow me to distinguish and manipulate the domains separately?

I appreciate your help!

Unfortunately I don’t know how to use FEniCS at all, and the documentation of the XDMFFile function doesn’t indicate that there are other options for saving the data.

Thank you very much for your efforts, Cory.