<div dir="ltr">For the clean grid filter, you can just use the `vtkmCleanGrid` filter in VTK, which takes care of the conversions and everything for you.<br><br>If you want to use the vtk-m filters directly with a dataset built using tovtkm::Convert, it is necessary to pass a Policy to the filter so that it is aware of the custom data structures used to adapt VTK into VTK-m. See the Accelerators/Vtkm/vtkmCleanGrid.cxx file in VTK for an example of this:<br><br><p style="margin:0px;white-space:pre-wrap"><font color="#000000">#include "vtkmFilterPolicy.h"
<br></font></p><p style="margin:0px;white-space:pre-wrap"><font color="#000000">vtkmInputFilterPolicy policy;
</font></p><p style="margin:0px;white-space:pre-wrap"><font color="#000000">vtkm::filter::CleanGrid filter;</font></p><p style="margin:0px;white-space:pre-wrap"><font color="#000000">auto result = filter.Execute(in, policy);<br></font></p><p style="margin:0px;white-space:pre-wrap">
HTH,
Allie</p></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jun 27, 2019 at 11:06 AM sunayanag <<a href="mailto:sunayanag@gmail.com">sunayanag@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi All,<br>
<br>
Just started using vtk-m and having some issues with the CleanGrid filter.<br>
Assuming that vtkMesh is an object of type vtkSmartPointer<vtkPolyData>,<br>
here is the piece of code<br>
<br>
vtkm::cont::DataSet mMesh = tovtkm::Convert(vtkMesh,<br>
tovtkm::FieldsFlag::PointsAndCells);<br>
vtkm::filter::CleanGrid cleanGrid;<br>
<br>
try <br>
{<br>
    vtkm::cont::DataSet outMesh = cleanGrid.Execute(mMesh);<br>
}<br>
 catch(std::exception& e)<br>
 {<br>
     std::cerr << e.what();<br>
}<br>
<br>
where the exception thrown is: /Could not find appropriate cast for cell<br>
set./<br>
<br>
could anyone help with what I am getting wrong.<br>
<br>
Thanks<br>
Sunayana<br>
<br>
<br>
<br>
--<br>
Sent from: <a href="http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html" rel="noreferrer" target="_blank">http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html</a><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 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="https://vtk.org/mailman/listinfo/vtkusers" rel="noreferrer" target="_blank">https://vtk.org/mailman/listinfo/vtkusers</a><br>
</blockquote></div>