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

phillip mobley phillipmobley2 at gmail.com
Sun Oct 8 04:35:48 CEST 2017


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.

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? 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://onelab.info/pipermail/gmsh/attachments/20171007/c638fa63/attachment.html>


More information about the gmsh mailing list