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