DOLFIN
DOLFIN C++ interface
ConvexTriangulation.h
1 // Copyright (C) 2016 Anders Logg, August Johansson and Benjamin Kehlet
2 //
3 // This file is part of DOLFIN.
4 //
5 // DOLFIN is free software: you can redistribute it and/or modify
6 // it under the terms of the GNU Lesser General Public License as published by
7 // the Free Software Foundation, either version 3 of the License, or
8 // (at your option) any later version.
9 //
10 // DOLFIN is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU Lesser General Public License for more details.
14 //
15 // You should have received a copy of the GNU Lesser General Public License
16 // along with DOLFIN. If not, see <http://www.gnu.org/licenses/>.
17 //
18 // First added: 2016-06-01
19 // Last changed: 2017-09-30
20 
21 #ifndef __CONVEX_TRIANGULATION
22 #define __CONVEX_TRIANGULATION
23 
24 #include <vector>
25 #include "Point.h"
26 
27 namespace dolfin
28 {
29 
32 
34  {
35  public:
36 
38  static std::vector<std::vector<Point>>
39  triangulate(const std::vector<Point>& p,
40  std::size_t gdim,
41  std::size_t tdim);
42 
44  static std::vector<std::vector<Point>>
45  triangulate_1d(const std::vector<Point>& pm,
46  std::size_t gdim)
47  {
48  return _triangulate_1d(pm, gdim);
49  }
50 
52  static std::vector<std::vector<Point>>
53  triangulate_graham_scan_2d(const std::vector<Point>& pm)
54  {
55  return _triangulate_graham_scan_2d(pm);
56  }
57 
59  static std::vector<std::vector<Point>>
60  triangulate_graham_scan_3d(const std::vector<Point>& pm);
61 
63  static bool selfintersects(const std::vector<std::vector<Point>>& p);
64 
65  private:
66 
67  // Implementation declarations
68 
70  static std::vector<std::vector<Point>>
71  _triangulate_1d(const std::vector<Point>& pm,
72  std::size_t gdim);
73 
75  static std::vector<std::vector<Point>>
76  _triangulate_graham_scan_2d(const std::vector<Point>& pm);
77 
79  static std::vector<std::vector<Point>>
80  _triangulate_graham_scan_3d(const std::vector<Point>& pm);
81  };
82 
83 } // end namespace dolfin
84 #endif
static std::vector< std::vector< Point > > triangulate(const std::vector< Point > &p, std::size_t gdim, std::size_t tdim)
Tdim independent wrapper.
Definition: ConvexTriangulation.cpp:177
static bool selfintersects(const std::vector< std::vector< Point >> &p)
Determine if there are self-intersecting tetrahedra.
Definition: ConvexTriangulation.cpp:575
Definition: adapt.h:29
static std::vector< std::vector< Point > > triangulate_graham_scan_3d(const std::vector< Point > &pm)
Triangulate using the Graham scan 3D.
Definition: ConvexTriangulation.cpp:534
static std::vector< std::vector< Point > > triangulate_1d(const std::vector< Point > &pm, std::size_t gdim)
Triangulate 1D.
Definition: ConvexTriangulation.h:45
static std::vector< std::vector< Point > > triangulate_graham_scan_2d(const std::vector< Point > &pm)
Triangulate using the Graham scan 2D.
Definition: ConvexTriangulation.h:53
Definition: ConvexTriangulation.h:33