DFT-FE 1.1.0-pre
Density Functional Theory With Finite-Elements
Loading...
Searching...
No Matches
MapPointsToCells.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 dftfeMapPointsToCells_h
23#define dftfeMapPointsToCells_h
24
25#include <boost/geometry.hpp>
26#include <boost/geometry/index/rtree.hpp>
27#include <boost/range/adaptors.hpp>
28#include "RTreeBox.h"
29#include "RTreePoint.h"
30
31#include <TypeConfig.h>
32#include <Cell.h>
33
34namespace dftfe
35{
36 namespace utils
37 {
38 /**
39 * @brief This class takes in a bunch of points and finds the cell (provided as input)
40 * it lies in. In case the points dont lie in any of the cells, it sends the
41 * points to other processors. Similarly it receives points from other
42 * processors and then checks if any of them lies within its cell. It
43 * provides the real coordinates of points in each cell
44 *
45 * @author Vishal Subramanian, Bikash Kanungo
46 */
47 template <size_type dim, size_type M>
49 {
50 public:
51 MapPointsToCells(const unsigned int verbosity, const MPI_Comm &mpiComm);
52
53 /**
54 * @brief The init().
55 * @param[in] srcCells The cells assigned to this processor
56 * @param[in] targetPts The points assigned to this processor
57 * @param[out] mapCellsToRealCoordinates The Real coordinates of the
58 * points found in each cell.
59 * @param[in] locallyOwnedRange The locally owned range for the target
60 * points
61 * @param[out] ghostGlobalIds The global Ids of the points assigned to
62 * other processors but found within the cells assigned to this processor.
63 * @param[in] paramCoordsTol Tol used to determine if the point is inside
64 * a cell
65 *
66 * @author Vishal Subramanian, Bikash Kanungo
67 */
68 void
69 init(std::vector<std::shared_ptr<const Cell<dim>>> srcCells,
70 const std::vector<std::vector<double>> & targetPts,
71 std::vector<std::vector<double>> & mapCellsToRealCoordinates,
72 std::vector<std::vector<size_type>> &mapCellLocalToProcLocal,
73 std::pair<global_size_type, global_size_type> &locallyOwnedRange,
74 std::vector<global_size_type> & ghostGlobalIds,
75 const double paramCoordsTol);
76
77
78 private:
79 const MPI_Comm d_mpiComm;
82 unsigned int d_verbosity;
83
84 }; // end of class MapPointsToCells
85 } // end of namespace utils
86} // end of namespace dftfe
87
88#include "../src/TransferBetweenMeshes/MapPointsToCells.t.cc"
89#endif // dftfeMapPointsToCells_h
This class provides the interface that will be required while interpolating a nodal data to arbitrary...
Definition Cell.h:45
const MPI_Comm d_mpiComm
Definition MapPointsToCells.h:79
void init(std::vector< std::shared_ptr< const Cell< dim > > > srcCells, const std::vector< std::vector< double > > &targetPts, std::vector< std::vector< double > > &mapCellsToRealCoordinates, std::vector< std::vector< size_type > > &mapCellLocalToProcLocal, std::pair< global_size_type, global_size_type > &locallyOwnedRange, std::vector< global_size_type > &ghostGlobalIds, const double paramCoordsTol)
The init().
unsigned int d_verbosity
Definition MapPointsToCells.h:82
int d_thisRank
Definition MapPointsToCells.h:81
int d_numMPIRank
Definition MapPointsToCells.h:80
MapPointsToCells(const unsigned int verbosity, const MPI_Comm &mpiComm)
Definition Cell.h:36
Definition pseudoPotentialToDftfeConverter.cc:34