I can't think of a reasonable way to do it with just paraview.simple. 
paraview.simple really just manages the pipeline by creating readers, filters, 
representations, and writers. It would have to construct a filter or some chain 
of filters that computed displacements based on time, and I can't think of any 
set of built in filters to do that. (The Salome distribution seems to have some 
added filters, so there may be something there I don't know about.)

I guess technically you could use paraview.simple to pull data out of the 
pipeline and manipulate it directly. That's not a very good way of doing it, 
and you will be working directly with a VTK object just like in the programable 
filter, so it's not really any better anyway.

-Ken


From: Nima Maftoon <[email protected]<mailto:[email protected]>>
Reply-To: Nima Maftoon <[email protected]<mailto:[email protected]>>
Date: Wednesday, January 6, 2016 at 2:25 PM
To: Kenneth Moreland <[email protected]<mailto:[email protected]>>, 
"[email protected]<mailto:[email protected]>" 
<[email protected]<mailto:[email protected]>>
Subject: [EXTERNAL] Re: [Paraview] Visualizing complex vibration modes

Thanks Ken!

Is there any Paraview solution rather than a VTK solution? Like using 
paraview.simple?
Nima


________________________________
From: "Moreland, Kenneth" <[email protected]<mailto:[email protected]>>
To: Nima Maftoon <[email protected]<mailto:[email protected]>>; 
"[email protected]<mailto:[email protected]>" 
<[email protected]<mailto:[email protected]>>
Sent: Tuesday, January 5, 2016 11:05 AM
Subject: Re: [Paraview] Visualizing complex vibration modes

You have to jump through a couple of hoops to get it, but this expression will 
return it:

self.GetInputInformation().Get(vtk.vtkStreamingDemandDrivenPipeline.UPDATE_TIME_STEP())

-Ken


From: Nima Maftoon <[email protected]<mailto:[email protected]>>
Reply-To: Nima Maftoon <[email protected]<mailto:[email protected]>>
Date: Tuesday, January 5, 2016 at 6:31 AM
To: Kenneth Moreland <[email protected]<mailto:[email protected]>>, 
"[email protected]<mailto:[email protected]>" 
<[email protected]<mailto:[email protected]>>
Subject: [EXTERNAL] Re: [Paraview] Visualizing complex vibration modes

Hi Ken,

Thanks for your detailed explanation. Any hints about how to get access to the 
animation time?

Nima



________________________________
From: "Moreland, Kenneth" <[email protected]<mailto:[email protected]>>
To: Nima Maftoon <[email protected]<mailto:[email protected]>>; 
"[email protected]<mailto:[email protected]>" 
<[email protected]<mailto:[email protected]>>
Sent: Monday, January 4, 2016 1:49 PM
Subject: Re: [Paraview] Visualizing complex vibration modes

I suggest that your filter sets the TIME_RANGE anyway. It is good practice for 
a filter that responds to time updates to advertise as such by providing either 
TIME_STEPS or TIME_RANGE. I can't remember all the nitty-gritty details of how 
the streaming demand driven pipeline decides when filters need to be updated, 
but if you don't set a TIME_RANGE in RequestInformation then I fear there is a 
chance that ParaView/VTK will not update your filter when the time step changes.

All the TIME_RANGE does is specify a continuous range of valid time values. It 
does not actually specify and time steps. That is appropriate for your filter 
because the displacement is computed on the fly. I would set the TIME_RANGE to 
be one period of the vibration.

Setting a TIME_RANGE is unlikely to hurt anything. If no reader or filter has 
provided time steps, then ParaView might adjust the animation start and stop 
time to include the time range provided. If the reader has already provided 
time steps, then ParaView by default sets itself to "Snap to TimeSteps" mode, 
and it will just always use the time steps. Regardless, the animation engine 
controls the time range and time steps within ParaView. The TIME_RANGE you 
provide is just a suggestion. If the animation engine defines a time range 
outside of the TIME_RANGE you given, your filter will still be given those "out 
of bounds" time steps, which is no problem for your filter since the motion is 
periodic.

-Ken


From: Nima Maftoon <[email protected]<mailto:[email protected]>>
Reply-To: Nima Maftoon <[email protected]<mailto:[email protected]>>
Date: Monday, January 4, 2016 at 11:14 AM
To: Kenneth Moreland <[email protected]<mailto:[email protected]>>, 
"[email protected]<mailto:[email protected]>" 
<[email protected]<mailto:[email protected]>>
Subject: [EXTERNAL] Re: [Paraview] Visualizing complex vibration modes

Hello Ken,

Thanks a lot for your response. There are some good ideas in your message for 
me to work on. I didn't know about SLAC at all. I see what you mean about the 
reader but I prefer to follow your suggestions the python way for now because I 
think it is less of a headache.

Let me transfer your suggestions for the reader to ones to be implemented in a 
python programmable filter. I guess instead of advertising the TIME_RANGE I 
would use whatever time range and time steps that the animation engine sets. 
Those can be controlled with number of frames, etc. I think time sweep should 
be done by the animation engine as well. Now I am again stuck with my original 
problem of accessing the time information to drive the sin function.
Thanks again

Nima


________________________________
From: "Moreland, Kenneth" <[email protected]<mailto:[email protected]>>
To: Nima Maftoon <[email protected]<mailto:[email protected]>>; 
"[email protected]<mailto:[email protected]>" 
<[email protected]<mailto:[email protected]>>
Sent: Monday, January 4, 2016 11:41 AM
Subject: Re: [Paraview] Visualizing complex vibration modes

Nima,

I think your question is very open ended and there are multiple ways to 
implement what you want.

If it were me and I had enough control over the development of the ParaView 
components, I would add the capability of animating mode shapes in the reader. 
I don't see a MED reader in my binary distribution of ParaView, so I am 
assuming that the version of ParaView that comes with Salome as a custom plugin 
that provides this MED reader (as well as other facilities). Perhaps you can 
enhance the MED reader to understand mode shapes with different phases and 
animate them.

The way this would work is that the MED reader would advertise that its data is 
available over a certain time range by sending a TIME_RANGE key down the 
pipeline during the RequestInformation phase. This is enough to tell ParaView 
to set up an animation for this time range. The next time RequestData is called 
on your reader, an UPDATE_TIME_STEP key will be set with the current time value 
for the animation. The reader can then compute the displacement vector with the 
"cos(wt) + b cos(wt + pi/2)" using the given time value for t. I would have the 
reader also internally apply the displacement vector to the point coordinates. 
This implementation is a bit of a headache for the developer, but it creates a 
nice seamless interface for the user. Load the file and it just works. No 
scripts or extra processing necessary.

I know of two readers in ParaView that support mode shapes: Exodus II and SLAC. 
Of these two, the SLAC reader is closer to your use case because it also 
supports mode shapes defined with complex values and different phases. The 
source code for the SLAC reader is in ParaView/VTK/IO/NetCDF/vtkSLACReader.cxx, 
so you can consult the solution there.

If you are not in a position to make modifications to the MED reader, the next 
best solution would be to create a filter that animates the mode shape for you. 
The filter would work basically the same as I described above for the reader 
except that the data comes from the filter input rather than a file. Such a 
filter can be implemented with the programmable filter and then encapsulated in 
a plugin without having to compile any custom C++ code 
(http://www.kitware.com/blog/home/post/534).

Hope that helps.

-Ken


From: ParaView 
<[email protected]<mailto:[email protected]>> on behalf 
of "[email protected]<mailto:[email protected]>" 
<[email protected]<mailto:[email protected]>>
Reply-To: Nima Maftoon <[email protected]<mailto:[email protected]>>
Date: Monday, January 4, 2016 at 6:41 AM
To: "[email protected]<mailto:[email protected]>" 
<[email protected]<mailto:[email protected]>>
Subject: [EXTERNAL] Re: [Paraview] Visualizing complex vibration modes

Hello,

I saw that the two links about the history has been attached together making a 
broken link. I corrected them below:
http://www.salome-platform.org/forum/forum_10/587894859

http://www.paraview.org/pipermail/paraview/2011-December/023538.html

I hope this time they are transferred correctly.
Nima

________________________________
From: Nima Maftoon <[email protected]<mailto:[email protected]>>
To: "[email protected]<mailto:[email protected]>" 
<[email protected]<mailto:[email protected]>>
Sent: Wednesday, December 30, 2015 4:57 PM
Subject: Visualizing complex vibration modes

Hello all,

I am trying to visualize complex vibration modes with Paraview. Unlike in a 
real mode, points in a complex mode have different phases. Please see previous 
discussions on this subject:
http://www.salome-platform.org/forum/forum_10/587894859
http://www.paraview.org/pipermail/paraview/2011-December/023538.html

The Paraview version included in Salome has a macro for modal visualization. 
I've put that macro and a MED file containing both real and imaginary parts of 
the mode shapes and another two other MED files for separate real and imaginary 
parts in the following shared folder.

<http://1drv.ms/1TqggEK>
http://1drv.ms/1TqggEK

The real mode animation in the mode macro is based on applying 
ExtractSurface(), ScaleVector(), WarpByVector() in cascade and animating the 
ScaleVector using a sinusoidal interpolation in a CompositeKeyFrame. However 
for a complex mode two components should drive the WrapByVector filter.

I describe my thoughts, which didn't solve the problem, below:

If the complex mode shape is a+jb, the animated mode shape should have a form 
like a cos(wt)+b cos(wt+pi/2). w is only for visualization and can be 2pi, 1, 
etc. t can come from the animation time. I learned about GetAnimationTime () 
that can be accessed inside a PythonAnimationCue (). Another way of getting the 
time is through CompositeKeyFrame for real and imaginary parts where "Phase" 
for one of them should be set to pi/2 (it is not clear to me whether the phase 
should be defined as deg or rad for CompositeKeyFrame). I guess at least one of 
my problem is that I don't know how to access data of the imaginary and real 
fields in the complex file or data of the two separate reader sources and do 
math operation on them to make a new field out of them and feed it to a wrap 
filter.

Any thoughts would be appreciated.
Nima








_______________________________________________
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

Reply via email to