That&#39;s it. <br>In the Calculator, I would set the formula : Q1/Q4*iHat + Q2/Q4*jHat + Q3/Q4*kHat.<br><br>In the programmable filter, there is some facilities in order to use numpy arrays. But what should be the dimensions of the numpy array if we want to add a vector by doing something like &quot;block.PointData.append(array, &#39;newQ&#39;)&quot; ?<br>

<br><br><div class="gmail_quote">Le 14 septembre 2010 17:15, Berk Geveci <span dir="ltr">&lt;<a href="mailto:berk.geveci@kitware.com">berk.geveci@kitware.com</a>&gt;</span> a écrit :<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

I am not sure that I understand. Are Q1 and Q2 vectors? Are you trying<br>
to divide the component by component?<br>
<br>
2010/9/13 Aurélien Marsan &lt;<a href="mailto:aur.marsan@gmail.com">aur.marsan@gmail.com</a>&gt;:<br>
<div><div></div><div class="h5">&gt; Hello,<br>
&gt;<br>
&gt; In order to calculate a new scalar (here for a multiblockdataset)<br>
&gt;<br>
&gt; pdi = self.GetInput()<br>
&gt;<br>
&gt; pdo = self.GetOutput()<br>
&gt;<br>
&gt; pdo.ShallowCopy(pdi)<br>
&gt;<br>
&gt; for block in output[0]:<br>
&gt;<br>
&gt; if block.GetNumberOfPoints() != 0:<br>
&gt;<br>
&gt; array = block.PointData[&#39;Q1&#39;] / block.PointData[&#39;Q2&#39;]<br>
&gt;<br>
&gt; block.PointData.append(array, &#39;newQ&#39;)<br>
&gt;<br>
&gt; For a new vector, I would like someone to explain a simple way to do that.<br>
&gt; (without many transpose, ravel, etc...)<br>
&gt; Knowing that it does not work with array =<br>
&gt; numpy.array([block.PointData[&#39;Q1&#39;], block.PointData[&#39;Q2&#39;],<br>
&gt; block.PointData[&#39;Q3&#39;]]) / block.PointData[&#39;Q4&#39;]<br>
&gt; because of a problem of dimensions.<br>
&gt;<br>
&gt; Regards,<br>
&gt;<br>
&gt; A.Marsan<br>
&gt;<br>
&gt; 2010/9/10 &lt;<a href="mailto:DParker@chromalloy.com">DParker@chromalloy.com</a>&gt;<br>
&gt;&gt;<br>
&gt;&gt; I have a couple of questions about using the Programmable Filter. I have<br>
&gt;&gt; imported Tecplot dataset with the following data: coordsX, coordsY, coordsZ,<br>
&gt;&gt; Q1, Q2, Q3, Q4, Q5.<br>
&gt;&gt;<br>
&gt;&gt; How would I create a new data array that is Q2^2+Q3^2+Q4^2?<br>
&gt;&gt;<br>
&gt;&gt; How would I create a new vector data array (similar to<br>
&gt;&gt; Q2*iHat+Q3*jHat+Q4*kHat in the Calculator Filter)?<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; From:        David E DeMarle &lt;<a href="mailto:dave.demarle@kitware.com">dave.demarle@kitware.com</a>&gt;<br>
&gt;&gt; To:        <a href="mailto:DParker@chromalloy.com">DParker@chromalloy.com</a><br>
&gt;&gt; Cc:        <a href="mailto:paraview@paraview.org">paraview@paraview.org</a><br>
&gt;&gt; Date:        09/10/2010 01:24 PM<br>
&gt;&gt; Subject:        Re: [Paraview] Calculator Filter -- Gradient<br>
&gt;&gt; Sent by:        <a href="mailto:paraview-bounces@paraview.org">paraview-bounces@paraview.org</a><br>
&gt;&gt; ________________________________<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; On Fri, Sep 10, 2010 at 1:10 PM,  &lt;<a href="mailto:DParker@chromalloy.com">DParker@chromalloy.com</a>&gt; wrote:<br>
&gt;&gt; &gt; I have two somewhat related questions:<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; 1. Is it possible to calculate a gradient vector using the calculator<br>
&gt;&gt; &gt; filter?<br>
&gt;&gt;<br>
&gt;&gt; No. The calculator filter does only element wise (cell by cell or<br>
&gt;&gt; point by point) computations. To compute the gradient you need<br>
&gt;&gt; information from neighboring elements.<br>
&gt;&gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; 2. Is it possible to define a new data array using a Python script<br>
&gt;&gt; &gt; without<br>
&gt;&gt; &gt; the calculator filter? Currently, I am using several Calculator Filters<br>
&gt;&gt; &gt; to<br>
&gt;&gt; &gt; calculate CFD flow variables from the conservative variables. I use a<br>
&gt;&gt; &gt; Python<br>
&gt;&gt; &gt; script to create the Calculator Filters, but I&#39;m wondering if I can<br>
&gt;&gt; &gt; avoid<br>
&gt;&gt; &gt; the Calculator Filter and directly generate new data arrays for<br>
&gt;&gt; &gt; plotting.<br>
&gt;&gt; &gt;<br>
&gt;&gt;<br>
&gt;&gt; Not with a python script (under the python shell) since that runs on<br>
&gt;&gt; the client and can&#39;t really manipulate the data (which lives on the<br>
&gt;&gt; server) directly. However, the python programmable filter runs on the<br>
&gt;&gt; server, and with that you can create new arrays, and access<br>
&gt;&gt; neighboring elements as well.<br>
&gt;&gt; See <a href="http://www.paraview.org/Wiki/Python_Programmable_Filter" target="_blank">http://www.paraview.org/Wiki/Python_Programmable_Filter</a> for examples.<br>
&gt;&gt;<br>
&gt;&gt; &gt; David Parker<br>
&gt;&gt; &gt; _______________________________________________<br>
&gt;&gt; &gt; Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Visit other Kitware open-source projects at<br>
&gt;&gt; &gt; <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Please keep messages on-topic and check the ParaView Wiki at:<br>
&gt;&gt; &gt; <a href="http://paraview.org/Wiki/ParaView" target="_blank">http://paraview.org/Wiki/ParaView</a><br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Follow this link to subscribe/unsubscribe:<br>
&gt;&gt; &gt; <a href="http://www.paraview.org/mailman/listinfo/paraview" target="_blank">http://www.paraview.org/mailman/listinfo/paraview</a><br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
&gt;&gt;<br>
&gt;&gt; Visit other Kitware open-source projects at<br>
&gt;&gt; <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
&gt;&gt;<br>
&gt;&gt; Please keep messages on-topic and check the ParaView Wiki at:<br>
&gt;&gt; <a href="http://paraview.org/Wiki/ParaView" target="_blank">http://paraview.org/Wiki/ParaView</a><br>
&gt;&gt;<br>
&gt;&gt; Follow this link to subscribe/unsubscribe:<br>
&gt;&gt; <a href="http://www.paraview.org/mailman/listinfo/paraview" target="_blank">http://www.paraview.org/mailman/listinfo/paraview</a><br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
&gt;&gt;<br>
&gt;&gt; Visit other Kitware open-source projects at<br>
&gt;&gt; <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
&gt;&gt;<br>
&gt;&gt; Please keep messages on-topic and check the ParaView Wiki at:<br>
&gt;&gt; <a href="http://paraview.org/Wiki/ParaView" target="_blank">http://paraview.org/Wiki/ParaView</a><br>
&gt;&gt;<br>
&gt;&gt; Follow this link to subscribe/unsubscribe:<br>
&gt;&gt; <a href="http://www.paraview.org/mailman/listinfo/paraview" target="_blank">http://www.paraview.org/mailman/listinfo/paraview</a><br>
&gt;&gt;<br>
&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
&gt;<br>
&gt; Visit other Kitware open-source projects at<br>
&gt; <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
&gt;<br>
&gt; Please keep messages on-topic and check the ParaView Wiki at:<br>
&gt; <a href="http://paraview.org/Wiki/ParaView" target="_blank">http://paraview.org/Wiki/ParaView</a><br>
&gt;<br>
&gt; Follow this link to subscribe/unsubscribe:<br>
&gt; <a href="http://www.paraview.org/mailman/listinfo/paraview" target="_blank">http://www.paraview.org/mailman/listinfo/paraview</a><br>
&gt;<br>
&gt;<br>
</div></div></blockquote></div><br>