[Paraview] Visualizing complex vibration modes

Moreland, Kenneth kmorel at sandia.gov
Mon Jan 4 11:41:17 EST 2016


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 <paraview-bounces at paraview.org<mailto:paraview-bounces at paraview.org>> on behalf of "paraview at paraview.org<mailto:paraview at paraview.org>" <paraview at paraview.org<mailto:paraview at paraview.org>>
Reply-To: Nima Maftoon <n_maftoon at yahoo.com<mailto:n_maftoon at yahoo.com>>
Date: Monday, January 4, 2016 at 6:41 AM
To: "paraview at paraview.org<mailto:paraview at paraview.org>" <paraview at paraview.org<mailto:paraview at paraview.org>>
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 <n_maftoon at yahoo.com<mailto:n_maftoon at yahoo.com>>
To: "paraview at paraview.org<mailto:paraview at paraview.org>" <paraview at paraview.org<mailto:paraview at paraview.org>>
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


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/paraview/attachments/20160104/0f4183d8/attachment.html>


More information about the ParaView mailing list