DFT-FE 1.1.0-pre
Density Functional Theory With Finite-Elements
Loading...
Searching...
No Matches
RTreePoint.h
Go to the documentation of this file.
1// ---------------------------------------------------------------------
2//
3// Copyright (c) 2017-2025 The Regents of the University of Michigan and DFT-FE
4// authors.
5//
6// This file is part of the DFT-FE code.
7//
8// The DFT-FE code is free software; you can use it, redistribute
9// it, and/or modify it under the terms of the GNU Lesser General
10// Public License as published by the Free Software Foundation; either
11// version 2.1 of the License, or (at your option) any later version.
12// The full text of the license can be found in the file LICENSE at
13// the top level of the DFT-FE distribution.
14//
15// ---------------------------------------------------------------------
16//
17
18/*
19 * @author Bikash Kanungo, Vishal Subramanian
20 */
21
22#ifndef dftfeRTreePoint_h
23#define dftfeRTreePoint_h
24
25#include <boost/geometry.hpp>
26#include <boost/geometry/geometries/geometries.hpp>
27#include <boost/geometry/index/rtree.hpp>
28#include <boost/range/adaptors.hpp>
29
30
31#include <TypeConfig.h>
32#include <Cell.h>
33
34#include "headers.h"
35
36namespace dftfe
37{
38 namespace utils
39 {
40 namespace
41 {
42 namespace BA = boost::adaptors;
43 namespace BG = boost::geometry;
44 namespace BGI = boost::geometry::index;
45 namespace BGIA = boost::geometry::index::adaptors;
46 } // namespace
47
48 /** @brief A class template to perform RTreePoint based searching on
49 * overlap of boxes
50 *
51 * @tparam dim Dimension of the box
52 * @param M maximum allowable nodes in a branch of RTreePoint (i.e., maximum number of child nodes a parent node can have)
53 */
54 template <size_type dim, size_type M>
56 {
57 public:
58 using BPoint = BG::model::point<double, dim, BG::cs::cartesian>;
59 using BBox = BG::model::box<BPoint>;
60 using BPointI = std::pair<BPoint, size_type>;
61 using BRTreePointI = BGI::rtree<BPointI, BGI::quadratic<M>>;
62 /**
63 * @brief Constructor
64 *
65 *
66 */
67 RTreePoint(const std::vector<std::vector<double>> &srcPts);
68
69 std::vector<size_type>
70 getPointIdsInsideBox(const std::vector<double> &lowerLeft,
71 const std::vector<double> &upperRight);
72
73 private:
74 //
75 // boost rtree obj
76 //
77 std::shared_ptr<BRTreePointI> d_rtreePtr;
78
79 }; // end of class RTreePoint
80 } // end of namespace utils
81} // end of namespace dftfe
82#include <../utils/RTreePoint.t.cc>
83#endif // dftfeRTreePoint_h
BGI::rtree< BPointI, BGI::quadratic< M > > BRTreePointI
Definition RTreePoint.h:61
BG::model::point< double, dim, BG::cs::cartesian > BPoint
Definition RTreePoint.h:58
std::pair< BPoint, size_type > BPointI
Definition RTreePoint.h:60
BG::model::box< BPoint > BBox
Definition RTreePoint.h:59
std::vector< size_type > getPointIdsInsideBox(const std::vector< double > &lowerLeft, const std::vector< double > &upperRight)
std::shared_ptr< BRTreePointI > d_rtreePtr
Definition RTreePoint.h:77
RTreePoint(const std::vector< std::vector< double > > &srcPts)
Constructor.
Definition Cell.h:36
Definition pseudoPotentialToDftfeConverter.cc:34