DFT-FE 1.1.0-pre
Density Functional Theory With Finite-Elements
Loading...
Searching...
No Matches
RTreeBox.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 dftfeRTreeBox_h
23#define dftfeRTreeBox_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#include <TypeConfig.h>
31#include <Cell.h>
32
33#include "headers.h"
34
35namespace dftfe
36{
37 namespace utils
38 {
39 namespace
40 {
41 namespace BA = boost::adaptors;
42 namespace BG = boost::geometry;
43 namespace BGI = boost::geometry::index;
44 namespace BGIA = boost::geometry::index::adaptors;
45 } // namespace
46 /** @brief A class template to perform RTreeBox based searching on
47 * overlap of boxes
48 *
49 * @tparam dim Dimension of the box
50 * @param M maximum allowable nodes in a branch of RTreeBox (i.e., maximum number of child nodes a parent node can have)
51 */
52 template <size_type dim, size_type M>
54 {
55 public:
56 using BPoint = BG::model::point<double, dim, BG::cs::cartesian>;
57 using BBox = BG::model::box<BPoint>;
58 using BBoxI = std::pair<BBox, size_type>;
59 using BRTreeBoxI = BGI::rtree<BBoxI, BGI::quadratic<M>>;
60
61 /**
62 * @brief Constructor
63 *
64 *
65 */
66 RTreeBox(std::vector<std::shared_ptr<const Cell<dim>>> sourceCells);
67
68 std::vector<std::vector<size_type>>
70 std::vector<std::shared_ptr<const Cell<dim>>> queryCells);
71
72 private:
73 //
74 // boost rtree obj
75 //
77
78 }; // end of class RTreeBox
79 } // end of namespace utils
80} // end of namespace dftfe
81#include <../utils/RTreeBox.t.cc>
82#endif // dftfeRTreeBox_h
This class provides the interface that will be required while interpolating a nodal data to arbitrary...
Definition Cell.h:45
BGI::rtree< BBoxI, BGI::quadratic< M > > BRTreeBoxI
Definition RTreeBox.h:59
std::pair< BBox, size_type > BBoxI
Definition RTreeBox.h:58
RTreeBox(std::vector< std::shared_ptr< const Cell< dim > > > sourceCells)
Constructor.
BG::model::box< BPoint > BBox
Definition RTreeBox.h:57
BRTreeBoxI d_rtree
Definition RTreeBox.h:76
BG::model::point< double, dim, BG::cs::cartesian > BPoint
Definition RTreeBox.h:56
std::vector< std::vector< size_type > > getOverlappingCellIds(std::vector< std::shared_ptr< const Cell< dim > > > queryCells)
Definition Cell.h:36
Definition pseudoPotentialToDftfeConverter.cc:34