[Gmsh] sweeping through a mode shape view

Geordie McBain gdmcbain at freeshell.org
Mon Aug 27 18:21:39 CEST 2012


2012/8/27 jean pierre aubry <jeanpierre at lamachine.fr>:
> hello
>
> when i do a modal analysis in Code_Aster, with, let's say, 20 modes
> saved in a med file
> in Gmsh for every single calculated mode i can only
> see the maximum deformed shape for each mode
> is it possible to show on the screen an animation for each mode (with a
> sin function maybe)
> i admit it is mostly useful to show to the customer, but!
>
> the sweep button at the bottom of the screen will sweep thru the 20
> calculated mode max values which is meaningless
>
> is that possible ?

Hello.  Yes, it is, and it's pretty easy and the results look good
too.  The technique used to be in some of the tutorial material, I
think, but now I can't find it.  Something more graphical than the
tutorial/t1.geo, etc.  So I can't give you a proper reference, but the
basic idea is to use a For-loop in a Gmsh script incrementing the
View.DisplacmentFactor with the phase, as follows.

%<---
For frame In {1:Frames}
  View[1].DisplacementFactor = Sin (2 * Pi * frame/Frames);
  Print Sprintf ("sloshing-%03g.png", frame);
EndFor
--->%

This isn't a complete working example, but hopefully is enough to
suggest what needs to be done.