]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Add warning to pack_rtree_of_indices() 14976/head
authorPeter Munch <peterrmuench@gmail.com>
Fri, 24 Mar 2023 21:08:22 +0000 (22:08 +0100)
committerPeter Munch <peterrmuench@gmail.com>
Mon, 31 Jul 2023 19:22:07 +0000 (21:22 +0200)
include/deal.II/numerics/rtree.h

index 6a561182539131a4e177101d6a2bf0e18a1892bd..596f50da4ea7374efe442d3a306d99dba9491a07 100644 (file)
@@ -271,6 +271,30 @@ private:
  * the container. A reference to the external container is stored internally,
  * but keep in mind that if you change the container, you should rebuild the
  * tree.
+ *
+ * @warning This function does not work on Windows. As an alternative,
+ * build a tree with pairs of point and id. For instance to
+ * create an intersection between `BoundingBox<dim> box` and
+ * `std::vector<BoundingBox<dim>> boxes`, don't write:
+ * @code
+ * const auto tree = pack_rtree_of_indices(boxes);
+ *
+ * for (const auto &i : tree | bgi::adaptors::queried(bgi::intersects(box)))
+ *   std::cout << i << " " << boxes[i] << std::endl;
+ * @endcode
+ * but instead:
+ * @code
+ * std::vector<std::pair<BoundingBox<dim>, unsigned int>> boxes_and_ids;
+ *
+ * for(unsigned int i = 0; i < boxes.size(); ++i)
+ *   boxes_and_ids.emplace_back(boxes[i], i);
+ *
+ * const auto tree = pack_rtree(boxes_and_ids);
+ *
+ * for (const auto &i : tree | bgi::adaptors::queried(bgi::intersects(box)))
+ *   std::cout << i->second << " " << boxes[i->second] << std::endl;
+ * @endcode
+ *
  */
 template <typename IndexType = boost::geometry::index::linear<16>,
           typename ContainerType>

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.