DOLFIN
DOLFIN C++ interface
GeometryPredicates.h
1 // Copyright (C) 2016-2017 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-11-21
19 // Last changed: 2017-12-12
20 
21 #ifndef __GEOMETRY_PREDICATES_H
22 #define __GEOMETRY_PREDICATES_H
23 
24 #include <vector>
25 #include <dolfin/log/LogStream.h>
26 #include "Point.h"
27 
28 namespace dolfin
29 {
30 
33 
35  {
36  public:
37 
39  static bool is_degenerate(const std::vector<Point>& simplex,
40  std::size_t tdim,
41  std::size_t gdim);
42 
44  static bool is_finite(const std::vector<Point>& simplex);
45 
47  static bool is_finite(const std::vector<double>& simplex);
48 
50  static bool convex_hull_is_degenerate(const std::vector<Point>& p,
51  std::size_t gdim);
52 
53  private:
54 
55  // Implementation of is_degenerate predicates
56  static bool _is_degenerate_tdim_1(const std::vector<Point>& simplex);
57 
58  static bool _is_degenerate_tdim_2_gdim_2(const std::vector<Point>& simplex);
59 
60  static bool _is_degenerate_tdim_2_gdim_3(const std::vector<Point>& simplex);
61 
62  static bool _is_degenerate_tdim_3_gdim_3(const std::vector<Point>& simplex);
63  };
64 
65 }
66 
67 #endif
static bool convex_hull_is_degenerate(const std::vector< Point > &p, std::size_t gdim)
Check whether the convex hull is degenerate.
Definition: GeometryPredicates.cpp:144
Definition: adapt.h:29
static bool is_degenerate(const std::vector< Point > &simplex, std::size_t tdim, std::size_t gdim)
Check whether a single simplex is degenerate.
Definition: GeometryPredicates.cpp:29
static bool is_finite(const std::vector< Point > &simplex)
Check whether simplex is finite (not Inf or NaN)
Definition: GeometryPredicates.cpp:120
Definition: GeometryPredicates.h:34