25#include "rheolef/geo_element_contains.h"
27namespace rheolef {
namespace details {
29template <
class T,
class M>
38 return x[0] >= p0[0] && x[0] <= p1[0];
40template <
class T,
class M>
47 static const T eps = 1e3*std::numeric_limits<T>::epsilon();
51 if (
orient2d( x, p1, p2) < -eps)
return false;
52 if (
orient2d(p0, x, p2) < -eps)
return false;
53 if (
orient2d(p0, p1, x) < -eps)
return false;
56template <
class T,
class M>
63 static const T eps = 1e3*std::numeric_limits<T>::epsilon();
68 if (
orient2d(x, p0, p1) < -eps)
return false;
69 if (
orient2d(x, p1, p2) < -eps)
return false;
70 if (
orient2d(x, p2, p3) < -eps)
return false;
71 if (
orient2d(x, p3, p0) < -eps)
return false;
74template <
class T,
class M>
81 static const T eps = 1e3*std::numeric_limits<T>::epsilon();
86 if (
orient3d( x, p1, p2, p3) < -eps)
return false;
87 if (
orient3d(p0, x, p2, p3) < -eps)
return false;
88 if (
orient3d(p0, p1, x, p3) < -eps)
return false;
89 if (
orient3d(p0, p1, p2, x) < -eps)
return false;
92template <
class T,
class M>
100 static const T eps = 1e3*std::numeric_limits<T>::epsilon();
109 const point_basic<T>* q[8] = {&p0, &p1, &p2, &p3, &p4, &p5, &p6, &p7};
110 for (
size_type loc_isid = 0, loc_nsid = 6; loc_isid < loc_nsid; loc_isid++) {
114 if (
orient3d(x, *(q[j0]), *(q[j1]), *(q[j2])) < -eps)
return false;
118template <
class T,
class M>
126 static const T eps = 1e3*std::numeric_limits<T>::epsilon();
134 for (
size_type loc_isid = 0, loc_nsid = 5; loc_isid < loc_nsid; loc_isid++) {
138 if (
orient3d(x, *(q[j0]), *(q[j1]), *(q[j2])) < -eps)
return false;
142template <
class T,
class M>
156 default:
error_macro (
"unsupported element type '" << K.
name() <<
"'");
return false;
162#define _RHEOLEF_instanciation(T,M) \
163template bool contains ( \
164 const geo_element& , \
165 const disarray<point_basic<T>,M>&, \
166 const point_basic<T>&);
169#ifdef _RHEOLEF_HAVE_MPI
172#undef _RHEOLEF_instanciation
#define _RHEOLEF_instanciation(T, M, A)
field::size_type size_type
see the Float page for the full documentation
see the disarray page for the full documentation
see the geo_element page for the full documentation
variant_type variant() const
static size_type subgeo_local_node(size_type order, size_type side_dim, size_type loc_isid, size_type loc_jsidnod)
static size_type subgeo_local_node(size_type order, size_type side_dim, size_type loc_isid, size_type loc_jsidnod)
static const variant_type H
static const variant_type q
static const variant_type e
std::vector< int >::size_type size_type
static const variant_type T
static const variant_type P
static const variant_type t
#define error_macro(message)
bool contains(const geo_element &K, const disarray< point_basic< T >, M > &node, const point_basic< T > &x)
bool point_belongs_to_t(const geo_element &K, const disarray< point_basic< T >, M > &node, const point_basic< T > &x)
bool point_belongs_to_H(const geo_element &K, const disarray< point_basic< T >, M > &node, const point_basic< T > &x)
bool point_belongs_to_q(const geo_element &K, const disarray< point_basic< T >, M > &node, const point_basic< T > &x)
bool point_belongs_to_T(const geo_element &K, const disarray< point_basic< T >, M > &node, const point_basic< T > &x)
bool point_belongs_to_P(const geo_element &K, const disarray< point_basic< T >, M > &node, const point_basic< T > &x)
bool point_belongs_to_e(const geo_element &K, const disarray< point_basic< T >, M > &node, const point_basic< T > &x)
This file is part of Rheolef.
T orient2d(const point_basic< T > &a, const point_basic< T > &b, const point_basic< T > &c)
T orient3d(const point_basic< T > &a, const point_basic< T > &b, const point_basic< T > &c, const point_basic< T > &d)