Nektar++
|
#include <Octree.h>
Classes | |
class | Octant |
Public Member Functions | |
Octree () | |
Construct a new octree object. More... | |
Octree (const Array< OneD, Array< OneD, NekDouble > > &pts, int maxPts, const Array< OneD, NekDouble > &bounds) | |
Construct a new octree object. More... | |
Octree (const Array< OneD, Array< OneD, NekDouble > > &pts, int maxPts) | |
Construct a new octree object. More... | |
int | QueryNode (const Array< OneD, NekDouble > &coords, int depth=std::numeric_limits< int >::max()) |
Given the coordinates 'coords' of a point, returns the leaf octant that contains it. If 'depth' is specified, returs the node that contains the point such that its depth is lower or equal to the one indicated. If the point lies outside the tree, it returns -1. More... | |
int | QueryClosest (const Array< OneD, Array< OneD, NekDouble > > &pts, const Array< OneD, NekDouble > &coords, double &distance, int pointInd=-1) |
Finds the ID of the closest point in 'pts' to the one specified by 'coords'. It also returns the distance between both points in 'distance'. More... | |
std::vector< int > | QueryPoints (int nodeID) |
Returns the indices of the points of the mesh contained in the tree. More... | |
std::vector< int > | QueryNeighbours (int nodeID) |
Returns the IDs of the octants that surround the queried node. First, it finds the neighbouring nodes with the same or lower depth and, if they are not leaf nodes, return all the leaf octants contained in them. This means that, for octants of depth 2, this function returns all the leaf nodes in the tree except those lying inside the queried octant. More... | |
int | QueryNpoints (int nodeID) |
int | QueryLocation (int nodeID) |
int | QueryDepth (int nodeID) |
int | QueryDelta (int nodeID) |
void | GetStats (int &maxPts, int &nPts, int &nNodes, int &nLeaves, int &depth) |
Returns some characteristic values of the tree. More... | |
Private Types | |
using | OctantSharedPtr = std::shared_ptr< Octant > |
using | OctantWeakPtr = std::weak_ptr< Octant > |
Private Member Functions | |
void | AdvanceToStats (int nodeID) |
Goes through all the nodes of the octree counting the number of octants and the maximum depth reached. More... | |
void | SetNeighbours (int nodeID) |
Once the nodes of the octree are created, sets their neighbours as explained in 'Octree::QueryNeighbours'. More... | |
Private Attributes | |
int | m_maxPts |
Max points allowed in each octant. More... | |
int | m_nMshPts |
Number of points in the mesh. More... | |
int | m_nNodes |
Number of octants in the tree. More... | |
int | m_nLeaves |
Number of leaf nodes in the tree. More... | |
int | m_maxDepth |
Maximum depth of the tree. More... | |
OctantSharedPtr | m_root |
First node of the tree, linked to the rest. More... | |
std::vector< OctantSharedPtr > | m_nodes |
Vector of pointers to every octant in the tree. More... | |
|
private |
|
private |
Nektar::FieldUtils::Octree::Octree | ( | ) |
Construct a new octree object.
Definition at line 46 of file Octree.cpp.
Referenced by Octree().
Nektar::FieldUtils::Octree::Octree | ( | const Array< OneD, Array< OneD, NekDouble > > & | pts, |
int | maxPts, | ||
const Array< OneD, NekDouble > & | bounds | ||
) |
Construct a new octree object.
pts | |
maxPts | |
bounds |
Definition at line 59 of file Octree.cpp.
References AdvanceToStats(), m_maxDepth, m_maxPts, m_nMshPts, m_nNodes, m_nodes, m_root, and SetNeighbours().
Nektar::FieldUtils::Octree::Octree | ( | const Array< OneD, Array< OneD, NekDouble > > & | pts, |
int | maxPts | ||
) |
Construct a new octree object.
pts | |
maxPts |
Definition at line 94 of file Octree.cpp.
|
private |
Goes through all the nodes of the octree counting the number of octants and the maximum depth reached.
nodeID |
Definition at line 285 of file Octree.cpp.
References AdvanceToStats(), m_maxDepth, m_nLeaves, and m_nodes.
Referenced by AdvanceToStats(), and Octree().
void Nektar::FieldUtils::Octree::GetStats | ( | int & | maxPts, |
int & | nPts, | ||
int & | nNodes, | ||
int & | nLeaves, | ||
int & | depth | ||
) |
Returns some characteristic values of the tree.
maxPts | |
nPts | |
nNodes | |
nLeaves | |
depth |
Definition at line 269 of file Octree.cpp.
References m_maxDepth, m_maxPts, m_nLeaves, m_nMshPts, and m_nNodes.
int Nektar::FieldUtils::Octree::QueryClosest | ( | const Array< OneD, Array< OneD, NekDouble > > & | pts, |
const Array< OneD, NekDouble > & | coords, | ||
double & | distance, | ||
int | pointInd = -1 |
||
) |
Finds the ID of the closest point in 'pts' to the one specified by 'coords'. It also returns the distance between both points in 'distance'.
pts | |
coords | |
distance | |
pointInd |
Definition at line 176 of file Octree.cpp.
References m_nodes, QueryNode(), and tinysimd::sqrt().
|
inline |
|
inline |
Definition at line 79 of file Octree.h.
References m_nodes.
Referenced by Nektar::FieldUtils::ProcessPhiFromFile::FindShortestDist().
|
inline |
std::vector< int > Nektar::FieldUtils::Octree::QueryNeighbours | ( | int | nodeID | ) |
Returns the IDs of the octants that surround the queried node. First, it finds the neighbouring nodes with the same or lower depth and, if they are not leaf nodes, return all the leaf octants contained in them. This means that, for octants of depth 2, this function returns all the leaf nodes in the tree except those lying inside the queried octant.
nodeID |
Definition at line 250 of file Octree.cpp.
References m_nodes.
Referenced by Nektar::FieldUtils::ProcessPhiFromFile::FindShortestDist().
int Nektar::FieldUtils::Octree::QueryNode | ( | const Array< OneD, NekDouble > & | coords, |
int | depth = std::numeric_limits<int>::max() |
||
) |
Given the coordinates 'coords' of a point, returns the leaf octant that contains it. If 'depth' is specified, returs the node that contains the point such that its depth is lower or equal to the one indicated. If the point lies outside the tree, it returns -1.
coords | |
depth |
Definition at line 137 of file Octree.cpp.
References CG_Iterations::loc, and m_root.
Referenced by Nektar::FieldUtils::ProcessPhiFromFile::FindShortestDist(), QueryClosest(), and SetNeighbours().
|
inline |
std::vector< int > Nektar::FieldUtils::Octree::QueryPoints | ( | int | nodeID | ) |
Returns the indices of the points of the mesh contained in the tree.
nodeID |
Definition at line 235 of file Octree.cpp.
References m_nodes.
Referenced by Nektar::FieldUtils::ProcessPhiFromFile::FindShortestDist().
|
private |
Once the nodes of the octree are created, sets their neighbours as explained in 'Octree::QueryNeighbours'.
nodeID |
Definition at line 312 of file Octree.cpp.
References m_nodes, QueryNode(), and SetNeighbours().
Referenced by Octree(), and SetNeighbours().
|
private |
Maximum depth of the tree.
Definition at line 199 of file Octree.h.
Referenced by AdvanceToStats(), GetStats(), and Octree().
|
private |
Max points allowed in each octant.
Definition at line 191 of file Octree.h.
Referenced by GetStats(), and Octree().
|
private |
Number of leaf nodes in the tree.
Definition at line 197 of file Octree.h.
Referenced by AdvanceToStats(), and GetStats().
|
private |
Number of points in the mesh.
Definition at line 193 of file Octree.h.
Referenced by GetStats(), and Octree().
|
private |
Number of octants in the tree.
Definition at line 195 of file Octree.h.
Referenced by GetStats(), and Octree().
|
private |
Vector of pointers to every octant in the tree.
Definition at line 204 of file Octree.h.
Referenced by AdvanceToStats(), Octree(), QueryClosest(), QueryDelta(), QueryDepth(), QueryLocation(), QueryNeighbours(), QueryNpoints(), QueryPoints(), and SetNeighbours().
|
private |
First node of the tree, linked to the rest.
Definition at line 202 of file Octree.h.
Referenced by Octree(), and QueryNode().