Neil Morrison wrote:
Hi,

Is it possible to use Gmsh to visualise / animate a Lagrangian mesh simulation, 
i.e. with a
different mesh at each time step (mesh moves with the flow)?

I write a separate ".msh" file at each time-step, with the current node 
positions and
elements, and then in $NodeData I define the fields over the nodes, for the 
current
time-step.  So far I could only display the fields for each individual file, I 
couldn't
animate them. Each file had to be opened separately.

I know that Gmsh can animate multiple time-step data provided that the mesh 
remains the same,
but in my simulations the mesh is different at each time-step.


Hi Neil - There are two possibilities:

1) with all versions of Gmsh you can save your data into separate post-processing views (e.g., one view per mesh), and produce the animation by looping over these views instead of looping over the "timesteps". (In the GUI: Tools->Options->Post-pro->Cycle through views instead of time steps. For an sample script: cf. demos/anim.script.)

However, this can become quite inefficient for large datasets, so there's a new way:

2) you can use the new model-based post-processing format, which supports multi-model datasets. The user interface is still a bit clumsy, though:

- "step1.msh" contains a mesh and a nodal dataset, identified as "step 0" of the view "A scalar view".

- "step23.msh" contains a different mesh, with 2 time steps (1 and 2) of the same view, but on the new model mesh.

When you load the meshes, you have to tell Gmsh to create separate models instead of merging all the meshes in the same model. The only (clumsy) way to do so at the moment is from the command line:

gmsh step1.msh -new step23.msh

(step1.msh gets merged in the current default model; "-new" tells gmsh to push a new empty model on the stack; this model becomes the new current model, into which step23.msh is merged. The bottom-left button in the graphic window allows to select the current model, in case you'd like to merge additional data in it.)

Your feedback is welcome on this new feature...

Christophe

PS: the multi-model stuff is only available in the latest nightly snapshots.







Many thanks,
Neil


_______________________________________________
gmsh mailing list
[email protected]
http://www.geuz.org/mailman/listinfo/gmsh




--
Prof. Christophe Geuzaine
University of Liege, Electrical Engineering and Computer Science
http://www.montefiore.ulg.ac.be/~geuzaine
$MeshFormat
2.0 0 8
$EndMeshFormat
$Nodes
6
1 0 0 0
2 0 1.2 0
3 1.2 0 0
4 1.2 1.2 0
5 0.6 0 0
6 0.6 1.2 0
$EndNodes
$Elements
2
1 3 0 1 2 6 5
2 3 0 3 4 6 5
$EndElements
$NodeData
1
"A scalar view"
1
11.0
3
1
1
6
1 0.0
2 0.0
3 2.0
4 2.0
5 2.0
6 2.0
$EndNodeData
$NodeData
1
"A scalar view"
1
12.0
3
2
1
6
1 0.5
2 0.2
3 2.2
4 1.2
5 0.7
6 2.0
$EndNodeData
$MeshFormat
2.0 0 8
$EndMeshFormat
$Nodes
4
1 0 0 0
2 0 1 0
3 1 0 0
4 1 1 0
$EndNodes
$Elements
1
1 3 0 1 3 4 2
$EndElements
$NodeData
1
"A scalar view"
1
10.0
3
0
1
4
1 0.0
2 0.0
3 1.0
4 1.0
$EndNodeData
_______________________________________________
gmsh mailing list
[email protected]
http://www.geuz.org/mailman/listinfo/gmsh

Reply via email to