[Gmsh] build a model directly from the c++ code

sébastien janas sjanas at ulg.ac.be
Tue Feb 22 20:46:21 CET 2011


Hi,

I want to build a gmsh model directly from my c++ code with the API.

I want to do a simple line with :

- a left node with tag 10
- a right node with tag 20
- a line between with tag 30

My idea is to simply do something like that

GModel *m = new GModel();
GPoint a(0.,0.,0.);
GPoint b(1.,0.,0.);

GVertex left(m,10);
left.setPosition(a);

GVertex right(m,20);
right.setPosition(b);

GEdge line(m,30,left,right);

and then mesh my model and do computations.

The problem is that this procedure is impossible because there are some
pure virtual functions in the definitions of the GPoint,GVertex and
GEdge classes. 

I understand that I have to call some inherited classes, but I don't see
which and how to do.

Somebody can help me with this ?

Best regards,

Sébastien