<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 15 (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:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
@font-face
{font-family:Monaco;
panose-1:0 0 0 0 0 0 0 0 0 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-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;}
pre
{mso-style-priority:99;
mso-style-link:"HTML Preformatted Char";
margin:0in;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New";}
span.HTMLPreformattedChar
{mso-style-name:"HTML Preformatted Char";
mso-style-priority:99;
mso-style-link:"HTML Preformatted";
font-family:Consolas;}
p.msonormal0, li.msonormal0, div.msonormal0
{mso-style-name:msonormal;
mso-margin-top-alt:auto;
margin-right:0in;
mso-margin-bottom-alt:auto;
margin-left:0in;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
span.EmailStyle20
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;
font-family:"Calibri",sans-serif;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
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-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal">David,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Thanks very much for that – that works and works well. My filter now runs ~15 times faster than it did before I incorporated this.
<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I’m always impressed by the helpfulness of this board.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Dennis<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><b>From:</b> David E DeMarle [mailto:dave.demarle@kitware.com]
<br>
<b>Sent:</b> Monday, April 30, 2018 3:50 PM<br>
<b>To:</b> Dennis Conklin <dennis_conklin@goodyear.com><br>
<b>Cc:</b> Paraview (paraview@paraview.org) <paraview@paraview.org><br>
<b>Subject:</b> Re: [EXT] Re: [Paraview] vtkPointDataToCellData but only for selected PointData<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">This does what you are looking for:<o:p></o:p></p>
<div>
<pre style="margin-top:9.0pt"><b><span style="font-family:"Monaco",serif;color:green">import</span></b><span style="font-family:"Monaco",serif"> <b><span style="color:blue">vtk</span></b></span><o:p></o:p></pre>
<pre><b><span style="font-family:"Monaco",serif;color:blue"><o:p> </o:p></span></b></pre>
<pre><i><span style="font-family:"Monaco",serif;color:#408080"># copy entire structure across</span></i><o:p></o:p></pre>
<pre><span style="font-family:"Monaco",serif;color:green">self</span><span style="font-family:"Monaco",serif;color:#666666">.</span><span style="font-family:"Monaco",serif">GetOutputDataObject(<span style="color:#666666">0</span>)<span style="color:#666666">.</span>ShallowCopy(<span style="color:green">self</span><span style="color:#666666">.</span>GetInputDataObject(<span style="color:#666666">0</span>,<span style="color:#666666">0</span>))</span><o:p></o:p></pre>
<pre><span style="font-family:"Monaco",serif"><o:p> </o:p></span></pre>
<pre><i><span style="font-family:"Monaco",serif;color:#408080"># use pass arrays to extract a copy with one array of interest</span></i><o:p></o:p></pre>
<pre><span style="font-family:"Monaco",serif">myArrays<span style="color:#666666">=</span>vtk<span style="color:#666666">.</span>vtkPassArrays()</span><o:p></o:p></pre>
<pre><span style="font-family:"Monaco",serif">myArrays<span style="color:#666666">.</span>SetInputDataObject(<span style="color:green">self</span><span style="color:#666666">.</span>GetInputDataObject(<span style="color:#666666">0</span>,<span style="color:#666666">0</span>))</span><o:p></o:p></pre>
<pre><span style="font-family:"Monaco",serif">myArrays<span style="color:#666666">.</span>ClearArrays()</span><o:p></o:p></pre>
<pre><span style="font-family:"Monaco",serif">myArrays<span style="color:#666666">.</span>AddPointDataArray(<span style="color:#BA2121">'DISPL'</span>)</span><o:p></o:p></pre>
<pre><span style="font-family:"Monaco",serif">myArrays<span style="color:#666666">.</span>AddCellDataArray(<span style="color:#BA2121">''</span>)</span><o:p></o:p></pre>
<pre><span style="font-family:"Monaco",serif">myArrays<span style="color:#666666">.</span>AddFieldDataArray(<span style="color:#BA2121">''</span>)</span><o:p></o:p></pre>
<pre><span style="font-family:"Monaco",serif"><o:p> </o:p></span></pre>
<pre><i><span style="font-family:"Monaco",serif;color:#408080"># use point2cell to operate on the one array we care about</span></i><o:p></o:p></pre>
<pre><span style="font-family:"Monaco",serif">p2c <span style="color:#666666">=</span> vtk<span style="color:#666666">.</span>vtkPointDataToCellData()</span><o:p></o:p></pre>
<pre><span style="font-family:"Monaco",serif">p2c<span style="color:#666666">.</span>SetInputConnection(myArrays<span style="color:#666666">.</span>GetOutputPort())</span><o:p></o:p></pre>
<pre><span style="font-family:"Monaco",serif">p2c<span style="color:#666666">.</span>Update()</span><o:p></o:p></pre>
<pre><span style="font-family:"Monaco",serif"><o:p> </o:p></span></pre>
<pre><i><span style="font-family:"Monaco",serif;color:#408080"># iterate over blocks and copy in the result</span></i><o:p></o:p></pre>
<pre><span style="font-family:"Monaco",serif;color:green">iter</span><span style="font-family:"Monaco",serif;color:#666666">=</span><span style="font-family:"Monaco",serif">dsa<span style="color:#666666">.</span>MultiCompositeDataIterator([p2c<span style="color:#666666">.</span>GetOutputDataObject(<span style="color:#666666">0</span>), output])</span><o:p></o:p></pre>
<pre><b><span style="font-family:"Monaco",serif;color:green">for</span></b><span style="font-family:"Monaco",serif"> in_block, output_block <b><span style="color:#AA22FF">in</span></b> <span style="color:green">iter</span>:</span><o:p></o:p></pre>
<pre><span style="font-family:"Monaco",serif"> output_block<span style="color:#666666">.</span>GetCellData()<span style="color:#666666">.</span>AddArray(in_block<span style="color:#666666">.</span>VTKObject<span style="color:#666666">.</span>GetCellData()<span style="color:#666666">.</span>GetArray(<span style="color:#BA2121">'DISPL'</span>))</span><o:p></o:p></pre>
<pre style="margin-bottom:9.0pt"><span style="font-family:"Monaco",serif"><o:p> </o:p></span></pre>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
<div>
<p class="MsoNormal"><br clear="all">
<o:p></o:p></p>
<div>
<div>
<div>
<div>
<div>
<div>
<p class="MsoNormal">David E DeMarle<br>
Kitware, Inc.<br>
Principal Engineer<br>
21 Corporate Drive<br>
Clifton Park, NY 12065-8662<br>
Phone: 518-881-4909<o:p></o:p></p>
</div>
</div>
</div>
</div>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">On Mon, Apr 30, 2018 at 8:52 AM, Dennis Conklin <<a href="mailto:dennis_conklin@goodyear.com" target="_blank">dennis_conklin@goodyear.com</a>> wrote:<o:p></o:p></p>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0in;margin-bottom:5.0pt">
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">David,<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">I have not called filters within the Programmable Filter before and I am not getting things hooked up correctly. My attempt is attached. Clearly, I do not understand how to
hook the output of 1 filter to the input of the next because I’m getting to the end and getting something with no blocks and no cells.
<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Any hints?<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Dennis<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><b>From:</b> David E DeMarle [mailto:<a href="mailto:dave.demarle@kitware.com" target="_blank">dave.demarle@kitware.com</a>]
<br>
<b>Sent:</b> Tuesday, April 10, 2018 10:14 AM<br>
<b>To:</b> Dennis Conklin <<a href="mailto:dennis_conklin@goodyear.com" target="_blank">dennis_conklin@goodyear.com</a>><br>
<b>Cc:</b> Paraview (<a href="mailto:paraview@paraview.org" target="_blank">paraview@paraview.org</a>) <<a href="mailto:paraview@paraview.org" target="_blank">paraview@paraview.org</a>><br>
<b>Subject:</b> [EXT] Re: [Paraview] vtkPointDataToCellData but only for selected PointData<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<table class="MsoNormalTable" border="1" cellspacing="1" cellpadding="0" style="background:lightgrey;border:outset gray 1.0pt">
<tbody>
<tr>
<td style="padding:.6pt .6pt .6pt .6pt">
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <strong><span style="font-family:"Calibri",sans-serif;color:red">WARNING - External email; exercise caution.</span></strong><o:p></o:p></p>
</td>
</tr>
</tbody>
</table>
<div>
<div>
<p> <o:p></o:p></p>
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">The pass arrays filter comes to mind.
<o:p></o:p></p>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">If creating withing your python programmable filter it will be called vtk.vtkPassArrays then follow that with a vtk.vtkPointDataToCellData.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
</div>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
</div>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><br clear="all">
<o:p></o:p></p>
<div>
<div>
<div>
<div>
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">David E DeMarle<br>
Kitware, Inc.<br>
Principal Engineer<br>
21 Corporate Drive<br>
Clifton Park, NY 12065-8662<br>
Phone: 518-881-4909<o:p></o:p></p>
</div>
</div>
</div>
</div>
</div>
</div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">On Tue, Apr 10, 2018 at 10:07 AM, Dennis Conklin <<a href="mailto:dennis_conklin@goodyear.com" target="_blank">dennis_conklin@goodyear.com</a>> wrote:<o:p></o:p></p>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0in;margin-bottom:5.0pt">
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">All,<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Well, this list solved my problem so easily (and made me feel slightly less than the sharpest pencil in the box) yesterday, so I thought I’d try again.<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">I am doing some Python calcs inside a programmable filter and some of the results I want to average from the Points onto the Cells. But, I don’t want all my PointData moved over
to CellData – I want to transfer some of them over within my Filter.<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Right now I’m looping thru all the elements and finding all their nodes, then averaging them and assigning to the cells. It is dog slow and is choking off the usefulness of this
filter.<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Is there anything like vtkPointDataToCellData that lets me specify which quantities to convert – could I do something tricky like store original list of PointData, make up a new
list, then run PointDataToCellData, then restore the list of PointData ??<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">I realize this may have all sorts of unexpected side effects, so I’m just asking!<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Thanks again, this group is great!<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="color:#888888"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="color:#888888">Dennis</span><o:p></o:p></p>
</div>
</div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;margin-bottom:12.0pt"><br>
_______________________________________________<br>
Powered by <a href="https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.kitware.com&data=01%7C01%7Cdennis_conklin%40goodyear.com%7Ccdd327b7b83443c9224908d59eed5011%7C939e896692854a9a9f040887efe8aae0%7C0&sdata=bFpbI9%2F4eHwIrhf5Sd9f2ynzY%2FvWHiDIlONgpO13J0A%3D&reserved=0" target="_blank">
www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.kitware.com%2Fopensource%2Fopensource.html&data=01%7C01%7Cdennis_conklin%40goodyear.com%7Ccdd327b7b83443c9224908d59eed5011%7C939e896692854a9a9f040887efe8aae0%7C0&sdata=mMExlGeMQKwAob7IUdPyH60WLz420BhmCRMs%2Fp8aLf4%3D&reserved=0" 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="https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fparaview.org%2FWiki%2FParaView&data=01%7C01%7Cdennis_conklin%40goodyear.com%7Ccdd327b7b83443c9224908d59eed5011%7C939e896692854a9a9f040887efe8aae0%7C0&sdata=Myi6SWCBnXGSlGEpOScpW0tc83nT6ue%2FjmtzC9G%2FafE%3D&reserved=0" target="_blank">
http://paraview.org/Wiki/ParaView</a><br>
<br>
Search the list archives at: <a href="https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmarkmail.org%2Fsearch%2F%3Fq%3DParaView&data=01%7C01%7Cdennis_conklin%40goodyear.com%7Ccdd327b7b83443c9224908d59eed5011%7C939e896692854a9a9f040887efe8aae0%7C0&sdata=EjvocgHSmoROe1cbBbTsWfGgqv8v1dZM10sKupDOaQQ%3D&reserved=0" target="_blank">
http://markmail.org/search/?q=ParaView</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpublic.kitware.com%2Fmailman%2Flistinfo%2Fparaview&data=01%7C01%7Cdennis_conklin%40goodyear.com%7Ccdd327b7b83443c9224908d59eed5011%7C939e896692854a9a9f040887efe8aae0%7C0&sdata=tfp1j3M04VCMkOFcmkMdKNLgIKDJUYvgEupl18nNQeE%3D&reserved=0" target="_blank">https://public.kitware.com/mailman/listinfo/paraview</a><o:p></o:p></p>
</blockquote>
</div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</body>
</html>