Documentation for DOLFIN XML format for meshes.
4 months ago by
In my code, i need to make use of a 3D mesh which has refinement in an irregular shaped object in the center of a box mesh. That mesh was generated by tetgen and I have various formats available for it through tetgen. I have so far used Medit's MESH format (written out by tetgen) and have used dolfin-convert to convert it to the XML format. I require marking the tetrahedrons belonging to that refinement area in my FEniCS code, so I can attach a different material property to that region. If I open up the MESH file (which is plain ascii) and peruse it, I see that the tetrahedrons are "marked" as belonging to a 1 or a 2 category via the use of a fifth element (attribute). Have a look at the following excerpt from my MESH file.
# Set of Tetrahedra
8667 254 12854 13978 2
4539 280 9490 9514 1
3845 6321 12243 13480 1
12028 13297 14389 14769 2
All the above are 5-tuples. The fifth element is called an attribute in tetgen jargon, and is primarily meant to provide access to special regions. I want to use this facility inside my FEniCS code, but don't quite know how to manage that. For example, check the following excerpt from dolfin-convert.py (from one of its sections relevant in this context).
Although the fifth element is stored in tmp, it is really not made use of, and gets discarded, as only n0 thru n3 are written to the XML file.
elif num_dims == 3: (n0, n1, n2, n3, tmp) = line.split() n0 = int(n0) - 1 n1 = int(n1) - 1 n2 = int(n2) - 1 n3 = int(n3) - 1 write_cell_tetrahedron(ofile, num_cells_read, n0, n1, n2, n3) num_cells_read +=1
I'd like to know how to store this fifth element in the XML file so that it could be used to mark that inner body for setting up a different material property.
Thanks a lot,
Community: FEniCS Project
4 months ago by
For this reason I editied the original dolfin-convert script to convert with domain markers. Umfortunately, as far as I know one cannot attach files here so I will send it to you per mail. If anyone else is interested, send me a message.
Please login to add an answer/comment or follow this question.