--- /dev/null
+// ---------------------------------------------------------------------
+//
+// Copyright (C) 2018 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE.md at
+// the top level directory of deal.II.
+//
+// ---------------------------------------------------------------------
+
+#ifndef dealii_boost_adaptor_bounding_box_h
+#define dealii_boost_adaptor_bounding_box_h
+
+#include <deal.II/base/bounding_box.h>
+
+#include <deal.II/boost_adaptors/point.h>
+
+#include <boost/geometry.hpp>
+
+namespace boost
+{
+ namespace geometry
+ {
+ namespace traits
+ {
+ /**
+ * Tag adaptor for dealii::BoundingBox.
+ */
+ template <int dim, class Number>
+ struct tag<dealii::BoundingBox<dim, Number>>
+ {
+ using type = box_tag;
+ };
+
+ /**
+ * Point type adaptor for dealii::BoundingBox.
+ */
+ template <int dim, class Number>
+ struct point_type<dealii::BoundingBox<dim, Number>>
+ {
+ using type = dealii::Point<dim, Number>;
+ };
+
+ /**
+ * Access to the D-th coordinate of the lower left corner of a
+ * dealii::BoundingBox.
+ */
+ template <int dim, class Number, size_t D>
+ struct indexed_access<dealii::BoundingBox<dim, Number>, min_corner, D>
+ {
+ /**
+ * Getter function for the D-th coordinate of the lower left corner of
+ * a dealii::BoundingBox.
+ */
+ static inline double
+ get(dealii::BoundingBox<dim, Number> const &box)
+ {
+ return box.get_boundary_points().first[D];
+ }
+
+ /**
+ * Setter function for the D-th coordinate of the lower left corner of
+ * a dealii::BoundingBox.
+ */
+ static inline void
+ set(dealii::BoundingBox<dim, Number> &box, Number value)
+ {
+ box.get_boundary_points().first[D] = value;
+ }
+ };
+
+ /**
+ * Access to the D-th coordinate of the upper right corner of a
+ * dealii::BoundingBox.
+ */
+ template <int dim, class Number, size_t D>
+ struct indexed_access<dealii::BoundingBox<dim, Number>, max_corner, D>
+ {
+ /**
+ * Getter function for the D-th coordinate of the upper right corner of
+ * a dealii::BoundingBox.
+ */
+ static inline double
+ get(dealii::BoundingBox<dim, Number> const &box)
+ {
+ return box.get_boundary_points().second[D];
+ }
+
+ /**
+ * Setter function for the D-th coordinate of the upper right corner of
+ * a dealii::BoundingBox.
+ */
+ static inline void
+ set(dealii::BoundingBox<dim, Number> &box, Number value)
+ {
+ box.get_boundary_points().second[D] = value;
+ }
+ };
+ } // namespace traits
+ } // namespace geometry
+} // namespace boost
+
+#endif
--- /dev/null
+// ---------------------------------------------------------------------
+//
+// Copyright (C) 2018 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE.md at
+// the top level directory of deal.II.
+//
+// ---------------------------------------------------------------------
+
+// Check that boost adaptors for bounding boxes work
+
+#include <deal.II/boost_adaptors/bounding_box.h>
+
+#include "../tests.h"
+
+namespace bg = boost::geometry;
+
+using bgPoint = bg::model::point<double, 3, bg::cs::cartesian>;
+using bgBox = bg::model::box<bgPoint>;
+
+int
+main(int argc, char **argv)
+{
+ initlog();
+
+ Point<3> p1;
+ Point<3> p2(1, 2, 3);
+
+ BoundingBox<3> box({p1, p2});
+
+ bgBox boost_box(bgPoint(0, 0, 0), bgPoint(1, 2, 3));
+
+ if (bg::equals(boost_box, box) == false)
+ deallog << "NOT OK" << std::endl;
+ else
+ deallog << "OK" << std::endl;
+}