libMesh
mesh_triangle_holes.h
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2017 Benjamin S. Kirk, John W. Peterson, Roy H. Stogner
3 
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either
7 // version 2.1 of the License, or (at your option) any later version.
8 
9 // This library is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // Lesser General Public License for more details.
13 
14 // You should have received a copy of the GNU Lesser General Public
15 // License along with this library; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 
18 #ifndef LIBMESH_MESH_TRIANGLE_HOLES_H
19 #define LIBMESH_MESH_TRIANGLE_HOLES_H
20 
21 #include "libmesh/libmesh_config.h"
22 
23 #ifdef LIBMESH_HAVE_TRIANGLE
24 
25 // Local includes
26 #include "libmesh/mesh_triangle_interface.h"
27 #include "libmesh/point.h"
28 
29 // C++ includes
30 
31 namespace libMesh
32 {
33 
45 {
46 public:
50  Hole() {}
51 
55  virtual ~Hole() {}
56 
60  virtual unsigned int n_points() const = 0;
61 
65  virtual Point point(const unsigned int n) const = 0;
66 
70  virtual Point inside() const = 0;
71 };
72 
73 
74 
75 
76 
82 {
83 public:
89  PolygonHole(const Point & center, Real radius, unsigned int n_points);
90 
91  virtual unsigned int n_points() const libmesh_override;
92 
93  virtual Point point(const unsigned int n) const libmesh_override;
94 
95  virtual Point inside() const libmesh_override;
96 
97 private:
102 
107 
113  unsigned int _n_points;
114 };
115 
116 
117 
118 
127 {
128 public:
133  ArbitraryHole(const Point & center,
134  const std::vector<Point> & points);
135 
136  virtual unsigned int n_points() const libmesh_override;
137 
138  virtual Point point(const unsigned int n) const libmesh_override;
139 
140  virtual Point inside() const libmesh_override;
141 
142 private:
147 
152  const std::vector<Point> & _points;
153 };
154 
155 } // namespace libMesh
156 
157 #endif // LIBMESH_HAVE_TRIANGLE
158 
159 #endif // LIBMESH_MESH_TRIANGLE_HOLES_H
An abstract class for defining a 2-dimensional hole.
const Real radius
virtual unsigned int n_points() const =0
The number of geometric points which define the hole.
The libMesh namespace provides an interface to certain functionality in the library.
virtual Point point(const unsigned int n) const =0
Return the nth point defining the hole.
const std::vector< Point > & _points
Reference to the vector of points which makes up the hole.
Point _center
(x,y) location of the center of the hole
Point _center
arbitrary (x,y) location inside the hole
Another concrete instantiation of the hole, this one should be sufficiently general for most non-poly...
unsigned int _n_points
number of points used to describe the hole.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual Point inside() const =0
Return an (arbitrary) point which lies inside the hole.
A Point defines a location in LIBMESH_DIM dimensional Real space.
Definition: point.h:38
A concrete instantiation of the Hole class that describes polygonal (triangular, square, pentagonal, ...) holes.