[Gmsh] animate structural mode shapes
Christophe Geuzaine
geuzaine at acm.caltech.edu
Sun May 30 10:35:26 CEST 2004
Al Danial wrote:
> I'm trying to figure out how to animate modes of vibration of a structure
> with gmsh's postprocessing tools. Plugin(DisplacementRaise)
> appears to be closest to what I should be using. Since there's no demo
> or tutorial that uses this plugin it is slow going trying to get something
> to work. Here's my attempt:
>
> I'm modeling a beam pinned at both ends. Its first mode of vibration
> looks like half of a sine wave--imagine a vibrating guitar string. I model
> the beam as ten line elements on x=0 to x=1 and define displacements
> for the first mode, then try to use Plugin(DisplacementRaise) to deform
> the original mesh into the first mode shape:
>
> View "ten_segment_bar" {
> SL(0.0,0.0,0.0,0.1,0.0,0.0){1,1};
> SL(0.1,0.0,0.0,0.2,0.0,0.0){1,1};
> SL(0.2,0.0,0.0,0.3,0.0,0.0){1,1};
> SL(0.3,0.0,0.0,0.4,0.0,0.0){1,1};
> SL(0.4,0.0,0.0,0.5,0.0,0.0){1,1};
> SL(0.5,0.0,0.0,0.6,0.0,0.0){1,1};
> SL(0.6,0.0,0.0,0.7,0.0,0.0){1,1};
> SL(0.7,0.0,0.0,0.8,0.0,0.0){1,1};
> SL(0.8,0.0,0.0,0.9,0.0,0.0){1,1};
> SL(0.9,0.0,0.0,1.0,0.0,0.0){1,1};
> };
>
> View "mode_1_displacements" {
> VP(0.0,0.00,0.0){1};
> VP(0.0,0.31,0.0){1};
> VP(0.0,0.59,0.0){1};
> VP(0.0,0.81,0.0){1};
> VP(0.0,0.95,0.0){1};
> VP(0.0,0.99,0.0){1};
> VP(0.0,0.95,0.0){1};
> VP(0.0,0.81,0.0){1};
> VP(0.0,0.59,0.0){1};
> VP(0.0,0.31,0.0){1};
> };
>
> Plugin(DisplacementRaise).iView = 0;
> Plugin(DisplacementRaise).dView = 1;
>
> Instead of a deformed structure I see the actual vectors in the
> view I'm trying to use as displacements, anyone know how I ought
> to define displacements or use this plugin?
>
> Once this works is there an easy way to step through a scaled
> series of shapes that go from the undeformed to the deformed
> shape (say in eight or ten steps)? Is there a built-in method to do
> this that I've completely overlooked? -- Al
Plugin(DisplacementRaise) is overkill for what you want to do. Just
define a vector view with your displacements, i.e.,
View "ten_segment_bar" {
VL(0.0,0.0,0.0,0.1,0.0,0.0){0,0,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.0,0};
};
and set "View->Options->Aspect->Vector display" as "Displacement". (You
can set an "amplification" with the "Displacement factor" option.)
Cheers,
Christophe
--
Christophe Geuzaine
Applied and Computational Mathematics, Caltech
geuzaine at acm.caltech.edu - http://geuz.org