<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>Hi Berk<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>Thank you for your very helpful answer. Of the little I can find on the vtm file it would seem to be indeed the natural solution. Would there happen to be some documentation of the vtm format? <o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>In parallel computation we are using the .pvtu format which wraps the individual .vtu files to a single entity. Would this .pvtu file be in some way compatible with the .vtm file? Or should we make the vtm format also include the parallel pieces? <o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>BR, Peter<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><b><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'>From:</span></b><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'> Berk Geveci [mailto:berk.geveci@kitware.com] <br><b>Sent:</b> 2. joulukuuta 2015 15:57<br><b>To:</b> Peter Råback<br><b>Cc:</b> VTK Users<br><b>Subject:</b> Re: [vtkusers] Naming of different pieces in VTU format<o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal>Hmmm. This is not supported by the piece support in the vtu format. That is designed so that multiple partitions can be written to the same file. At read time, the reader actually appends them to a single unstructured grid.<o:p></o:p></p><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>There are three ways of achieving what you'd like:<o:p></o:p></p></div><div><p class=MsoNormal>* Use the vtm format<o:p></o:p></p></div><div><p class=MsoNormal>* Use the Exodus format<o:p></o:p></p></div><div><p class=MsoNormal>* Use Xdmf format<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>The vtm format is the simplest. A simple XML format that points to a vtu file per block. It has the disadvantage that these blocks cannot share point coordinates - each file is stand-alone. If you need that, I highly recommend using the Exodus II format. It is well documented and has a nice API. As long as it supports all the cell types that you need of course. The documentation is here:<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal><a href="http://sourceforge.net/projects/exodusii/files/Documentation/Documentation/">http://sourceforge.net/projects/exodusii/files/Documentation/Documentation/</a><o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Best,<o:p></o:p></p></div><div><p class=MsoNormal>-berk<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div></div><div><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal>On Mon, Nov 30, 2015 at 5:07 PM, Peter Råback <<a href="mailto:peter.raback@csc.fi" target="_blank">peter.raback@csc.fi</a>> wrote:<o:p></o:p></p><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm'><p class=MsoNormal>Hi,<br><br>I'm writing a VTU (unstructured XML format) writer for a finite element<br>software (Elmer) in Fortran. This works otherwise great but I would like<br>to write different parts of the mesh as different pieces, and hopefully<br>also name the pieces. The idea is that the piece could be selected in<br>visualization (with Paraview, ViSit etc.).<br><br>I attach at the end a working example of the current output. The data is<br>appended in binary format (if not saved in ascii).<br><br>Now ideally the Piece field could take a name, e.g.<br><br><?xml version="1.0"?><br><VTKFile type="UnstructuredGrid" version="0.1" byte_order="LittleEndian"><br> <UnstructuredGrid><br> <Piece NumberOfPoints="524" NumberOfCells="150" Name="PartA"><br> ...<br> </Piece><br> <Piece NumberOfPoints="233" NumberOfCells="117" Name="PartB"><br> ...<br> </Piece><br> </UnstructuredGrid><br><AppendedData encoding="raw"><br><br>Am I hoping too much? The documentation didn't mention the Piece having<br>the possibility to name it.<br><br>Our current approach is to use CellData "GeometryIds" which gives a number<br>for each different body and boundary condition. Then one can use the<br>"Threshhold" filter in Paraview to pick data just related to certain<br>entity. However, this is rather cumbersome particularly if the interesting<br>entities do not have indexes following each other.<br><br>Another motivation for saving data piece by piece is that it will be<br>easier to introduce discontinuities in the mesh. Then within each piece<br>the data can be saved as continuous while jumps only appear where the<br>material changes. If one assumes discontinuity over all elements the<br>amount of data quickly explodes as the nodes can be shared by tens of<br>elements.<br><br>Could the pieces strategy work, or is there a better way? Any suggestions<br>are welcome!<br><br>-Peter<br><br><br><br><?xml version="1.0"?><br><VTKFile type="UnstructuredGrid" version="0.1" byte_order="LittleEndian"><br> <UnstructuredGrid><br> <Piece NumberOfPoints="724" NumberOfCells="267"><br> <PointData><br> <DataArray type="Float64" Name="potential" NumberOfComponents="1"<br>format="appended" offset="0"/><br> <DataArray type="Float64" Name="electric field"<br>NumberOfComponents="3" format="appended" offset="5796"/><br> </PointData><br> <CellData><br> <DataArray type="Int32" Name="GeometryIds" format="appended"<br>offset="23176"/><br> </CellData><br> <Points><br> <DataArray type="Float64" NumberOfComponents="3" format="appended"<br>offset="24248"/><br> </Points><br> <Cells><br> <DataArray type="Int32" Name="connectivity" format="appended"<br>offset="41628"/><br> <DataArray type="Int32" Name="offsets" format="appended"<br>offset="55792"/><br> <DataArray type="Int32" Name="types" format="appended"<br>offset="56864"/><br> </Cells><br> </Piece><br> </UnstructuredGrid><br><AppendedData encoding="raw"><br>_______________________________________________<br>Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br><br>Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br><br>Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br><br>Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" target="_blank">http://markmail.org/search/?q=vtkusers</a><br><br>Follow this link to subscribe/unsubscribe:<br><a href="http://public.kitware.com/mailman/listinfo/vtkusers" target="_blank">http://public.kitware.com/mailman/listinfo/vtkusers</a><o:p></o:p></p></blockquote></div><p class=MsoNormal><o:p> </o:p></p></div></div></body></html>