[Paraview] Animating a function of a field

Cory Quammen cory.quammen at kitware.com
Wed Jan 4 23:59:31 EST 2017


Aleksejs,

The following should work:

* add a Programmable Filter to the source that produces the
unstructured grid with f and g. Set the Script property to

data = self.GetOutput()
data.ShallowCopy(self.GetInput())

and the RequestInformation Script to

timeSteps = range(100)
outInfo = self.GetOutputInformation(0)

timeRange = [timeSteps[0], timeSteps[-1]]
outInfo.Set(vtk.vtkStreamingDemandDrivenPipeline.TIME_RANGE(), timeRange, 2)
outInfo.Set(vtk.vtkStreamingDemandDrivenPipeline.TIME_STEPS(),
timeSteps, len(timeSteps))

You can change timeSteps to whatever values you want the time variable
to take on.

* Add a Python Calculator to the Programmable Filter, and set the expression to

f * sin(t_value) + g * cos(t_value)

Optionally change the "Array Name" property to "h". You can then
visualize the h field however you wish.

Hope that helps,
Cory

On Tue, Jan 3, 2017 at 10:13 AM, Aleksejs Fomins
<aleksejs.fomins at lspr.swiss> wrote:
> Dear Paraview,
>
> I have a 3d unstructured mesh with two fields defined over it - f(x,y,z) and g(x,y,z)
> I want to create a movie of a following function
>
> h(t) = f * sin(t) + g * cos(t)
>
> where t is time. How would you do it?
>
> Best regards,
> Aleksejs Fomins
>
> PhD Student in Nanophotonics, EPF Lausanne, Switzerland
> _______________________________________________
> 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
>
> Search the list archives at: http://markmail.org/search/?q=ParaView
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/paraview



-- 
Cory Quammen
Staff R&D Engineer
Kitware, Inc.


More information about the ParaView mailing list