Next question,<br><br>My scalar data is written to the cell centers and I can&#39;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, &#39;EvaluateLocation&#39; doesn&#39;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">&lt;<a href="mailto:petertbrady@gmail.com">petertbrady@gmail.com</a>&gt;</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!  &quot;InputBlock&quot; 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">&lt;<a href="mailto:berk.geveci@kitware.com" target="_blank">berk.geveci@kitware.com</a>&gt;</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 &lt;<a href="mailto:petertbrady@gmail.com" target="_blank">petertbrady@gmail.com</a>&gt; wrote:<br>
&gt; The location we&#39;re looking at is the interface between two fluids so there<br>
&gt; may be a discontinuity in the tangential derivatives for that reason.  I&#39;m<br>
&gt; trying to write my own derivative and interpolation filters in a python<br>
&gt; programmable filter which will take  one-sided derivatives and use one-sided<br>
&gt; interpolation.  In order to do this I need to use cell data in my filter and<br>
&gt; not point data to avoid the interpolation that takes place.  Typically I<br>
&gt; access point data with something like:<br>
&gt;<br>
&gt;&gt; input = self.GetInputDataObject(0, 0)<br>
&gt;&gt; output = self.GetOutputDataObject(0)<br>
&gt;&gt;<br>
&gt;&gt; inputBlock = input.GetBlock(0)<br>
&gt;&gt; # copy old data<br>
&gt;&gt; output.CopyStructure(input)<br>
&gt;&gt; outputBlock = inputBlock.NewInstance()<br>
&gt;&gt; outputBlock.UnRegister(None)<br>
&gt;&gt; outputBlock.CopyStructure(inputBlock)<br>
&gt;&gt; output.SetBlock(0,outputBlock)<br>
&gt;&gt;<br>
&gt;&gt; # get number of points<br>
&gt;&gt; numPts = input.GetNumberOfPoints()<br>
&gt;&gt; # temperature gradient<br>
&gt;&gt; GtArr = input.GetPointData().GetVectors(&#39;ScalarGradient&#39;)<br>
&gt;<br>
&gt; However, there doesn&#39;t seem to be an equivalent &#39;GetNumberOfCells()&#39; or<br>
&gt; &#39;GetCellData()&#39; for my multiblock data.  How can I access the cell data?<br>
&gt;<br>
&gt; Thanks for your help,<br>
&gt;<br>
&gt; Peter.<br>
&gt;<br>
&gt; On Tue, Mar 30, 2010 at 10:15 AM, Berk Geveci &lt;<a href="mailto:berk.geveci@kitware.com" target="_blank">berk.geveci@kitware.com</a>&gt;<br>
&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; I wonder if this is because of the multiple celldata -&gt; point data<br>
&gt;&gt; conversions. Do you have an example dataset you can share?<br>
&gt;&gt;<br>
&gt;&gt; On Sun, Mar 28, 2010 at 1:45 AM, Peter Brady &lt;<a href="mailto:petertbrady@gmail.com" target="_blank">petertbrady@gmail.com</a>&gt;<br>
&gt;&gt; wrote:<br>
&gt;&gt; &gt; Hello list,<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; I have a 3D dataset with a Temperature field.  My goal is to insert a<br>
&gt;&gt; &gt; sphere<br>
&gt;&gt; &gt; source and determine the tangential temperature gradient on the surface<br>
&gt;&gt; &gt; of<br>
&gt;&gt; &gt; the sphere at various zenith angles.  The data is output from the code<br>
&gt;&gt; &gt; as<br>
&gt;&gt; &gt; cell data.  Here is the way I&#39;m doing this (through pvpython)<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; 1.  Apply CellDataToPointData<br>
&gt;&gt; &gt; 2.  Apply ComputeDerivatives (to get the &#39;Scalar Gradient&#39;)<br>
&gt;&gt; &gt; 3.  Apply another CellDataToPointData (to turn the derivatives into<br>
&gt;&gt; &gt; point<br>
&gt;&gt; &gt; data)<br>
&gt;&gt; &gt; 4.  Resample the data from step 3 with my sphere source.<br>
&gt;&gt; &gt; 5.  Use a programmable filter to combine the xyz derivatives<br>
&gt;&gt; &gt; appropriately.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; The data is reasonable but it&#39;s fairly choppy.  When I look at dT/dx,<br>
&gt;&gt; &gt; dT/dy,<br>
&gt;&gt; &gt; and dT/dz (before I project them onto the sphere surface), and plot them<br>
&gt;&gt; &gt; at<br>
&gt;&gt; &gt; a particular zenith angle around the azimuth of the drop, dTdx and dTdy<br>
&gt;&gt; &gt; are<br>
&gt;&gt; &gt; very smooth but dT/dz is fairly choppy (especially above the equator of<br>
&gt;&gt; &gt; the<br>
&gt;&gt; &gt; drop).  If I expand my sphere to a place where there&#39;s not a lot going<br>
&gt;&gt; &gt; on<br>
&gt;&gt; &gt; dT/dz seems to calm down.  Is there a way to smooth dT/dz in the<br>
&gt;&gt; &gt; location of<br>
&gt;&gt; &gt; interest or should I try to write my own derivatives filter to make them<br>
&gt;&gt; &gt; smoother?  Any thoughts?<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Thanks,<br>
&gt;&gt; &gt; Peter.<br>
&gt;&gt; &gt;<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;<br>
&gt;<br>
</div></div></blockquote></div><br>
</div></div></blockquote></div><br>