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