[Gmsh] postprocessing: write Integrate results on the fly

demesy guillaume.demesy at fresnel.fr
Fri Apr 23 17:29:39 CEST 2010

Dear Gmsh Developpers and Users,

I'm postprocessing some results in a loop in a .geo file like.
I would like to save the last View[i] in the loop below, which contains the
intergral result, in a file named, say, "result-i.pos".
Typically, I'm trying to do something like:
Save View[num] "T-%02g.pos", num; 
which doesn't work. It would be the "Save View" couterpart of Print
Sprintf("t8-%02g.gif", num2);

Is there something else I could try ?

Sample code:
Include "parameters.dat"; // defines opto-geometric parameters in python
interface for the geom&mesh (gmsh), solving (getdp), postpro(gmsh)
Include "poz_t_int.pos" ; // import Poynting_substrate in View0
Include "poz_r_int.pos" ; // import Poynting_superstrate in View1
nb_cut_subs  = 12;        // number of cuts in the substrate
nb_cut_super = 13;        // number of cuts in the superstrate 
scan_dist = 50*nm;        // stay a bit away from grooves & PMLs while
For num In {1:nb_cut_subs}
    Plugin(CutPlane).A = 0 ;
    Plugin(CutPlane).B = 0 ;
    Plugin(CutPlane).C = 1 ;
    Plugin(CutPlane).D = -(-scan_dist + num *
(z_hol-h_sub+2*scan_dist)/nb_cut_subs) ; // Height of cut number num
    Plugin(CutPlane).iView = 0 ;
    Plugin(CutPlane).Run ;
//     Plugin(Smooth).iView = 2*num;
//     Plugin(Smooth).Run;
    Plugin(Integrate).iView = 2*num;
    Save View[2*num+1] "T.pos";

Thanks a lot for your time,