25 #include "rheolef/geo_element_contains.h"
27 namespace rheolef {
namespace details {
29 template <
class T,
class M>
38 return x[0] >= p0[0] && x[0] <= p1[0];
40 template <
class T,
class M>
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;
56 template <
class T,
class M>
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;
74 template <
class T,
class M>
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;
92 template <
class T,
class M>
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;
118 template <
class T,
class M>
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;
142 template <
class T,
class M>
156 default:
error_macro (
"unsupported element type '" << K.
name() <<
"'");
return false;
162 #define _RHEOLEF_instanciation(T,M) \
163 template 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
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 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 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_T(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)
bool point_belongs_to_P(const geo_element &K, const disarray< point_basic< T >, M > &node, const point_basic< T > &x)
_RHEOLEF_instanciation(Float, sequential) _RHEOLEF_instanciation(Float
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)