]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Remove our deprecated nanoflann bindings 10386/head
authorDavid Wells <drwells@email.unc.edu>
Wed, 27 May 2020 14:54:45 +0000 (10:54 -0400)
committerDavid Wells <drwells@email.unc.edu>
Wed, 27 May 2020 14:54:45 +0000 (10:54 -0400)
22 files changed:
cmake/configure/configure_nanoflann.cmake [deleted file]
cmake/modules/FindNANOFLANN.cmake [deleted file]
doc/doxygen/options.dox.in
doc/news/changes/incompatibilities/20200527DavidWells [new file with mode: 0644]
doc/readme.html
doc/users/cmake_dealii.html
doc/users/cmake_user.html
include/deal.II/base/config.h.in
include/deal.II/grid/grid_tools_cache.h
include/deal.II/grid/grid_tools_cache_update_flags.h
include/deal.II/numerics/kdtree.h [deleted file]
source/grid/grid_tools_cache.cc
source/numerics/CMakeLists.txt
source/numerics/kdtree.cc [deleted file]
tests/numerics/kdtree_01.cc [deleted file]
tests/numerics/kdtree_01.with_nanoflann=true.output [deleted file]
tests/numerics/kdtree_02.cc [deleted file]
tests/numerics/kdtree_02.with_nanoflann=true.output [deleted file]
tests/numerics/kdtree_03.cc [deleted file]
tests/numerics/kdtree_03.with_nanoflann=true.output [deleted file]
tests/quick_tests/CMakeLists.txt
tests/quick_tests/nanoflann.cc [deleted file]

diff --git a/cmake/configure/configure_nanoflann.cmake b/cmake/configure/configure_nanoflann.cmake
deleted file mode 100644 (file)
index d36d216..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-## ---------------------------------------------------------------------
-##
-## Copyright (C) 2017 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.
-##
-## ---------------------------------------------------------------------
-
-#
-# Configuration for the nanoflann library:
-#
-
-CONFIGURE_FEATURE(NANOFLANN)
diff --git a/cmake/modules/FindNANOFLANN.cmake b/cmake/modules/FindNANOFLANN.cmake
deleted file mode 100644 (file)
index 8191b99..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-## ---------------------------------------------------------------------
-##
-## Copyright (C) 2017 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.
-##
-## ---------------------------------------------------------------------
-
-#
-# Try to find the NANOFLANN library
-#
-# This module exports
-#
-#   NANOFLANN_INCLUDE_DIRS
-#
-
-SET(NANOFLANN_DIR "" CACHE PATH "An optional hint to a NANOFLANN installation")
-SET_IF_EMPTY(NANOFLANN_DIR "$ENV{NANOFLANN_DIR}")
-
-DEAL_II_FIND_PATH(NANOFLANN_INCLUDE_DIR nanoflann.hpp
-  HINTS ${NANOFLANN_DIR}
-  PATH_SUFFIXES include
-  )
-
-DEAL_II_PACKAGE_HANDLE(NANOFLANN
-  INCLUDE_DIRS REQUIRED NANOFLANN_INCLUDE_DIR
-  USER_INCLUDE_DIRS REQUIRED NANOFLANN_INCLUDE_DIR
-  CLEAR
-    NANOFLANN_INCLUDE_DIR 
-  )
index 1d65cb36d668f16fda5c7539b97ad9b46de09f32..642b2cda14923e9dd5c0823294154d26316d5ad9 100644 (file)
@@ -206,7 +206,6 @@ PREDEFINED             = DOXYGEN=1 \
                          DEAL_II_MPI_VERSION_MAJOR=3 \
                          DEAL_II_MPI_VERSION_MINOR=0 \
                          DEAL_II_WITH_MUPARSER=1 \
-                         DEAL_II_WITH_NANOFLANN=1 \
                          DEAL_II_WITH_NETCDF=1 \
                          DEAL_II_WITH_OPENCASCADE=1 \
                          DEAL_II_WITH_P4EST=1 \
diff --git a/doc/news/changes/incompatibilities/20200527DavidWells b/doc/news/changes/incompatibilities/20200527DavidWells
new file mode 100644 (file)
index 0000000..6121c39
--- /dev/null
@@ -0,0 +1,3 @@
+Removed: The deprecated bindings to nanoflann have been removed.
+<br>
+(David Wells, 2020/05/27)
index db44b08335723b622f0aa311dfa2648dc3ea0d8f..b37052d0e784337c1fff054987c174c09984f7b5 100644 (file)
                 </p>
             </dd>
 
-            <dt><a name="nanoflann"/>
-             <a href="https://github.com/jlblancoc/nanoflann" target="_top">nanoflann</a></dt>
-            <dd>
-                <p>
-                    <a href="https://github.com/jlblancoc/nanoflann" target="_top">nanoflann</a> is a C++11 header-only library for building KD-Trees of datasets with different topologies. In particular, it can be used for operations such as finding the
-                    vertex or cell closest to a given evaluation point that occur frequently in many applications using unstructured meshes. scale eigenvalue problems.
-                    <a href="https://github.com/jlblancoc/nanoflann" target="_top">nanoflann</a> should be readily packaged by most Linux distributions. To use a self compiled version, pass
-                    <code>-DNANOFLANN_DIR=/path/to/nanoflann</code> to the deal.II CMake call.
-                </p>
-            </dd>
-
             <dt><a name="netcdf"></a><a href="http://www.unidata.ucar.edu/software/netcdf/" target="_top">NetCDF</a></dt>
             <dd>
                 <p>
index c91e866900e358d672af1de740fe0d2dbde1446b..11088c15b099bc5354460721e66ffb3703c911ee 100644 (file)
@@ -466,7 +466,6 @@ DEAL_II_WITH_LAPACK
 DEAL_II_WITH_METIS
 DEAL_II_WITH_MPI
 DEAL_II_WITH_MUPARSER
-DEAL_II_WITH_NANOFLANN
 DEAL_II_WITH_NETCDF
 DEAL_II_WITH_OPENCASCADE
 DEAL_II_WITH_P4EST
index f087f008408db1a1d6c6ea73552572a429b05c1d..da78db4d29a48d9a37c19ad05d85d5b33b90e097 100644 (file)
@@ -856,7 +856,6 @@ DEAL_II_WITH_LAPACK
 DEAL_II_WITH_METIS
 DEAL_II_WITH_MPI
 DEAL_II_WITH_MUPARSER
-DEAL_II_WITH_NANOFLANN
 DEAL_II_WITH_NETCDF
 DEAL_II_WITH_OPENCASCADE
 DEAL_II_WITH_P4EST
index e31b71df5f0e0bd8248ae958dd31a6380888c591..bb96f7fe2f1e41a8fe89133662ce815ac99fdcad 100644 (file)
@@ -51,7 +51,6 @@
 #cmakedefine DEAL_II_WITH_METIS
 #cmakedefine DEAL_II_WITH_MPI
 #cmakedefine DEAL_II_WITH_MUPARSER
-#cmakedefine DEAL_II_WITH_NANOFLANN
 #cmakedefine DEAL_II_WITH_NETCDF
 #cmakedefine DEAL_II_WITH_OPENCASCADE
 #cmakedefine DEAL_II_WITH_P4EST
index 75204a92a106a050ac1e96a3e3ef0e71d01f8ad9..d592924ec26e0b9316639bceba63c5f980ab3f68 100644 (file)
@@ -30,7 +30,6 @@
 #include <deal.II/grid/tria_accessor.h>
 #include <deal.II/grid/tria_iterator.h>
 
-#include <deal.II/numerics/kdtree.h>
 #include <deal.II/numerics/rtree.h>
 
 #include <boost/signals2.hpp>
@@ -177,15 +176,6 @@ namespace GridTools
     const RTree<std::pair<BoundingBox<spacedim>, unsigned int>> &
     get_covering_rtree() const;
 
-#ifdef DEAL_II_WITH_NANOFLANN
-    /**
-     * Return the cached vertex_kdtree object, constructed with the vertices of
-     * the stored triangulation.
-     */
-    const KDTree<spacedim> &
-    get_vertex_kdtree() const;
-#endif
-
   private:
     /**
      * Keep track of what needs to be updated next.
@@ -224,13 +214,6 @@ namespace GridTools
     mutable RTree<std::pair<BoundingBox<spacedim>, unsigned int>>
       covering_rtree;
 
-#ifdef DEAL_II_WITH_NANOFLANN
-    /**
-     * A KDTree object constructed with the vertices of the triangulation.
-     */
-    mutable KDTree<spacedim> vertex_kdtree;
-#endif
-
     /**
      * Store the used vertices of the Triangulation, as generated by
      * GridTools::extract_used_vertices().
index 2c8c32578f810b72f255b53bfd7188a6f2a70232..323c6157056843e3b6375f9bdad26aedf5b21f04 100644 (file)
@@ -52,12 +52,6 @@ namespace GridTools
     update_vertex_to_cell_centers_directions =
       update_vertex_to_cell_map | 0x002,
 
-    /**
-     * Update a KDTree object, initialized with the vertices of the
-     * Triangulation.
-     */
-    update_vertex_kdtree = 0x004,
-
     /**
      * Update a mapping of used vertices.
      */
@@ -106,10 +100,6 @@ namespace GridTools
       s << "|vertex_to_cells_centers_directions";
     if (u & update_covering_rtree)
       s << "|covering_rtree";
-#ifdef DEAL_II_WITH_NANOFLANN
-    if (u & update_vertex_kdtree)
-      s << "|vertex_kdtree";
-#endif
     return s;
   }
 
diff --git a/include/deal.II/numerics/kdtree.h b/include/deal.II/numerics/kdtree.h
deleted file mode 100644 (file)
index 2649b21..0000000
+++ /dev/null
@@ -1,331 +0,0 @@
-// ---------------------------------------------------------------------
-//
-// Copyright (C) 2017 - 2019 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_numerics_kdtree_h
-#define dealii_numerics_kdtree_h
-
-#include <deal.II/base/config.h>
-
-#ifdef DEAL_II_WITH_NANOFLANN
-
-#  include <deal.II/base/point.h>
-
-#  include <nanoflann.hpp>
-
-#  include <memory>
-
-
-DEAL_II_NAMESPACE_OPEN
-
-/**
- * A wrapper for the nanoflann library, used to compute the distance from a
- * collection of points, and to efficiently return nearest neighbors to a
- * target point. This class uses nanoflann to efficiently partition the
- * space in a $k$-dimensional tree. The cost of each query is then roughly of
- * order $\log(n)$, where $n$ is the number of points stored in this class.
- *
- * The wrapper provides methods that give access to some of the functionalities
- * of the nanoflann library, like searching the $p$ nearest neighbors of a given
- * point, or searching the points that fall within a radius of a target point.
- *
- * > From wikipedia (https://en.wikipedia.org/wiki/K-d_tree):
- * >
- * > A k-d tree is a binary tree in which every node is a $k$-dimensional point.
- * > Every non-leaf node can be thought of as implicitly generating a splitting
- * > hyperplane that divides the space into two parts, known as half-spaces.
- * > Points to the left of this hyperplane are represented by the left subtree
- * > of that node and points right of the hyperplane are represented by the
- * > right subtree. The hyperplane direction is chosen in the following way:
- * > every node in the tree is associated with one of the $k$-dimensions, with
- * > the hyperplane perpendicular to that dimension's axis. So, for example, if
- * > for a particular split the "x" axis is chosen, all points in the subtree
- * > with a smaller "x" value than the node will appear in the left subtree and
- * > all points with larger "x" value will be in the right subtree. In such a
- * > case, the hyperplane would be set by the $x$-value of the point, and its
- * > normal would be the unit $x$-axis.
- *
- * @deprecated This class has been deprecated in favor of RTree, which is
- * based on <code>boost::geometry::index::rtree</code>.
- *
- * @author Luca Heltai, 2017.
- */
-template <int dim>
-class DEAL_II_DEPRECATED KDTree
-{
-public:
-  /**
-   * Constructor.
-   *
-   * @param[in] max_leaf_size A number denoting how many points per leaf
-   * are used in the kdtree algorithm.
-   *
-   * @param[in] pts A vector of points that are to be represented by the current
-   * object. If no points are passed to this constructor (or if the default
-   * value of the argument is used), then you have to pass them later to this
-   * object by calling the set_points() method.
-   *
-   * Access to any of the methods without first passing a reference to a vector
-   * of points will result in an exception. Only a reference to the points is
-   * stored, so you should make sure that the life of the vector you pass is
-   * longer than the life of this class, or you will get undefined behaviour.
-   *
-   * @warning If you change the contents of the vector of points that you passed
-   * either to the constructor or to set_points(), remember to call the
-   * set_points() method again. The tree and the index are constructed only once
-   * when you pass the points (either at construction time, or when you call
-   * set_points()). If you update your points, and do not call set_points()
-   * again, then all following results will likely be wrong.
-   */
-  KDTree(const unsigned int             max_leaf_size = 10,
-         const std::vector<Point<dim>> &pts           = {});
-
-
-  /**
-   * Adaptor class used internally by nanoflann. This class stores a reference
-   * to the vector of points, and generates some helper functions for nanoflann.
-   */
-  struct PointCloudAdaptor
-  {
-    /**
-     * An alias used by nanoflann.
-     */
-    using coord_t = double;
-
-
-    /**
-     * Reference to the vector of points from which we want to compute
-     * the distance.
-     */
-    const std::vector<Point<dim>> &points;
-
-
-    /**
-     * The constructor needs the vector of points from which we want to build
-     * the tree.
-     */
-    PointCloudAdaptor(const std::vector<Point<dim>> &_points);
-
-
-    /**
-     * Return number of points in the data set (required by nanoflann).
-     */
-    size_t
-    kdtree_get_point_count() const;
-
-
-    /**
-     * Return the L2 distance between points
-     */
-    coord_t
-    kdtree_distance(const coord_t *   p1,
-                    const std::size_t idx_p2,
-                    const std::size_t size) const;
-
-
-    /**
-     * Return the d-th component of the idx-th point in the class.
-     */
-    coord_t
-    kdtree_get_pt(const std::size_t idx, const int d) const;
-
-
-    /**
-     * Optional bounding-box computation: return false to default to a
-     * standard bbox computation loop. Return true if the BBOX was
-     * already computed by the class and returned in "bb" so it can be
-     * avoided to redo it again. Look at bb.size() to find out the
-     * expected dimensionality (e.g. 2 or 3 for point clouds).
-     */
-    template <class BBOX>
-    bool
-    kdtree_get_bbox(BBOX &) const;
-  };
-
-
-  /**
-   * An alias for the actual KDTree object.
-   */
-  using NanoFlannKDTree = typename nanoflann::KDTreeSingleIndexAdaptor<
-    nanoflann::L2_Simple_Adaptor<double, PointCloudAdaptor>,
-    PointCloudAdaptor,
-    dim,
-    unsigned int>;
-
-
-  /**
-   * Store a reference to the passed points. After you called this method, you
-   * can call the value() method to compute the minimum distance between an
-   * evaluation point and the collection of points you passed to this method, or
-   * the get_points_within_ball() and the get_closest_points() methods.
-   *
-   * Notice that the constructor calls this method internally if you
-   * pass it a non-empty vector of points.
-   *
-   * Whenever your points change, you should call this method again,
-   * since this is the method responsible for building the index and
-   * storing the actual tree internally. If you change your points and
-   * don't call again this method, any function you call later will
-   * happily return wrong values without you noticing.
-   *
-   * @param[in] pts A collection of points
-   */
-  void
-  set_points(const std::vector<Point<dim>> &pts);
-
-
-  /**
-   * A const accessor to the @p i'th one among the underlying points.
-   */
-  const Point<dim> &operator[](const unsigned int i) const;
-
-
-  /**
-   * The number of points currently stored by this class.
-   */
-  unsigned int
-  size() const;
-
-
-  /**
-   * Fill and return a vector with the indices and the distance of the points
-   * that are at distance less than or equal to the given radius from
-   * the target point.
-   *
-   * @param[in] target The target point
-   * @param[in] radius The radius of the ball
-   * @param[in] sorted If @p true, sort the output results in ascending order
-   * with respect to distance
-   *
-   * @return A vector of indices and distances to @p target
-   * of the matching points
-   */
-  std::vector<std::pair<unsigned int, double>>
-  get_points_within_ball(const Point<dim> &target,
-                         const double      radius,
-                         const bool        sorted = false) const;
-
-  /**
-   * Fill and return a vector with the indices and distances of the closest
-   * @p n_points points to the given target point.
-   *
-   * @param[in] target The target point
-   * @param[in] n_points The number of requested points
-   *
-   * @return A vector of pairs of indices and distances of the matching points
-   */
-  std::vector<std::pair<unsigned int, double>>
-  get_closest_points(const Point<dim> & target,
-                     const unsigned int n_points) const;
-
-private:
-  /**
-   * Max number of points per leaf as set in the constructor.
-   */
-  const unsigned int max_leaf_size;
-
-
-  /**
-   * A point cloud adaptor, to be filled when set points is called.
-   */
-  std::unique_ptr<PointCloudAdaptor> adaptor;
-
-
-  /**
-   * The actual kdtree.
-   */
-  std::unique_ptr<NanoFlannKDTree> kdtree;
-};
-
-
-//------------ inline functions -------------
-#  ifndef DOXYGEN
-
-template <int dim>
-inline unsigned int
-KDTree<dim>::size() const
-{
-  if (adaptor)
-    return adaptor->points.size();
-  else
-    return 0;
-}
-
-
-
-template <int dim>
-inline const Point<dim> &KDTree<dim>::operator[](const unsigned int i) const
-{
-  AssertIndexRange(i, size());
-  return adaptor->points[i];
-}
-
-
-
-template <int dim>
-KDTree<dim>::PointCloudAdaptor::PointCloudAdaptor(
-  const std::vector<Point<dim>> &_points)
-  : points(_points)
-{}
-
-
-
-template <int dim>
-inline size_t
-KDTree<dim>::PointCloudAdaptor::kdtree_get_point_count() const
-{
-  return points.size();
-}
-
-
-
-template <int dim>
-inline double
-KDTree<dim>::PointCloudAdaptor::kdtree_get_pt(const std::size_t idx,
-                                              int               d) const
-{
-  AssertIndexRange(d, dim);
-  return points[idx][d];
-}
-
-
-
-template <int dim>
-template <class BBOX>
-inline bool
-KDTree<dim>::PointCloudAdaptor::kdtree_get_bbox(BBOX &) const
-{
-  return false;
-}
-
-
-
-template <int dim>
-inline double
-KDTree<dim>::PointCloudAdaptor::kdtree_distance(const double *    p1,
-                                                const std::size_t idx_p2,
-                                                const std::size_t size) const
-{
-  AssertDimension(size, dim);
-  double res = 0.0;
-  for (std::size_t d = 0; d < size; ++d)
-    res += (p1[d] - points[idx_p2][d]) * (p1[d] - points[idx_p2][d]);
-  return std::sqrt(res);
-}
-#  endif
-
-DEAL_II_NAMESPACE_CLOSE
-
-#endif // DEAL_II_WITH_NANO_FLANN
-#endif
index f9a80058068c39ef47458349fa87c601966881f8..22e8796b5ddd35d73b3e4d9c7e69b37e183362c0 100644 (file)
@@ -142,21 +142,6 @@ namespace GridTools
   }
 
 
-#ifdef DEAL_II_WITH_NANOFLANN
-  template <int dim, int spacedim>
-  const KDTree<spacedim> &
-  Cache<dim, spacedim>::get_vertex_kdtree() const
-  {
-    if (update_flags & update_vertex_kdtree)
-      {
-        vertex_kdtree.set_points(tria->get_vertices());
-        update_flags = update_flags & ~update_vertex_kdtree;
-      }
-    return vertex_kdtree;
-  }
-#endif
-
-
 
   template <int dim, int spacedim>
   const RTree<std::pair<BoundingBox<spacedim>, unsigned int>> &
index 7ae55dc1ba9db03f2cbe7841b5f754a2c58420ba..b0f86d4c1e1ab704307a4654dfe6734c1833eeb1 100644 (file)
@@ -23,7 +23,6 @@ SET(_unity_include_src
   data_postprocessor.cc
   dof_output_operator.cc
   histogram.cc
-  kdtree.cc
   matrix_tools_once.cc
   matrix_tools.cc
   time_dependent.cc
diff --git a/source/numerics/kdtree.cc b/source/numerics/kdtree.cc
deleted file mode 100644 (file)
index 43d4952..0000000
+++ /dev/null
@@ -1,117 +0,0 @@
-// ---------------------------------------------------------------------
-//
-// Copyright (C) 2017 - 2019 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.
-//
-// ---------------------------------------------------------------------
-
-#include <deal.II/numerics/kdtree.h>
-
-#ifdef DEAL_II_WITH_NANOFLANN
-
-#  include <memory>
-
-DEAL_II_NAMESPACE_OPEN
-
-
-template <int dim>
-KDTree<dim>::KDTree(const unsigned int             max_leaf_size,
-                    const std::vector<Point<dim>> &pts)
-  : max_leaf_size(max_leaf_size)
-{
-  if (pts.size() > 0)
-    set_points(pts);
-}
-
-
-
-template <int dim>
-std::vector<std::pair<unsigned int, double>>
-KDTree<dim>::get_points_within_ball(const Point<dim> &center,
-                                    const double      radius,
-                                    bool              sorted) const
-{
-  Assert(adaptor, ExcNotInitialized());
-  Assert(kdtree, ExcInternalError());
-
-  Assert(radius > 0, ExcMessage("Radius is expected to be positive."));
-
-  nanoflann::SearchParams params;
-  params.sorted = sorted;
-
-  std::vector<std::pair<unsigned int, double>> matches;
-#  if NANOFLANN_VERSION < 0x130
-  kdtree->radiusSearch(center.begin_raw(), radius, matches, params);
-#  else
-  // nanoflann 1.3 performs distance comparisons with squared distances, so
-  // square the radius before we query and square root after:
-  kdtree->radiusSearch(center.begin_raw(), radius * radius, matches, params);
-  for (std::pair<unsigned int, double> &match : matches)
-    match.second = std::sqrt(match.second);
-#  endif
-
-  return matches;
-}
-
-
-
-template <int dim>
-std::vector<std::pair<unsigned int, double>>
-KDTree<dim>::get_closest_points(const Point<dim> & target,
-                                const unsigned int n_points) const
-{
-  Assert(adaptor, ExcNotInitialized());
-  Assert(kdtree, ExcInternalError());
-
-  // get the information out of nanoflann
-  std::vector<unsigned int> indices(n_points);
-  std::vector<double>       distances(n_points);
-
-  kdtree->knnSearch(target.begin_raw(),
-                    n_points,
-                    indices.data(),
-                    distances.data());
-
-  // convert it to the format we want to return
-  std::vector<std::pair<unsigned int, double>> matches(n_points);
-  for (unsigned int i = 0; i < n_points; ++i)
-#  if NANOFLANN_VERSION < 0x130
-    matches[i] = std::make_pair(indices[i], distances[i]);
-#  else
-    // nanoflann 1.3 performs distance comparisons with squared distances, so
-    // take a square root:
-    matches[i] = std::make_pair(indices[i], std::sqrt(distances[i]));
-#  endif
-
-  return matches;
-}
-
-
-
-template <int dim>
-void
-KDTree<dim>::set_points(const std::vector<Point<dim>> &pts)
-{
-  Assert(pts.size() > 0, ExcMessage("Expecting a non zero set of points."));
-  adaptor = std::make_unique<PointCloudAdaptor>(pts);
-  kdtree  = std::make_unique<NanoFlannKDTree>(
-    dim, *adaptor, nanoflann::KDTreeSingleIndexAdaptorParams(max_leaf_size));
-  kdtree->buildIndex();
-}
-
-
-template class KDTree<1>;
-template class KDTree<2>;
-template class KDTree<3>;
-
-DEAL_II_NAMESPACE_CLOSE
-
-#endif
diff --git a/tests/numerics/kdtree_01.cc b/tests/numerics/kdtree_01.cc
deleted file mode 100644 (file)
index 1d54ddd..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-// ---------------------------------------------------------------------
-//
-// Copyright (C) 2017 - 2019 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.
-//
-//---------------------------------------------------------------------
-
-// Create a list of points, and compute the minimum distance from some other
-// points to this set, using a kdtree library
-
-#include <deal.II/numerics/kdtree.h>
-
-#include "../tests.h"
-
-
-int
-main()
-{
-  initlog();
-
-  KDTree<2> kdtree;
-
-  std::vector<Point<2>> points;
-
-  // Add four points
-  points.push_back(Point<2>(0, 0));
-  points.push_back(Point<2>(0, 1));
-  points.push_back(Point<2>(1, 0));
-  points.push_back(Point<2>(1, 1));
-
-  deallog << "Distance from unit square:" << std::endl;
-
-  std::vector<Point<2>> test_points;
-  test_points.push_back(Point<2>(.5, .5));
-  test_points.push_back(Point<2>(2, 0));
-  test_points.push_back(Point<2>(2, 2));
-
-  kdtree.set_points(points);
-
-  for (auto &p : test_points)
-    {
-      auto res = kdtree.get_closest_points(p, 1)[0];
-      deallog << "P: " << p << ", distance: " << res.second
-              << ", index: " << res.first << std::endl;
-      AssertThrow(std::abs(points[res.first].distance(p) - res.second) < 1e-10,
-                  ExcInternalError());
-    }
-
-  deallog
-    << "Consistency checking: the following are all the points in the set."
-    << std::endl;
-  for (auto &p : points)
-    {
-      auto res = kdtree.get_closest_points(p, 1)[0];
-      deallog << "P: " << p << ", distance: " << res.second
-              << ", index: " << res.first << std::endl;
-    }
-}
diff --git a/tests/numerics/kdtree_01.with_nanoflann=true.output b/tests/numerics/kdtree_01.with_nanoflann=true.output
deleted file mode 100644 (file)
index e1196a5..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-
-DEAL::Distance from unit square:
-DEAL::P: 0.500000 0.500000, distance: 0.707107, index: 0
-DEAL::P: 2.00000 0.00000, distance: 1.00000, index: 2
-DEAL::P: 2.00000 2.00000, distance: 1.41421, index: 3
-DEAL::Consistency checking: the following are all the points in the set.
-DEAL::P: 0.00000 0.00000, distance: 0.00000, index: 0
-DEAL::P: 0.00000 1.00000, distance: 0.00000, index: 1
-DEAL::P: 1.00000 0.00000, distance: 0.00000, index: 2
-DEAL::P: 1.00000 1.00000, distance: 0.00000, index: 3
diff --git a/tests/numerics/kdtree_02.cc b/tests/numerics/kdtree_02.cc
deleted file mode 100644 (file)
index 7e17123..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-// ---------------------------------------------------------------------
-//
-// Copyright (C) 2017 - 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.
-//
-//---------------------------------------------------------------------
-
-// Create a list of points, and compute the closest points to a given one.
-
-#include <deal.II/numerics/kdtree.h>
-
-#include "../tests.h"
-
-int
-main()
-{
-  initlog();
-
-  KDTree<2> kdtree;
-
-  std::vector<Point<2>> points;
-
-  // Add four points
-  points.push_back(Point<2>(0, 0));
-  points.push_back(Point<2>(0, 1));
-  points.push_back(Point<2>(1, 0));
-  points.push_back(Point<2>(1, 1));
-
-  std::vector<Point<2>> test_points;
-  test_points.push_back(Point<2>(.5, .5));
-  test_points.push_back(Point<2>(2, 0));
-  test_points.push_back(Point<2>(2, 2));
-
-  kdtree.set_points(points);
-
-  std::vector<unsigned int> indices;
-  std::vector<double>       distances;
-
-  // Get closest points. Do a few rounds
-  for (auto &p : test_points)
-    {
-      for (unsigned int i = 1; i < points.size() + 1; ++i)
-        {
-          auto res = kdtree.get_closest_points(p, i);
-
-          deallog << std::endl
-                  << "The first " << i << " closest points to " << p
-                  << " are:" << std::endl;
-          for (unsigned int j = 0; j < i; ++j)
-            {
-              deallog << "points[" << res[j].first
-                      << "] = " << points[res[j].first]
-                      << ", distance: " << res[j].second << std::endl;
-            }
-        }
-    }
-}
diff --git a/tests/numerics/kdtree_02.with_nanoflann=true.output b/tests/numerics/kdtree_02.with_nanoflann=true.output
deleted file mode 100644 (file)
index 67ed678..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-
-DEAL::
-DEAL::The first 1 closest points to 0.500000 0.500000 are:
-DEAL::points[0] = 0.00000 0.00000, distance: 0.707107
-DEAL::
-DEAL::The first 2 closest points to 0.500000 0.500000 are:
-DEAL::points[0] = 0.00000 0.00000, distance: 0.707107
-DEAL::points[1] = 0.00000 1.00000, distance: 0.707107
-DEAL::
-DEAL::The first 3 closest points to 0.500000 0.500000 are:
-DEAL::points[0] = 0.00000 0.00000, distance: 0.707107
-DEAL::points[1] = 0.00000 1.00000, distance: 0.707107
-DEAL::points[2] = 1.00000 0.00000, distance: 0.707107
-DEAL::
-DEAL::The first 4 closest points to 0.500000 0.500000 are:
-DEAL::points[0] = 0.00000 0.00000, distance: 0.707107
-DEAL::points[1] = 0.00000 1.00000, distance: 0.707107
-DEAL::points[2] = 1.00000 0.00000, distance: 0.707107
-DEAL::points[3] = 1.00000 1.00000, distance: 0.707107
-DEAL::
-DEAL::The first 1 closest points to 2.00000 0.00000 are:
-DEAL::points[2] = 1.00000 0.00000, distance: 1.00000
-DEAL::
-DEAL::The first 2 closest points to 2.00000 0.00000 are:
-DEAL::points[2] = 1.00000 0.00000, distance: 1.00000
-DEAL::points[3] = 1.00000 1.00000, distance: 1.41421
-DEAL::
-DEAL::The first 3 closest points to 2.00000 0.00000 are:
-DEAL::points[2] = 1.00000 0.00000, distance: 1.00000
-DEAL::points[3] = 1.00000 1.00000, distance: 1.41421
-DEAL::points[0] = 0.00000 0.00000, distance: 2.00000
-DEAL::
-DEAL::The first 4 closest points to 2.00000 0.00000 are:
-DEAL::points[2] = 1.00000 0.00000, distance: 1.00000
-DEAL::points[3] = 1.00000 1.00000, distance: 1.41421
-DEAL::points[0] = 0.00000 0.00000, distance: 2.00000
-DEAL::points[1] = 0.00000 1.00000, distance: 2.23607
-DEAL::
-DEAL::The first 1 closest points to 2.00000 2.00000 are:
-DEAL::points[3] = 1.00000 1.00000, distance: 1.41421
-DEAL::
-DEAL::The first 2 closest points to 2.00000 2.00000 are:
-DEAL::points[3] = 1.00000 1.00000, distance: 1.41421
-DEAL::points[1] = 0.00000 1.00000, distance: 2.23607
-DEAL::
-DEAL::The first 3 closest points to 2.00000 2.00000 are:
-DEAL::points[3] = 1.00000 1.00000, distance: 1.41421
-DEAL::points[1] = 0.00000 1.00000, distance: 2.23607
-DEAL::points[2] = 1.00000 0.00000, distance: 2.23607
-DEAL::
-DEAL::The first 4 closest points to 2.00000 2.00000 are:
-DEAL::points[3] = 1.00000 1.00000, distance: 1.41421
-DEAL::points[1] = 0.00000 1.00000, distance: 2.23607
-DEAL::points[2] = 1.00000 0.00000, distance: 2.23607
-DEAL::points[0] = 0.00000 0.00000, distance: 2.82843
diff --git a/tests/numerics/kdtree_03.cc b/tests/numerics/kdtree_03.cc
deleted file mode 100644 (file)
index 1da44a5..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-// ---------------------------------------------------------------------
-//
-// Copyright (C) 2017 - 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.
-//
-//---------------------------------------------------------------------
-
-// Create a list of points, and the ones within a specified radius of the target
-// points
-
-#include <deal.II/numerics/kdtree.h>
-
-#include "../tests.h"
-
-int
-main()
-{
-  initlog();
-
-  KDTree<2> kdtree;
-
-  std::vector<Point<2>> points;
-
-  // Add four points
-  points.push_back(Point<2>(0, 0));
-  points.push_back(Point<2>(0, 1));
-  points.push_back(Point<2>(1, 0));
-  points.push_back(Point<2>(1, 1));
-
-  std::vector<Point<2>> test_points;
-  test_points.push_back(Point<2>(2, 0));
-  test_points.push_back(Point<2>(2, 2));
-
-  std::vector<double> radii;
-  radii.push_back(.8);
-  radii.push_back(1.1);
-  radii.push_back(1.5);
-  radii.push_back(2);
-
-
-  kdtree.set_points(points);
-
-  std::vector<std::pair<unsigned int, double>> matches;
-
-  // Get points within ball
-  for (auto &p : test_points)
-    {
-      for (auto &r : radii)
-        {
-          auto matches = kdtree.get_points_within_ball(p, r, true);
-
-          deallog << std::endl
-                  << "At distance less than " << r << " from " << p
-                  << " we have:" << std::endl;
-          for (auto &m : matches)
-            {
-              deallog << "points[" << m.first << "] = " << points[m.first]
-                      << ", distance: " << m.second << std::endl;
-            }
-        }
-    }
-}
diff --git a/tests/numerics/kdtree_03.with_nanoflann=true.output b/tests/numerics/kdtree_03.with_nanoflann=true.output
deleted file mode 100644 (file)
index e4e38ed..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-
-DEAL::
-DEAL::At distance less than 0.800000 from 2.00000 0.00000 we have:
-DEAL::
-DEAL::At distance less than 1.10000 from 2.00000 0.00000 we have:
-DEAL::points[2] = 1.00000 0.00000, distance: 1.00000
-DEAL::
-DEAL::At distance less than 1.50000 from 2.00000 0.00000 we have:
-DEAL::points[2] = 1.00000 0.00000, distance: 1.00000
-DEAL::points[3] = 1.00000 1.00000, distance: 1.41421
-DEAL::
-DEAL::At distance less than 2.00000 from 2.00000 0.00000 we have:
-DEAL::points[2] = 1.00000 0.00000, distance: 1.00000
-DEAL::points[3] = 1.00000 1.00000, distance: 1.41421
-DEAL::
-DEAL::At distance less than 0.800000 from 2.00000 2.00000 we have:
-DEAL::
-DEAL::At distance less than 1.10000 from 2.00000 2.00000 we have:
-DEAL::
-DEAL::At distance less than 1.50000 from 2.00000 2.00000 we have:
-DEAL::points[3] = 1.00000 1.00000, distance: 1.41421
-DEAL::
-DEAL::At distance less than 2.00000 from 2.00000 2.00000 we have:
-DEAL::points[3] = 1.00000 1.00000, distance: 1.41421
index 998f590843dc0876872143bc8e6d52c0d3526082..774b17709cb1d82e96f324b1157ed1e84aa9775a 100644 (file)
@@ -152,11 +152,6 @@ IF (DEAL_II_WITH_HDF5)
   make_quicktest("hdf5" ${_mybuild} "")
 ENDIF()
 
-# Test Nanoflann
-IF (DEAL_II_WITH_NANOFLANN)
-  make_quicktest("nanoflann" ${_mybuild} "")
-ENDIF()
-
 # Test Arpack
 IF (DEAL_II_WITH_ARPACK AND DEAL_II_WITH_UMFPACK)
   make_quicktest("arpack" ${_mybuild} "")
diff --git a/tests/quick_tests/nanoflann.cc b/tests/quick_tests/nanoflann.cc
deleted file mode 100644 (file)
index 5e6b6fb..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-// ---------------------------------------------------------------------
-//
-// Copyright (C) 2017 - 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.
-//
-//---------------------------------------------------------------------
-
-// Create a list of points, and compute the minimum distance from some other
-// points to this set, using a kdtree library
-
-#include <deal.II/base/logstream.h>
-
-#include <deal.II/numerics/kdtree.h>
-
-using namespace dealii;
-
-
-int
-main()
-{
-  KDTree<2> kdtree;
-
-  std::vector<Point<2>> points;
-
-  // Add four points
-  points.emplace_back(0, 0);
-  points.emplace_back(0, 1);
-  points.emplace_back(1, 0);
-  points.emplace_back(1, 1);
-
-  deallog << "Distance from unit square:" << std::endl;
-
-  std::vector<Point<2>> test_points;
-  test_points.emplace_back(.5, .5);
-  test_points.emplace_back(2, 0);
-  test_points.emplace_back(2, 2);
-
-  kdtree.set_points(points);
-
-  for (auto &p : test_points)
-    {
-      auto res = kdtree.get_closest_points(p, 1)[0];
-      deallog << "P: " << p << ", distance: " << res.second
-              << ", index: " << res.first << std::endl;
-    }
-
-  deallog
-    << "Consistency checking: the following are all the points in the set."
-    << std::endl;
-  for (auto &p : points)
-    {
-      auto res = kdtree.get_closest_points(p, 1)[0];
-      deallog << "P: " << p << ", distance: " << res.second
-              << ", index: " << res.first << std::endl;
-      Assert(res.second < 1e-10, ExcMessage("Should be zero!"));
-    }
-}

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.