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

how to get subdomains of different materials from an xml data

–1 vote

I've made a 3D grafic with Gmsh and got a msh-data, then convert it with "dolfin-convert" to the FEniCS xml data. I don't know how to get the different subdomains from the xml data and plot them seperately, because I have four three different materials with 4 physical volumes. I use dolfin1.1 with python. I'll be very appreciated to get your help!

asked Sep 26, 2013 by kickccat FEniCS Novice (200 points)

This is not well formulated question. FEniCS is not for plotting domains - what do you want to do?

Hi,
I want to see in the FEniCS whether the whole 3D form is correct, but I just got the 2D visualization and my form is a big cube box with inside a hollow cylinder, that says I just can see the cube box, but the hollow cylinder inside will not be plotted. My code is as follows:
mesh = Mesh("model.xml")
subdomains = MeshFunction("size_t", mesh,"model_physical_region.xml")
plot(mesh, interactive=True)
Thank you!

Post code this way.

1 Answer

0 votes

Try

plot(subdomains)

or

File('subdomains.pvd') << subdomains

and plot in ParaView.

answered Sep 27, 2013 by Jan Blechta FEniCS Expert (51,420 points)

Hi Jan,
I've tried the both and neither of them worked, the hollow cylinder inside will still not be plotted, just only the cube box.
And I'm sure that in the Gmsh the 3D Form would be initialized and meshed. Thank you for your help!

That could be just the problem that you plot the solid outline. If you use newer DOLFIN, press H or h in interactive plot window to get help and tweak plot settings. In ParaView there is also plenty of options how to plot interior of 3D object but that's just a ParaView question. For example you can apply some filter picking for cells, facets or vertices matching some value(s) of your mesh function.

Hi Jan,
I think that could be Viper problem because more than 400.000 cells I've tried many times and also let my tutor in the Server of our uni run the plot instruction, I also defined to plot the whole 3D form not only the solid outline. It's also failed, but it's not so bad, when I tried to press "c or v" to show the indices of cells or vertices and the inner indices of my 3D graphic showed.
Thanks your help!

Viper? Do you use FEniCS 1.0? Try 1.2.0. It has new plotting facility.

I tried the new version 1.2.0, but got the same....

...