[Paraview] How to calculate the gradient ?

Roba Binyahib roba.binyahib at kaust.edu.sa
Fri Apr 27 11:32:08 EDT 2012


Can you explain me how can I apply the gradient filter using python


this is my code

from paraview import servermanager
from paraview.simple import*
connection = servermanager.Connect()
reader.FileName ="/Users/........../disk_out_
ref.ex2"

reader.UpdatePipeline()
pointData = servermanager.filters.CellDataToPointData(Input=reader)
pointData.UpdatePipeline()

gradData = servermanager.filters.CellDataToPointData(Input=reader)
servermanager.filters.Contour.ContourBy = True
servermanager.filters.Contour.Isosurfaces = True

contourData = servermanager.filters.Contour(Input=pointData)
contourData.ContourBy = 'Temp'
contourData.Isosurfaces = [400]
contourData.UpdatePipeline()


servermanager.filters.DecimatePro.TargetReduction = True
dec = servermanager.filters.DecimatePro(Input=contourData)
dec.TargetReduction = 0.9
dec.UpdatePipeline()

view = servermanager.CreateRenderView()
Show(dec, view)
Render(view)


Thanks


On Fri, Apr 27, 2012 at 6:01 PM, David E DeMarle
<dave.demarle at kitware.com>wrote:

> Apply the gradient filter first to make the temp gradient field, then
> contour the output of that but choose the original temp field as the
> one to contour. Finally choose the gradient field magnitude as the
> value to color the isosurface by.
>
> reader->gradient->contour
>
> David E DeMarle
> Kitware, Inc.
> R&D Engineer
> 21 Corporate Drive
> Clifton Park, NY 12065-8662
> Phone: 518-881-4909
>
>
> On Fri, Apr 27, 2012 at 10:52 AM, Roba Binyahib
> <roba.binyahib at kaust.edu.sa> wrote:
> >
> >
> > Hi everyone
> >
> > I have applyed the contour filter on a dataset with isosurface Temp and I
> > want to calculate the gradient of a variable Temp on the combustion
> dataset
> > and use the magnitude of the gradient as a color map for the Temp
> isosurface
> >
> > how can I do that ?
> >
> >
> > Thanks
> >
> >
> > ---------------------------
> >
> > Best Regards,
> > Roba
> >
> >
> > _______________________________________________
> > 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
> >
>



-- 


---------------------------

Best Regards,
Roba
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20120427/3368583c/attachment-0001.htm>


More information about the ParaView mailing list