[Gmsh] post processing indexes
Christophe Geuzaine
cgeuzaine at ulg.ac.be
Wed Apr 22 09:53:07 CEST 2009
John Borchardt wrote:
> Hello and thank you for gmsh!
>
> I am using gmsh to view several kinds of data at once (e.g., electric
> currents and electromagnetic fields overlaid on the same geometry).
> Oftentimes, the two different datasets need a different color scale.
> I'd like to put that data into their respective *.pos files, however, I
> am not sure how index the views properly.
>
> The problem is that you don't know how many data sets there will be or
> what order they'll occur on the command line, so you can't (evidently)
> just hard-code an index into each *.pos file.
>
> Example: if file1 contained:
>
> View[0].RangeType = 2;
> View[0].CustomMax = 20;
> View[0].CustomMin = 0;
>
> and if file2 contained:
>
> View[1].RangeType = 2;
> View[1].CustomMax = 10;
> View[1].CustomMin = -10;
>
> then the indexes would only refer to the correct data views when gmsh is
> invoked as
>
> gmsh file1.pos file2.pos
>
> and things like:
>
> gmsh file2.pos file1.pos
> gmsh file2.pos
>
> would not work as desired.
>
> So I'm wondering if it's possible to fix my problem;
> PostProcessing.NbViews doesn't quite seem to do what I want, it only
> seems to give the total number of data sets loaded, and not the number
> of the dataset that gmsh is currently parsing.
>
Hello John - With .pos files here's what I would do:
<<file1.pos>>
View "1" {
ST(0,0,0, 1,0,0, 0,1,0){-30,0,30};
};
n = PostProcessing.NbViews - 1;
View[n].RangeType = 2;
View[n].CustomMax = 20;
View[n].CustomMin = 0;
<<file2.pos>>
View "2" {
ST(0,0,0, 1,0,0, 0,1,0){-30,0,30};
};
n = PostProcessing.NbViews - 1;
View[n].RangeType = 2;
View[n].CustomMax = 10;
View[n].CustomMin = -10;
With .msh files, you could use the same trick, except that you would
need to put the options in separate files, loaded in sequence ("gmsh
file1.msh file1.opt file2.msh file2.opt").
> Thanks for all your help in advance! Please forgive me if the answer is
> already out there -- I looked at the manual, the t8.geo and t9.geo files
> and I did a search on the mail list archives but did not see anything
> that would help me.
>
> --John
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> 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