<div dir="ltr"><div><div>not clear yet why that would go wrong. What does stack trace say?<br></div><br>Also, before calling Write(), call m_mds->PrintSelf() to verify that the multiblock has what you expect in it.<br></div><br>Could also debug by trying one of VTK's other writers (perhaps vtkXMLMultiBlockDataWriter for example) and see if that also fails.<br><br></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature">David E DeMarle<br>Kitware, Inc.<br>R&D Engineer<br>21 Corporate Drive<br>Clifton Park, NY 12065-8662<br>Phone: 518-881-4909</div></div>
<br><div class="gmail_quote">On Thu, Dec 15, 2016 at 3:10 PM, Patricio Palma C. <span dir="ltr"><<a href="mailto:patriciop@gmail.com" target="_blank">patriciop@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">Hi Dave</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">I've modified the classes to use a multiblock dataset, however it' seems there is something wrong with the writer since it crashes when Write() method is called.</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">This is a part of the code:</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">class X {</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">// this are the member definition</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">vtkSmartPointer<vtkXdmfWriter> m_writer;<br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small"><div class="gmail_default">vtkSmartPointer<<wbr>vtkMultiBlockDataSet> m_mds;</div><div class="gmail_default">int m_index;</div><div class="gmail_default">.</div><div class="gmail_default"><br></div><div class="gmail_default">X::X() : m_writer(vtkSmartPointer<<wbr>vtkXdmfWriter>::New()),</div><div class="gmail_default">M_mds(vtkSmartPointer<<wbr>vtkMultiBlockDataSet>::New()),</div><div class="gmail_default">m_index(0) { }</div><div class="gmail_default"> </div><div class="gmail_default"><br></div><div class="gmail_default">void X::addData(vtkDataSet* data)</div><div class="gmail_default">{</div></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small"> m_mds->SetBlock(m_index++, data);<br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">}</div><div class="gmail_default"><font face="arial, helvetica, sans-serif"><br></font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif">void </font><span style="font-family:arial,helvetica,sans-serif">X::</span><span style="font-family:arial,helvetica,sans-serif">finishAndWrite()</span></div><div class="gmail_default"><font face="arial, helvetica, sans-serif">{</font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif"> m_writer->SetFileName("<wbr>outputfile.xfm");</font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif"><div class="gmail_default"> m_writer->SetInputData(m_mds);</div><div class="gmail_default"> m_writer->Write(); // the application crashes here</div><div class="gmail_default">}</div></font></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">};</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">I pass each dataset with addData() and at the end I call finishAndWrite(). I'm not sure what I am doing wrong.</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">Thanks</div></div><div class="gmail_extra"><div><div class="h5"><br><div class="gmail_quote">On Thu, Dec 15, 2016 at 8:25 AM, David E DeMarle <span dir="ltr"><<a href="mailto:dave.demarle@kitware.com" target="_blank">dave.demarle@kitware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto">Yes. Gather them together into a multblock first and then write that.</div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="m_5847108685346766913h5">On Dec 15, 2016 2:11 AM, "Patricio Palma C." <<a href="mailto:patriciop@gmail.com" target="_blank">patriciop@gmail.com</a>> wrote:<br type="attribution"></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="m_5847108685346766913h5"><div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">Hi experts</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small"><br></div><div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">I would like to export a set of vtkUnstructuredGrids and vtkPolyDatas to a file in XDMF format by using vtkXdmfWriter. For the moment I've managed to generate a XDMF output for each vtkUnstructuredGrids and vtkPolydata object, which is a a bit cumbersome (a lot of files :) ).</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">My expectation is to get only one XDMF file with the description of the each dataset and one .H5 file with the data (points, cells, data attributes) of the datasets.</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">Is it possible to do that with vtkXdfmWriter? <br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small"><br></div></div><div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small"></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">Thanks</div></div>-- <br><div class="m_5847108685346766913m_733762094363389249m_1177782800724535427gmail_signature"><div dir="ltr"><font face="arial, helvetica, sans-serif"><span style="font-size:16.3636px">Patricio Palma Contreras</span></font></div></div>
</div>
<br></div></div>______________________________<wbr>_________________<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/opensou<wbr>rce/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" rel="noreferrer" target="_blank">http://www.vtk.org/Wiki/VTK_FA<wbr>Q</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=<wbr>vtkusers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/vtkusers" rel="noreferrer" target="_blank">http://public.kitware.com/mail<wbr>man/listinfo/vtkusers</a><br>
<br></blockquote></div></div>
</blockquote></div><br><br clear="all"><div><br></div></div></div><span class="HOEnZb"><font color="#888888">-- <br><div class="m_5847108685346766913gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><font face="arial, helvetica, sans-serif"><span style="font-size:16.3636360168457px">Patricio Palma Contreras</span></font></div></div>
</font></span></div>
</blockquote></div><br></div>