Next question,<br><br>My scalar data is written to the cell centers and I can't figure out how to get the coordinates of the cell centers in my programmable filter.<br><br>After perusing the vtk documentation (as best as a Fortran programmer can) it looks I need to do something along the lines of <br>
<br><blockquote style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;" class="gmail_quote">input = self.GetInputDataObject(0, 0)<br>output = self.GetOutputDataObject(0)<br> <br>inputBlock = input.GetBlock(0)<br>
# copy old data<br>output.CopyStructure(input)<br>outputBlock = inputBlock.NewInstance()<br>outputBlock.UnRegister(None)<br>outputBlock.CopyStructure(inputBlock)<br>output.SetBlock(0,outputBlock)<br><br>numCls = inputBlock.GetNumberOfCells()<br>
pc = [0.0,0.0,0.0]<br>for i in range(numCls):<br> cell = inputBlock.GetCell(i)<br> sId = cell.GetParametricCenter(pc)<br> cell.EvaluateLocation(sId,pc,coord)<br> # coord should have cell center in xyz space<br>
</blockquote><div><br>However, 'EvaluateLocation' doesn't appear to be available to me. How do I grab the cell center in xyz coordinates? <br><br>Thanks again,<br>Peter.<br></div><br><br><br><br><br><div class="gmail_quote">
On Thu, Apr 22, 2010 at 5:33 PM, Peter Brady <span dir="ltr"><<a href="mailto:petertbrady@gmail.com">petertbrady@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Fantastic! "InputBlock" is a leaf block as suspected.<br><br>Until my next question,<br><font color="#888888">Peter <br></font><div><div></div><div class="h5"><br><div class="gmail_quote">On Thu, Apr 22, 2010 at 5:15 PM, Berk Geveci <span dir="ltr"><<a href="mailto:berk.geveci@kitware.com" target="_blank">berk.geveci@kitware.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">You have to get the leaf nodes of the multi-block dataset first. In<br>
this case, I suspect inputBlock will be a leaf block.<br>
<font color="#888888"><br>
-berk<br>
</font><div><div></div><div><br>
On Thu, Apr 22, 2010 at 5:01 PM, Peter Brady <<a href="mailto:petertbrady@gmail.com" target="_blank">petertbrady@gmail.com</a>> wrote:<br>
> The location we're looking at is the interface between two fluids so there<br>
> may be a discontinuity in the tangential derivatives for that reason. I'm<br>
> trying to write my own derivative and interpolation filters in a python<br>
> programmable filter which will take one-sided derivatives and use one-sided<br>
> interpolation. In order to do this I need to use cell data in my filter and<br>
> not point data to avoid the interpolation that takes place. Typically I<br>
> access point data with something like:<br>
><br>
>> input = self.GetInputDataObject(0, 0)<br>
>> output = self.GetOutputDataObject(0)<br>
>><br>
>> inputBlock = input.GetBlock(0)<br>
>> # copy old data<br>
>> output.CopyStructure(input)<br>
>> outputBlock = inputBlock.NewInstance()<br>
>> outputBlock.UnRegister(None)<br>
>> outputBlock.CopyStructure(inputBlock)<br>
>> output.SetBlock(0,outputBlock)<br>
>><br>
>> # get number of points<br>
>> numPts = input.GetNumberOfPoints()<br>
>> # temperature gradient<br>
>> GtArr = input.GetPointData().GetVectors('ScalarGradient')<br>
><br>
> However, there doesn't seem to be an equivalent 'GetNumberOfCells()' or<br>
> 'GetCellData()' for my multiblock data. How can I access the cell data?<br>
><br>
> Thanks for your help,<br>
><br>
> Peter.<br>
><br>
> On Tue, Mar 30, 2010 at 10:15 AM, Berk Geveci <<a href="mailto:berk.geveci@kitware.com" target="_blank">berk.geveci@kitware.com</a>><br>
> wrote:<br>
>><br>
>> I wonder if this is because of the multiple celldata -> point data<br>
>> conversions. Do you have an example dataset you can share?<br>
>><br>
>> On Sun, Mar 28, 2010 at 1:45 AM, Peter Brady <<a href="mailto:petertbrady@gmail.com" target="_blank">petertbrady@gmail.com</a>><br>
>> wrote:<br>
>> > Hello list,<br>
>> ><br>
>> > I have a 3D dataset with a Temperature field. My goal is to insert a<br>
>> > sphere<br>
>> > source and determine the tangential temperature gradient on the surface<br>
>> > of<br>
>> > the sphere at various zenith angles. The data is output from the code<br>
>> > as<br>
>> > cell data. Here is the way I'm doing this (through pvpython)<br>
>> ><br>
>> > 1. Apply CellDataToPointData<br>
>> > 2. Apply ComputeDerivatives (to get the 'Scalar Gradient')<br>
>> > 3. Apply another CellDataToPointData (to turn the derivatives into<br>
>> > point<br>
>> > data)<br>
>> > 4. Resample the data from step 3 with my sphere source.<br>
>> > 5. Use a programmable filter to combine the xyz derivatives<br>
>> > appropriately.<br>
>> ><br>
>> > The data is reasonable but it's fairly choppy. When I look at dT/dx,<br>
>> > dT/dy,<br>
>> > and dT/dz (before I project them onto the sphere surface), and plot them<br>
>> > at<br>
>> > a particular zenith angle around the azimuth of the drop, dTdx and dTdy<br>
>> > are<br>
>> > very smooth but dT/dz is fairly choppy (especially above the equator of<br>
>> > the<br>
>> > drop). If I expand my sphere to a place where there's not a lot going<br>
>> > on<br>
>> > dT/dz seems to calm down. Is there a way to smooth dT/dz in the<br>
>> > location of<br>
>> > interest or should I try to write my own derivatives filter to make them<br>
>> > smoother? Any thoughts?<br>
>> ><br>
>> > Thanks,<br>
>> > Peter.<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>
</div></div></blockquote></div><br>
</div></div></blockquote></div><br>