[Gmsh] postprocessing: write Integrate results on the fly

Christophe Geuzaine cgeuzaine at ulg.ac.be
Wed May 5 11:29:41 CEST 2010


On 23/04/10 17:29, demesy wrote:
> 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);

->  Save View[num] Sprintf("T-%02g.pos", num);



>
> 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
> scanning
> 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;
>      Plugin(Integrate).Run;
>      Save View[2*num+1] "T.pos";
> EndFor
> _________________________
>
> Thanks a lot for your time,
>
> Guillaume
>
> _______________________________________________
> gmsh mailing list
> gmsh at geuz.org
> 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