<div dir="ltr">Thanks David for the reply.<br><br>> <span style="font-size:13.1999998092651px;line-height:19.7999992370605px">Probably a bug that it reports 0 when you have a single atomic ("uniform" in xdmf terms of "vtkDataSet" in vtk terms) grid.</span><br><br>I'll file a report for this.<div><br></div><div>Cheers,</div><div>Nico</div></div><br><div class="gmail_quote"><div dir="ltr">On Fri, Jun 19, 2015 at 3:33 AM David E DeMarle <<a href="mailto:dave.demarle@kitware.com">dave.demarle@kitware.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Nico,<div><br></div><div>That is for multi-block xdmf files. If you happen to have a file with several blocks in it it will return the correct number (try IronProtein from the paraview regression test data). Probably a bug that it reports 0 when you have a single atomic ("uniform" in xdmf terms of "vtkDataSet" in vtk terms) grid.</div><div><br></div><div>I don't happen to have a small example of its use in VTK. In ParaView it is used in the Block selection part of the object inspector when you open the xdmf file.</div><div><br></div><div>hth</div><div><br></div><div><br></div><div><br></div><div><br></div></div><div class="gmail_extra"><br clear="all"><div><div>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"></div></div><div class="gmail_extra"><div class="gmail_quote">On Tue, Jun 16, 2015 at 9:04 AM, Nico Schlömer <span dir="ltr"><<a href="mailto:nico.schloemer@gmail.com" target="_blank">nico.schloemer@gmail.com</a>></span> wrote:<br></div></div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Apparently,<br>
```<br>
xreader->GetNumberOfGrids()<br>
```<br>
doesn't say much. One can simply<br>
```<br>
vtkDataObject *rOutput = xreader->GetOutputDataObject(0);<br>
TEUCHOS_ASSERT(rOutput != nullptr);<br>
vtkUnstructuredGrid * m = dynamic_cast<vtkUnstructuredGrid*>(rOutput);<br>
TEUCHOS_ASSERT(m != nullptr);<br>
```<br>
which gives you a pointer to the vtkUnstructuredGrid, if there is one.<br>
<br>
Cheers,<br>
Nico<br>
</blockquote></div></div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><br>
On Tue, Jun 16, 2015 at 1:46 PM, Nico Schlömer <<a href="mailto:nico.schloemer@gmail.com" target="_blank">nico.schloemer@gmail.com</a>> wrote:<br>
> Hi everyone,<br>
><br>
> I have an XDMF file which I'm reading with vtk::vtkXdmf3Reader,<br>
> ```<br>
> vtkXdmf3Reader *xreader = vtkXdmf3Reader::New();<br>
> xreader->SetFileName("data/brick-w-hole.xmf");<br>
> xreader->Update();<br>
> ```<br>
> and I would like to get the corresponding vtk::UnstructuredGrid from<br>
> this. For some reason, however,<br>
> ```<br>
> xreader->GetNumberOfGrids()<br>
> ```<br>
> returns 0. Also, I wouldn't know how to retrieve the grid if there was one.<br>
><br>
> Is there example code for this around?<br>
><br>
> Cheers,<br>
> Nico<br></div></div></blockquote></div></div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div>
_______________________________________________<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 VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" rel="noreferrer" 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" rel="noreferrer" 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" rel="noreferrer" target="_blank">http://public.kitware.com/mailman/listinfo/vtkusers</a><br>
</div></div></blockquote></div><br></div>
</blockquote></div>