[Gmsh] Create .geo file using C++..??

rakesh patil prakeshofficial at gmail.com
Wed Oct 26 11:53:20 CEST 2011


Hi Mikhail,

I am really sorry for incorrect and inappropriate question. I have a C++
code to create .geo file... what i want to do is instead of creating .geo
file, i want to directly enter values into the gmsh model through code.. Is
it possible?

My current geo file is saved in this manner(short ex)

Point(1) = {0,0,1};
Point(2) = {1,0,2};
...
...
Point(n) = {a,b,c}
Line(1) = {1,2};
Line(2) = {2,3};
...
...
Line(m-1) = {k-1,k};
Line(m) = {k,1};
Lineloop(1) = {1,2,...,m};
Line(m+1) = {k+1,k+2};
...
LineLoop(2) = {m+1, m+2,...};
Plane Surface(1) = {1,2};

Is there any interface where in I can directly enter contents of .geo file
into model of gmsh instead of writing it into file and reading it back?


2011/10/25 Mikhail Artemiev <artemiev.mikhail at ngs.ru>

> **
> Hi, Rakesh!
>
> >>Is there a way to generate .geo file pro grammatically..?? i.e. using
> C++.??
>
> Maybe, I don't really understand your question... but what is the problem?
>
> int main()
> {
>   std::ofstream geo("test.geo");
>   geo << "Point(1) = {0, 0, 0};\n";
>   // and so on
>   geo.close();
>   return 0;
> }
>
> Cheers
> Mikhail Artemiev
>
> _______________________________________________
> gmsh mailing list
> gmsh at geuz.org
> http://www.geuz.org/mailman/listinfo/gmsh
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.geuz.org/pipermail/gmsh/attachments/20111026/9fc5c8b4/attachment.html>