<div dir="ltr"><div><div><div><div>Hi,<br><br></div>This appears to be a bug in VTK. I have a potential fix at <a href="https://gitlab.kitware.com/acbauer/vtk/blob/parallelmultiblockdatawriter_write_block_names/IO/ParallelXML/vtkXMLPMultiBlockDataWriter.cxx">https://gitlab.kitware.com/acbauer/vtk/blob/parallelmultiblockdatawriter_write_block_names/IO/ParallelXML/vtkXMLPMultiBlockDataWriter.cxx</a>. You can track the fix at <a href="https://gitlab.kitware.com/vtk/vtk/merge_requests/471">https://gitlab.kitware.com/vtk/vtk/merge_requests/471</a>.<br><br></div>Thanks for reporting this.<br><br></div>Cheers,<br></div>Andy<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Aug 3, 2015 at 4:48 AM, Deij-van Rijswijk, Menno <span dir="ltr"><<a href="mailto:M.Deij@marin.nl" target="_blank">M.Deij@marin.nl</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
I’m trying to set up a co-processing pipeline by supplying it with a multi-block dataset, of which the individual unstructured grids have names.<br>
<br>
TL;DR: the block names are not written to XML files when using a Python co-processing pipeline.<br>
<br>
<br>
In detail:<br>
The block names are supplied like so<br>
<br>
///<br>
vtkInformation* md =<br>
multiBlockGrid->GetMetaData(static_cast<unsigned int>(0));<br>
if (md)<br>
{<br>
md->Set(vtkCompositeDataSet::NAME(), "Interior");<br>
}<br>
///<br>
<br>
The grid is added as a producer with the name "grid". Then, in the Python pipeline, I simply write the full grid using the following code:<br>
<br>
///<br>
grid = coprocessor.CreateProducer( datadescription, "grid" )<br>
ParallelMultiBlockDataSetWriter1 = coprocessor.CreateWriter( XMLMultiBlockDataWriter, "fullgrid_%t.vtm", 100 )<br>
///<br>
<br>
This writes the fullgrid_0.vtm file, directory and each block in a separate vtu file. All is good, except that the block names that were set are not written in the file in the "name" attribute.<br>
<br>
I have tried to write an XML file directly using XMLMultiBlockDataWriter, but that did not work due to the implementation of a mapped data array which has no implementation for NewIterator(). Weird - how does the Python pipeline write the file? I don't know, but it works.<br>
<br>
To still check the names having been set, I emulate the first few steps of the XMLMultiBlockDataWriter, to see if the block names come through like so:<br>
<br>
///<br>
vtkSmartPointer<vtkDataObjectTreeIterator> iter;<br>
iter.TakeReference(<br>
vtkDataObjectTree::SafeDownCast(multiBlockGrid)->NewTreeIterator());<br>
iter->VisitOnlyLeavesOff();<br>
iter->TraverseSubTreeOff();<br>
iter->SkipEmptyNodesOff();<br>
<br>
int index = 0;<br>
int RetVal = 0;<br>
for (iter->InitTraversal(); !iter->IsDoneWithTraversal();<br>
iter->GoToNextItem(), index++)<br>
{<br>
vtkDataObject* curDO = iter->GetCurrentDataObject();<br>
const char *name = NULL;<br>
if (iter->HasCurrentMetaData())<br>
{<br>
name = iter->GetCurrentMetaData()->Get(vtkCompositeDataSet::NAME());<br>
cout << "Name found by pseudo-write code: " << (name ? name : "NULL") << endl;<br>
}<br>
else<br>
{<br>
cout << "No metadata found on iterator" << endl;<br>
}<br>
}<br>
///<br>
<br>
And this clearly shows that the names are found as they are written to stdout.<br>
<br>
So, the question is: how can I get the Python co-processing pipeline to write the block names?<br>
<br>
Thanks and best wishes,<br>
<br>
<br>
Menno<br>
<br>
<br>
dr. ir. Menno A. Deij-van Rijswijk<br>
Researcher / Software Engineer<br>
Maritime Simulation & Software Group<br>
E mailto:<a href="mailto:M.Deij@marin.nl">M.Deij@marin.nl</a><br>
T <a href="tel:%2B31%20317%2049%2035%2006" value="+31317493506">+31 317 49 35 06</a><br>
<br>
<br>
MARIN<br>
2, Haagsteeg, P.O. Box 28, 6700 AA Wageningen, The Netherlands<br>
T <a href="tel:%2B31%20317%2049%2039%2011" value="+31317493911">+31 317 49 39 11</a>, F <a href="tel:%2B31%20317%2049%2032%2045" value="+31317493245">+31 317 49 32 45</a>, I <a href="http://www.marin.nl" rel="noreferrer" target="_blank">www.marin.nl</a><br>
<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the ParaView Wiki at: <a href="http://paraview.org/Wiki/ParaView" rel="noreferrer" target="_blank">http://paraview.org/Wiki/ParaView</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=ParaView" rel="noreferrer" target="_blank">http://markmail.org/search/?q=ParaView</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/paraview" rel="noreferrer" target="_blank">http://public.kitware.com/mailman/listinfo/paraview</a><br>
</blockquote></div><br></div>