16#include <Octree_Double.h>
18template <
typename _SIZE_>
33template <
typename _SIZE_>
38 int ix = 0, iy = 0, iz = 0;
42 return ok ?
octree_int_.search_elements(ix, iy, iz, index) : 0;
55template <
typename _SIZE_>
66 Cerr <<
"Internal error in Octree_Double_32_64<_SIZE_>::build_nodes: negative epsilon" << finl;
69 bool have_epsilon = (epsilon != 0.);
71 elements_boxes.
resize(nb_som, have_epsilon ? (dim*2) : dim, RESIZE_OPTIONS::NOCOPY_NOINIT);
73 for (
int_t i = 0; i < nb_som; i++)
74 for (
int j = 0; j < dim; j++)
77 const double x0 = coords(i, j);
78 double x = x0 - epsilon;
81 Cerr <<
"Fatal error in octree : integer position outside octree" << finl;
84 elements_boxes(i, j) = pos1;
88 double xbis = x0 + epsilon;
91 Cerr <<
"Fatal error in octree : integer position outside octree" << finl;
94 elements_boxes(i, dim+j) = pos1;
103template <
typename _SIZE_>
105 double xmax,
double ymax,
double zmax,
108 const int dim =
dim_;
114 int x0 = 0, x1 = 0, y0 = 0, y1 = 0, z0 = 0, z1 = 0;
116 if ((ok) && (dim >= 1))
119 if ((ok) && (dim >= 2))
123 octree_int_.search_elements_box(x0, y0, z0, x1, y1, z1, elements);
132template <
typename _SIZE_>
138 double x = center[0];
139 double y = (dim>=2) ? center[1] : 0.;
140 double z = (dim>2) ? center[2] : 0.;
142 x+radius, y+radius, z+radius,
154template <
typename _SIZE_>
160 double eps2 = epsilon * epsilon;
165 for (
int_t i = 0; i < n; i++)
167 const int_t som = node_list[i];
168 double dx = x - coords(som, 0);
169 double dy = (dim >= 2) ? y - coords(som, 1) : 0.;
170 double dz = (dim >= 3) ? z - coords(som, 2) : 0.;
171 double d2 = dx * dx + dy * dy + dz * dz;
174 node_list[count] = som;
192template <
typename _SIZE_>
199 double y = (dim>=2) ? point[1] : 0.;
200 double z = (dim>2) ? point[2] : 0.;
: Un octree permettant de chercher dans l'espace des elements ou des points decrits par des coordonne...
bool integer_position(double x, int direction, int &ix) const
Convertit une coordonnee reelle en coordonnee entiere pour l'octree_int.
DoubleTab_T< _SIZE_ > DoubleTab_t
void compute_origin_factors(const _TAB_TYPE_ &coords, const double epsilon, const int include_virtual)
methode outil pour build_nodes et build_elements (calcul des facteurs de conversion entre reels et en...
static int_t search_nodes_close_to(double x, double y, double z, const DoubleTab_t &coords, ArrOfInt_t &node_list, double epsilon)
Methode hors classe Cherche parmi les sommets de la liste node_list ceux qui sont a une.
ArrOfInt_T< _SIZE_ > ArrOfInt_t
bool integer_position_clip(double xmin, double xmax, int &x0, int &x1, int direction) const
void build_nodes(const DoubleTab_t &coords, const bool include_virtual, const double epsilon=0.)
construit un octree contenant les points de coordonnees coords.
Octree_Int_32_64< _SIZE_ > octree_int_
int_t search_elements(double x, double y, double z, int_t &index) const
cherche les elements ou les points contenus dans l'octree_floor qui contient le point (x,...
int_t search_elements_box(double xmin, double ymin, double zmin, double xmax, double ymax, double zmax, ArrOfInt_t &elements) const
cherche tous les elements ou points ayant potentiellement une intersection non vide avec la boite don...
IntTab_T< _SIZE_ > IntTab_t
static void exit(int exit_code=-1)
Routine de sortie de TRUST dans une region Kokkos.
_SIZE_ size_array() const
void resize_array(_SIZE_ new_size, RESIZE_OPTIONS opt=RESIZE_OPTIONS::COPY_INIT)
int dimension_int(int d) const
void resize(_SIZE_ n, RESIZE_OPTIONS opt=RESIZE_OPTIONS::COPY_INIT)
_SIZE_ dimension_tot(int) const override
_SIZE_ dimension(int d) const