|
TrioCFD 1.9.9_beta
TrioCFD documentation
|
: An octree allowing to search in space for elements or points described by real-valued coordinates. More...
#include <Octree_Double.h>
Public Types | |
| using | int_t = _SIZE_ |
| using | ArrOfInt_t = ArrOfInt_T<_SIZE_> |
| using | IntTab_t = IntTab_T<_SIZE_> |
| using | ArrOfDouble_t = ArrOfDouble_T<_SIZE_> |
| using | DoubleTab_t = DoubleTab_T<_SIZE_> |
Public Member Functions | |
| void | reset () |
| template<class _TAB_TYPE_> | |
| void | build_elements (const _TAB_TYPE_ &coords, const IntTab_t &elements, const double epsilon, const bool include_virtual) |
| Builds an octree from volumetric elements described by sets of vertices. | |
| void | build_nodes (const DoubleTab_t &coords, const bool include_virtual, const double epsilon=0.) |
| builds an octree containing the points with coordinates coords. | |
| int_t | search_elements (double x, double y, double z, int_t &index) const |
| searches for the elements or points contained in the octree_floor that contains the point (x,y,z). | |
| int_t | search_elements_box (double xmin, double ymin, double zmin, double xmax, double ymax, double zmax, ArrOfInt_t &elements) const |
| searches for all elements or points potentially having a non-empty intersection with the given box. | |
| int_t | search_elements_box (const ArrOfDouble ¢er, const double radius, ArrOfInt_t &elements) const |
| Searches for all elements or points potentially having a non-empty intersection with the given box (center +/- radius in each direction). | |
| int | dimension () const |
| const ArrOfInt_t & | floor_elements () const |
Static Public Member Functions | |
| static int_t | search_nodes_close_to (double x, double y, double z, const DoubleTab_t &coords, ArrOfInt_t &node_list, double epsilon) |
| Non-member method. Searches among the vertices in node_list for those within a distance. | |
| static int_t | search_nodes_close_to (const ArrOfDouble &point, const DoubleTab_t &coords, ArrOfInt_t &node_list, double epsilon) |
| Same as search_nodes_close_to(double x, double y, double z, ...). | |
Protected Member Functions | |
| bool | integer_position (double x, int direction, int &ix) const |
| Converts a real coordinate to an integer coordinate for the octree_int. | |
| bool | integer_position_clip (double xmin, double xmax, int &x0, int &x1, int direction) const |
| template<class _TAB_TYPE_> | |
| void | compute_origin_factors (const _TAB_TYPE_ &coords, const double epsilon, const int include_virtual) |
| Helper method for build_nodes and build_elements: computes the conversion factors from real to integer coordinates for Octree_Int. | |
Protected Attributes | |
| Octree_Int_32_64< _SIZE_ > | octree_int_ |
| ArrOfDouble | origin_ |
| ArrOfDouble | factor_ |
| int | dim_ = 0 |
: An octree allowing to search in space for elements or points described by real-valued coordinates.
This object is based on Octree_Int. Tips: To search for points up to epsilon tolerance one can do: 1) build_nodes(coord, include_virt, 0.) followed by search_elements_box(center, epsilon, elements);
2) build_nodes(coord, include_virt, epsilon) followed by search_elements(x,y,z,...) The first solution takes more time to build the octree but the search is faster. The second is the reverse... and one can choose epsilon for each point.
Definition at line 39 of file Octree_Double.h.
| using Octree_Double_32_64< _SIZE_ >::ArrOfDouble_t = ArrOfDouble_T<_SIZE_> |
Definition at line 45 of file Octree_Double.h.
| using Octree_Double_32_64< _SIZE_ >::ArrOfInt_t = ArrOfInt_T<_SIZE_> |
Definition at line 43 of file Octree_Double.h.
| using Octree_Double_32_64< _SIZE_ >::DoubleTab_t = DoubleTab_T<_SIZE_> |
Definition at line 46 of file Octree_Double.h.
| using Octree_Double_32_64< _SIZE_ >::int_t = _SIZE_ |
Definition at line 42 of file Octree_Double.h.
| using Octree_Double_32_64< _SIZE_ >::IntTab_t = IntTab_T<_SIZE_> |
Definition at line 44 of file Octree_Double.h.
| void Octree_Double_32_64< _SIZE_ >::build_elements | ( | const _TAB_TYPE_ & | coords, |
| const IntTab_t & | elements, | ||
| const double | epsilon, | ||
| const bool | include_virtual ) |
Builds an octree from volumetric elements described by sets of vertices.
Stores in the octree the bounding parallelepipeds of each element (containing all vertices of the element) plus a margin of epsilon. If include_virtual=1, stores elements.dimension_tot(0) elements, otherwise stores elements.dimension(0).
Templated because the float version is needed for lata tools.
Definition at line 31 of file Octree_Double.tpp.
| void Octree_Double_32_64< _SIZE_ >::build_nodes | ( | const DoubleTab_t & | coords, |
| const bool | include_virtual, | ||
| const double | epsilon = 0. ) |
builds an octree containing the points with coordinates coords.
If include_virtual=1, stores coords.dimension_tot(0) elements, otherwise stores coords.dimension(0) elements. If epsilon = 0, builds an octree of zero-size points (each point is in a single octree_floor). Otherwise, builds an octree of cubic elements centered on the coords, with half-width epsilon. A point can then be found in several octree_floors.
Definition at line 56 of file Octree_Double.cpp.
|
protected |
Helper method for build_nodes and build_elements: computes the conversion factors from real to integer coordinates for Octree_Int.
epsilon is added to the min and max coordinates for the octree bounding box.
Templated because the float version is needed for lata tools.
Definition at line 77 of file Octree_Double.tpp.
|
inline |
Definition at line 59 of file Octree_Double.h.
|
inline |
Definition at line 64 of file Octree_Double.h.
|
inlineprotected |
Converts a real coordinate to an integer coordinate for the octree_int.
Return value: 1 if ok, 0 if coordinate is outside the octree
Definition at line 86 of file Octree_Double.h.
|
inlineprotected |
Definition at line 103 of file Octree_Double.h.
| void Octree_Double_32_64< _SIZE_ >::reset | ( | ) |
Definition at line 19 of file Octree_Double.cpp.
| Octree_Double_32_64< _SIZE_ >::int_t Octree_Double_32_64< _SIZE_ >::search_elements | ( | double | x, |
| double | y, | ||
| double | z, | ||
| int_t & | index ) const |
searches for the elements or points contained in the octree_floor that contains the point (x,y,z).
Returns the number n of these elements. The indices of the elements are in floor_elements()[index+i] for 0 <= i < n
Definition at line 34 of file Octree_Double.cpp.
| Octree_Double_32_64< _SIZE_ >::int_t Octree_Double_32_64< _SIZE_ >::search_elements_box | ( | const ArrOfDouble & | center, |
| const double | radius, | ||
| ArrOfInt_t & | elements ) const |
Searches for all elements or points potentially having a non-empty intersection with the given box (center +/- radius in each direction).
| center | Center of the box. |
| radius | Half-width of the box in each direction. |
| elements | Array filled with the indices of the matching elements. |
Definition at line 138 of file Octree_Double.cpp.
| Octree_Double_32_64< _SIZE_ >::int_t Octree_Double_32_64< _SIZE_ >::search_elements_box | ( | double | xmin, |
| double | ymin, | ||
| double | zmin, | ||
| double | xmax, | ||
| double | ymax, | ||
| double | zmax, | ||
| ArrOfInt_t & | elements ) const |
searches for all elements or points potentially having a non-empty intersection with the given box.
Definition at line 104 of file Octree_Double.cpp.
|
static |
Same as search_nodes_close_to(double x, double y, double z, ...).
Definition at line 195 of file Octree_Double.cpp.
|
static |
Non-member method. Searches among the vertices in node_list for those within a distance.
less than epsilon from the point (x,y,z). node_list contains indices of vertices in the coords array. The list of nodes satisfying the criterion is placed in node_list. Returns the index in the coords array of the nearest vertex.
Definition at line 159 of file Octree_Double.cpp.
|
protected |
Definition at line 76 of file Octree_Double.h.
|
protected |
Definition at line 75 of file Octree_Double.h.
|
protected |
Definition at line 73 of file Octree_Double.h.
|
protected |
Definition at line 75 of file Octree_Double.h.