16#ifndef Octree_Double_TPP_included
17#define Octree_Double_TPP_included
29template<
typename _SIZE_>
30template<
class _TAB_TYPE_>
32 const double epsilon,
const bool include_virtual)
39 const int dim = coords.dimension_int(1);
41 elements_boxes.
resize(nb_elems, dim * 2, RESIZE_OPTIONS::NOCOPY_NOINIT);
42 for (
int_t i = 0; i < nb_elems; i++)
44 for (
int j = 0; j < dim; j++)
48 for (
int k = 0; k < nb_som_elem; k++)
50 const int_t som = elements(i, k);
51 if (som < 0)
continue;
52 const double x = coords(som, j);
53 xmin = (x<xmin) ? x : xmin;
54 xmax = (x>xmax) ? x : xmax;
56 int pos1 = 0, pos2 = 0;
59 Cerr <<
"Fatal error in octree : integer position outside octree" << finl;
62 elements_boxes(i, j) = pos1;
63 elements_boxes(i, j+dim) = pos2;
75template<
typename _SIZE_>
76template<
class _TAB_TYPE_>
79 const int include_virtual)
82 const int_t nb_som = include_virtual ? coords.dimension_tot(0) : coords.dimension(0);
83 if (nb_som == 0)
return;
85 dim_ = coords.dimension_int(1);
93 for (
int_t i = 0; i < nb_som; i++)
94 for (
int j = 0; j <
dim_; j++)
96 const double x = coords(i, j);
104 for (
int j = 0; j <
dim_; j++)
109 if (xmax[j] - xmin[j] > 0.)
110 factor_[j] = coord_max / (xmax[j] - xmin[j]);
bool integer_position(double x, int direction, int &ix) const
Convertit une coordonnee reelle en coordonnee entiere pour l'octree_int.
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...
Octree_Int_32_64< _SIZE_ > octree_int_
ArrOfDouble_T< _SIZE_ > ArrOfDouble_t
IntTab_T< _SIZE_ > IntTab_t
void build_elements(const _TAB_TYPE_ &coords, const IntTab_t &elements, const double epsilon, const bool include_virtual)
Construit un octree a partir d'elements volumiques decrits par des ensembles de sommets.
static const int coord_max_
static void exit(int exit_code=-1)
Routine de sortie de TRUST dans une region Kokkos.
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