Re: [Paraview] Animating a function of a field

2017-01-16 Thread Aleksejs Fomins
Dear Cory,

It seems to work quite nicely. Thank you!!!

Best regards,
Aleksejs

On 05.01.2017 05:59, Cory Quammen wrote:
> 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
>  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
>
>

___
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


Re: [Paraview] Animating a function of a field

2017-01-04 Thread Cory Quammen
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
 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.
___
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


Re: [Paraview] Animating a function of a field

2017-01-03 Thread Samuel Key

Aleksejs,

Using brute strength and awkwardness, three conditions are needed:

(1) if your datum set is defined as f(x,y,z,t) & g(x,y,z,t),

(2) if both f(.) and g(.) are either cell values or point values, and

(3) if the variable 'time(.)' has been explicitly added as a datum set 
item (a name and a value),


then add PV's Calculator Filter to the pipeline where 'results' is 
replaced by 'h' and the equation is set as f*sin(time)+g*cos(time).


After selecting the 'APPLY' button, 'h(.) will be added to your datum-set.

(To the best my knowledge, 'time' is not available in the PV Calculator 
filter.)


Sam Key

On 1/3/2017 8:13 AM, Aleksejs Fomins 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


___
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


[Paraview] Animating a function of a field

2017-01-03 Thread Aleksejs Fomins
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