[Gmsh] animate structural mode shapes

Al Danial al.danial at gmail.com
Sun May 30 21:32:31 CEST 2004


On Sun, 30 May 2004 01:35:26 -0700, Christophe Geuzaine
<geuzaine at acm.caltech.edu> wrote:

> Plugin(DisplacementRaise) is overkill for what you want to  do. Just
> define a vector view with your displacements, i.e.,
[...]
> and set "View->Options->Aspect->Vector display" as "Displacement". (You
> can set an "amplification" with the "Displacement factor" option.)

Nice!  I looked up and found the equivalent script settings
and added an animation loop to give me just what I was
looking for:

View "ten_segment_bar" {
VL(0.0,0.0,0.0,0.1,0.0,0.0){0,0.00,0, 0,0.31,0};
VL(0.1,0.0,0.0,0.2,0.0,0.0){0,0.31,0, 0,0.59,0};
VL(0.2,0.0,0.0,0.3,0.0,0.0){0,0.59,0, 0,0.81,0};
VL(0.3,0.0,0.0,0.4,0.0,0.0){0,0.81,0, 0,0.95,0};
VL(0.4,0.0,0.0,0.5,0.0,0.0){0,0.95,0, 0,0.99,0};
VL(0.5,0.0,0.0,0.6,0.0,0.0){0,0.99,0, 0,0.95,0};
VL(0.6,0.0,0.0,0.7,0.0,0.0){0,0.95,0, 0,0.81,0};
VL(0.7,0.0,0.0,0.8,0.0,0.0){0,0.81,0, 0,0.59,0};
VL(0.8,0.0,0.0,0.9,0.0,0.0){0,0.59,0, 0,0.31,0};
VL(0.9,0.0,0.0,1.0,0.0,0.0){0,0.31,0, 0,0.00,0};
};
nFrames = 100;
nIter   = 10 ;
For iter In {1:nIter}
    For frame In {1:nFrames}
        View.DisplacementFactor = Sin(2*Pi*frame/nFrames);
        View.VectorType = 5;
        Sleep 0.01;
        Draw;
    EndFor
EndFor

Is there a way to bind the "play" icon so that it executes
a user-defined function (namely an animation loop such
as the one above) instead of going through time steps?
It would be cool to load in a structural model's eigenvectors
(in the form of vector views of the elements) and hit "play"
and see an animation of selected modes of vibration.   -- Al