[Gmsh] combining views

Christophe Geuzaine c.geuzaine at ulg.ac.be
Mon Apr 4 17:58:55 CEST 2005


Eric Bechet wrote:
> Hi, I have a huge set of ".pos" files, each one corresponding to a
> different time step and I would like to combine them into *one* multi
> time step view. I know the interactive way (using the GUI). However,
> I would like to make this happen using a command line option
> (-combine),  but I do not know exactly how it works (apparently it
> does nothing)...

Currently "-combine" combines the data from all the post-processing
views having the same name (i.e., "-combine" works like
"View->Combine->Time Steps->By View Name" in the GUI).

Until I add the other "Combine" modes in the parser here are two
workarounds:

1) Put the following script in a file named "eric.txt":

// ---------------------------------------------
// renames all the views, combines them into a single
// multi-time-step view, and saves the result in "new.pos"
For i In {0:PostProcessing.NbViews-1}
   View[i].Name = "blabla";
EndFor
Combine TimeSteps;
Save View[0] "new.pos";
// -----------------------------------------------

Then run "gmsh *.pos eric.txt -0". This will convert all your views into
a new one called "new.pos", in batch mode.

2) Recompile the source code after replacing

CombineViews(1, 2, CTX.post.combine_remove_orig);

with

CombineViews(1, 1, CTX.post.combine_remove_orig);

in Fltk/Main.cpp. This will change the "-combine" option to act on all
the views, and not only on those that have the same name.

> 
> Another issue (related to the above) : gmsh limits the number of 
> simultaneous views it can load ... if I wish to combine lots - let's
> say 1000's- of views into a single one, how to proceed ?

Since version 1.56 Gmsh doesn't have any limit anymore on the number of
views you can load. So you should upgrade...

(Note that if you load more than 1300 views, the menu window will begin
to act a little strange. This is not Gmsh's fault: it's due to the fact
that FLTK stores positions using short integers, which, with 25 pixels
buttons, will overflow if you have more that 2^(16-1)/25=1310 buttons...
Even with that everything will still work fine though: it's just that
the menu window will be a bit messed up.)

Christophe

-- 
Christophe Geuzaine
Applied and Computational Mathematics, Caltech
geuzaine at acm.caltech.edu - http://geuz.org