[Gmsh] moving particles

Christophe Geuzaine cag32 at case.edu
Tue Nov 22 02:05:58 CET 2005


Jozsef Bakosi wrote:
> Hello,
> 
> I'm saving time-evolution data into gmsh postprocess-format. So far I
> only had a fixed mesh and function values changing in the nodes as time
> passed, so I could create animations. Now, I'd like to put particles
> into my domain and would like to see where the particles are going
> during timestepping.
> 
> If I create a View with scalar points (SP) that visually gives me what
> I want (a bunch of dots on a still picture), but now I'd like to see the
> same with the particles moved to different positions. Is it possible to
> write the data into a format that gmsh can show this at different
> timesteps?
> 
> I am looking at the manual, but I can only see saving data connected to
> points that don't move (eg. their coordinates remain the same and only
> their function values change). So I guess I would need the opposite: the
> value at a point remains the same, but the position changes.
> 
> Can this be done?
> 

Yes. One way is to keep using scalar points, but create your animation
by looping over the views instead of looping over the time steps. So
just create one view per time step, and then press the "up" and "down"
arrows on your keyboard instead of the "left" and "right" arrows to
animate; or select "Cycle through views instead of time steps" in
Options->Post-Processing.

Another way is to save your data as vector points (VP), with the vector
data set to the displacement from the point's position. Then you can
animate by looping through the time steps and see the particles as well
as their trajectory by setting "Vector display" to "Displacement" in
Options->View->Aspect. Here is a small example:

View "particles" {
   VP(0,0,0){0,0,0, 0.1,0,0, 0.2,0.02,0, 0.3,0.03,0, 0.4,0.05,0};
   VP(1,0,0){0,0,0, -0.05,0,0, -0.1,0.05,0, -0.15,0.08,0, -0.2,0.1,0};
};
View[0].PointType = 1;
View[0].VectorType = 5;

Christophe

-- 
Christophe Geuzaine
Assistant Professor, Case Western Reserve University, Mathematics
http://www.case.edu/artsci/math/geuzaine