<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 14 (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;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 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;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
{mso-style-priority:99;
mso-style-link:"Balloon Text Char";
margin:0cm;
margin-bottom:.0001pt;
font-size:8.0pt;
font-family:"Tahoma","sans-serif";}
span.EmailStyle17
{mso-style-type:personal;
font-family:"Calibri","sans-serif";
color:#1F497D;}
span.EmailStyle18
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
span.BalloonTextChar
{mso-style-name:"Balloon Text Char";
mso-style-priority:99;
mso-style-link:"Balloon Text";
font-family:"Tahoma","sans-serif";}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 70.85pt 70.85pt;}
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-GB" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Mirek<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">I’m not sure I followed your explanation, but in case you’re doing more work than you need to...<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">It is possible to compute interpolation weights and reuse them<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">here I have computed weights for an interpolation (in the weights array)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><a href="https://github.com/biddisco/pv-meshless/blob/master/vtkSPHProbeFilter.cxx#L944">https://github.com/biddisco/pv-meshless/blob/master/vtkSPHProbeFilter.cxx#L944</a><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">and then pass them to the attribute arrays for computing the new values for each field at the point Id.<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">(I use this on very large datasets, no problem)<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">JB<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>
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> vtk-developers [mailto:vtk-developers-bounces@vtk.org]
<b>On Behalf Of </b>Dr. Miroslav Sejna<br>
<b>Sent:</b> 03 June 2015 09:46<br>
<b>To:</b> Will Schroeder<br>
<b>Cc:</b> vtk-developers<br>
<b>Subject:</b> Re: [vtk-developers] Optimization of vtkClipDataSet and vtkProbeFilter for large data?<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Thank you, Will. I'll definitely be interested in parallelization of my code, which will be done in a next step.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Yesterday I fortunately found a simple solution for my problem. It is based on a custom additional array in PointData and overriding its virtual
method "InterpolateTuple". This is the place where I can get all interpolation factors and save them for later re-use. The rest was just a routine programming. Now I'm able to display scalars and vectors (defined at nodes of the original FE-mesh) on modified
VTK meshes (clipping/slicing/...) without recalculating these filters. It works exactly as I wanted. VTK is a great library - thanks again.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Mirek <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span lang="CS" style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span lang="CS" style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> Will Schroeder [<a href="mailto:will.schroeder@kitware.com">mailto:will.schroeder@kitware.com</a>]
<br>
<b>Sent:</b> Tuesday, June 02, 2015 3:59 PM<br>
<b>To:</b> Dr. Miroslav Sejna<br>
<b>Cc:</b> vtk-developers<br>
<b>Subject:</b> Re: [vtk-developers] Optimization of vtkClipDataSet and vtkProbeFilter for large data?<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<div>
<div>
<p class="MsoNormal"><span lang="EN-US">If I understand you correctly, it seems that your solution is to save in memory the interpolation factors so that you can rapidly clip new attribute data. Here's a probably crazy alternative suggestion that may have merit
in the long run.<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US">You could take advantage of (emerging) parallel hardware and recalculate the interpolation factors anyway; i.e., do extra work but with lots of processors it may be simpler and faster. There are currently several folks
working on these sorts of algorithms (including clipping) but the results will not be available until later this year. If you can afford to be patient, or want to to try your hand at writing some parallel algorithms, I'm sure we can point you in the right
direction.<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US">W<o:p></o:p></span></p>
</div>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal"><span lang="EN-US">On Mon, Jun 1, 2015 at 4:34 PM, Mirek <<a href="mailto:m.sejna@pc-progress.com" target="_blank">m.sejna@pc-progress.com</a>> wrote:<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span lang="EN-US">Dear VTK developers,<br>
<br>
Filters like vtkClipDataSet and vtkProbeFilter, interpolating values of<br>
vtkDataSetAttributes, work perfectly for relatively small data, i.e. if the<br>
clipping is fast and you can have all vtkDataSetAttributes in memory.<br>
However, it looks like there is no option to optimize these filters for<br>
large data. In my case (see details (*) below), data of each quantity is<br>
loaded "on demand" from the disk. The problem is that vtkClipDataSet cannot<br>
interpolate new vtkDataSetAttributes into the existing (clipped)<br>
unstructured grid without recalculating everything, which is unnecessary and<br>
slow. In my old program, all "interpolated points" had information how to<br>
recalculate values of a new quantity (now vtkPointData scalars), which<br>
actually is a simple and fast operation. In case of a tetrahedral mesh, you<br>
just need to have IDs of 4 original mesh nodes and their weights for the<br>
linear interpolation.<br>
<br>
I have spent several days by debugging VTK and looking for a standard<br>
solution. Unfortunately, I have not found any way how to get and save the<br>
interpolation factors so that I could reuse them. The interpolation of<br>
vtkDataSetAttributes is implemented in vtkTetra::Clip and most of important<br>
functions (vtkTetra::Clip, vtkDataSetAttributes::InterpolateEdge, ...) are<br>
not virtual => it will not be easy to modify the filter. Before investing<br>
time into the development of a new filter, I'd like to ask: Did I miss<br>
something? Is there an existing solution for this problem?<br>
<br>
Thank you<br>
Mirek<br>
<br>
(*) In my case the data can be really large: unstructured FE-meshes with up<br>
to 50 mil. nodes and time-varying results (10-200 different quantities<br>
defined by values at mesh nodes, while there can be 100 - 10000 time<br>
layers).<br>
<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://vtk.1045678.n5.nabble.com/Optimization-of-vtkClipDataSet-and-vtkProbeFilter-for-large-data-tp5732100.html" target="_blank">
http://vtk.1045678.n5.nabble.com/Optimization-of-vtkClipDataSet-and-vtkProbeFilter-for-large-data-tp5732100.html</a><br>
Sent from the VTK - Dev mailing list archive at Nabble.com.<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>
Search the list archives at: <a href="http://markmail.org/search/?q=vtk-developers" target="_blank">
http://markmail.org/search/?q=vtk-developers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/vtk-developers" target="_blank">http://public.kitware.com/mailman/listinfo/vtk-developers</a><o:p></o:p></span></p>
</div>
<p class="MsoNormal"><span lang="EN-US"><br>
<br clear="all">
<o:p></o:p></span></p>
<div>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
</div>
<p class="MsoNormal"><span lang="EN-US">-- <o:p></o:p></span></p>
<div>
<p class="MsoNormal"><span lang="EN-US">William J. Schroeder, PhD<br>
Kitware, Inc.<br>
28 Corporate Drive<br>
Clifton Park, NY 12065<br>
<a href="mailto:will.schroeder@kitware.com" target="_blank">will.schroeder@kitware.com</a><br>
<a href="http://www.kitware.com" target="_blank">http://www.kitware.com</a><br>
(518) 881-4902<o:p></o:p></span></p>
</div>
</div>
</div>
</body>
</html>