[Gmsh] 2D Meshing using API. SPoint2 or SPoint3

phillip mobley phillipmobley2 at gmail.com
Tue Oct 10 18:54:45 CEST 2017

Hello Christophe,

thank you for taking the time to send a response.

My suspicion was correct then. As much as I would like to use GMSH as a
library, I am not so sure it is the best idea for a user experience. I am
creating this project as open source and I would like anyone to be able to
compile and install the program with ease. I am not sure the skill level of
the users who will use my program. For all I know, they could exclusively
be familiar with GUI based simulators. Additional libraries to compile
could be challenging to them.

With that in mind, I do not think that using GMSH as a library is the
better option. Including the sources in with the main program though would
be better.

Could you explain a little bit by what you mean that the " API will not
expose any of the internal C++ classes that the algorithms use"? I am
confused by this statement. The source would need to expose all of the
classes that the program/algorithm uses or how would someone be able to
compile the source?

I don't need to add in everything since I am dealing with only 2D meshes.
Specifically quads. I am commenting out the functionality for the 3D meshes
and ignoring those cases. For example, in some functions there are
case-switch statements that are deal with 3D meshes. I am commenting those
out as I do not need them.

Once I get something built and working, I would step through the code line
by line in order to further refine what I don't need.

I do hope though that the documentation of the source will come sooner
rather then later.

On Tue, Oct 10, 2017 at 11:25 AM, Christophe Geuzaine <cgeuzaine at ulg.ac.be>

> > On 8 Oct 2017, at 04:35, phillip mobley <phillipmobley2 at gmail.com>
> wrote:
> >
> > Hello all,
> >
> > I am attmepting to extract the code from the GMSH API that will be able
> to create a 2D mesh. After looking through the code for a couple of days
> now, I have a question about how the code is structed.
> >
> > So far, I have been commenting out the sections that deal with 3D. For
> instance, removing any headers that include the SPoint3.h becuase I ma only
> dealing with 2D.
> I wouldn't do that. "2D" meshes in Gmsh are also generated on general (3D)
> surfaces.
> >
> > However, I have been getting the impression that the 2D case utilizes
> some of the 3D data structures. At first, I thought that the data
> structures for 2D are seperate from the 3D data structures. As in, if I
> wanted to mesh in 2D, then I would only be worried about the data
> structures related to 2D meshing (such as SPoint2.h). After examining the
> code for a bit though, I am worried that this may not be the case. I am
> starting to get the feeling that the data structures for the 3D (ex.
> SPoint3.h and SVector3.h) are also used in the 2D meshing execpt, the z
> value is set to 0 (or another constant number if the surface that the
> created mesh is on is an extruded surface).
> >
> > My question to the community or whoso ever may be able to answer is,
> does GMSH utilize the data structures for 3D in a 2D meshing case? Even if
> the mesh will always be in the x-y plane?
> Yes.
> As a general rule, with the current version of Gmsh I would only advise to
> use it as a library if you really need to, as there is no documented API. A
> stable API for programmers will be made available in the future (our goal
> is Gmsh 4.0); and this API will not expose any of the internal C++ classes
> that the algorithms use.
> Christophe
> > Or, does a 3D mesh exclusively use the 3D data structures (ex.
> SPoint3.h) and a 2D mesh exclusivly uses the 2D data structures (ex.
> SPoint2)?
> >
> > Let me give another example to hopefully explain what I am asking. If
> you look at the SOrientedBoundingBox.h (and corresponding .cpp file), there
> is a class called SOrientedBoundingBox. The constructor for this class
> takes the SVector3 class. In the GEntity class, there is an instance of the
> SOrientedBoundaingBox. The constructor for the GEntity class even calls the
> contructor of the SOrientedBoundingBox object. Since the
> SOrientedBoundingBox class uses the SVector3 data type, I conclude that
> this class is used when you need to create a 3D mesh. However, I am
> creating a 2D mesh. Will there every be a case that the 2D mesher calls or
> utilizes the SOrientedBoundingBox. Or, would the 2D mesher utilize the
> SOrientedBoundingRectangle class?
> >
> > Also, as a bonus question, what is the purpose of the
> SOrientedBoundingRectangle/SOrientedBoundingBox? Is this used for meshing
> or is this mainly used in the GUI? How are these classes and what are their
> purpose? I
> >
> > I will give a third example, in the GEdge class, there is a variable
> called _normals. This is a mutable map of MVertex *and SVector3. Will the
> 2D meshing case every need access to this data type? Or will this only be
> used in the 3D meshing case?
> >
> > I hope that my explanation clearly explains the issue that I am having.
> If not, please let me know. I would very much to make sure that I am
> clearly explaining the issue that I am having.
> >
> > Thank you all for your time and I look forward to who so ever replies.
> >
> >
> > _______________________________________________
> > gmsh mailing list
> > gmsh at onelab.info
> > http://onelab.info/mailman/listinfo/gmsh
> --
> Prof. Christophe Geuzaine
> University of Liege, Electrical Engineering and Computer Science
> http://www.montefiore.ulg.ac.be/~geuzaine
> Free software: http://gmsh.info | http://getdp.info | http://onelab.info
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://onelab.info/pipermail/gmsh/attachments/20171010/0730efee/attachment.html>

More information about the gmsh mailing list