preCICE v3.1.2
Loading...
Searching...
No Matches
Classes | Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
precice::query::Index Class Reference

Class to query the index trees of the mesh. More...

#include <Index.hpp>

Collaboration diagram for precice::query::Index:
[legend]

Classes

class  IndexImpl
 

Public Member Functions

 Index (mesh::PtrMesh mesh)
 
 Index (mesh::Mesh &mesh)
 
 ~Index ()
 
VertexMatch getClosestVertex (const Eigen::VectorXd &sourceCoord)
 Get the closest vertex to the given vertex.
 
std::vector< VertexIDgetClosestVertices (const Eigen::VectorXd &sourceCoord, int n)
 Get n number of closest vertices to the given vertex.
 
std::vector< EdgeMatchgetClosestEdges (const Eigen::VectorXd &sourceCoord, int n)
 Get n number of closest edges to the given vertex.
 
std::vector< TriangleMatchgetClosestTriangles (const Eigen::VectorXd &sourceCoord, int n)
 Get n number of closest triangles to the given vertex.
 
std::vector< VertexIDgetVerticesInsideBox (const mesh::Vertex &centerVertex, double radius)
 Return all the vertices inside the box formed by vertex and radius (boundary exclusive)
 
std::vector< VertexIDgetVerticesInsideBox (const mesh::BoundingBox &bb)
 Return all the vertices inside a bounding box.
 
bool isAnyVertexInsideBox (const mesh::Vertex &centerVertex, double radius)
 Returns.
 
std::vector< TetrahedronIDgetEnclosingTetrahedra (const Eigen::VectorXd &location)
 Return all the tetrahedra whose axis-aligned bounding box contains a vertex.
 
ProjectionMatch findNearestProjection (const Eigen::VectorXd &location, int n)
 Find the closest interpolation element to the given location. If exists, triangle or edge projection element is returned. If not vertex projection element, which is the nearest neighbor is returned.
 
ProjectionMatch findCellOrProjection (const Eigen::VectorXd &location, int n)
 
mesh::BoundingBox getRtreeBounds ()
 
void clear ()
 Clear the index.
 

Private Member Functions

ProjectionMatch findVertexProjection (const Eigen::VectorXd &location)
 Closest vertex projection element is always the nearest neighbor.
 
ProjectionMatch findEdgeProjection (const Eigen::VectorXd &location, int n, ProjectionMatch closestVertex)
 Find closest edge interpolation element. If cannot be found, it falls back to vertex projection.
 
ProjectionMatch findTriangleProjection (const Eigen::VectorXd &location, int n, ProjectionMatch closestVertex)
 Find closest face interpolation element. If cannot be found, it falls back to first edge interpolation element, then vertex if necessary.
 

Private Attributes

std::unique_ptr< IndexImpl_pimpl
 
mesh::Mesh_mesh
 The indexed Mesh.
 

Static Private Attributes

static precice::logging::Logger _log {"query::Index"}
 

Detailed Description

Class to query the index trees of the mesh.

Definition at line 65 of file Index.hpp.

Constructor & Destructor Documentation

◆ Index() [1/2]

precice::query::Index::Index ( mesh::PtrMesh mesh)

Definition at line 156 of file Index.cpp.

◆ Index() [2/2]

precice::query::Index::Index ( mesh::Mesh & mesh)

Definition at line 162 of file Index.cpp.

◆ ~Index()

precice::query::Index::~Index ( )
default

Member Function Documentation

◆ clear()

void precice::query::Index::clear ( )

Clear the index.

Definition at line 391 of file Index.cpp.

◆ findCellOrProjection()

ProjectionMatch precice::query::Index::findCellOrProjection ( const Eigen::VectorXd & location,
int n )

Definition at line 284 of file Index.cpp.

Here is the call graph for this function:

◆ findEdgeProjection()

ProjectionMatch precice::query::Index::findEdgeProjection ( const Eigen::VectorXd & location,
int n,
ProjectionMatch closestVertex )
private

Find closest edge interpolation element. If cannot be found, it falls back to vertex projection.

Definition at line 318 of file Index.cpp.

Here is the call graph for this function:

◆ findNearestProjection()

ProjectionMatch precice::query::Index::findNearestProjection ( const Eigen::VectorXd & location,
int n )

Find the closest interpolation element to the given location. If exists, triangle or edge projection element is returned. If not vertex projection element, which is the nearest neighbor is returned.

param[in] sourceVertex param[in] n how many nearest edges/faces are going to be checked

param[out] pair of interpolation and the distance to corresponding vertex/edge/triangle

Definition at line 275 of file Index.cpp.

Here is the call graph for this function:

◆ findTriangleProjection()

ProjectionMatch precice::query::Index::findTriangleProjection ( const Eigen::VectorXd & location,
int n,
ProjectionMatch closestVertex )
private

Find closest face interpolation element. If cannot be found, it falls back to first edge interpolation element, then vertex if necessary.

Definition at line 342 of file Index.cpp.

Here is the call graph for this function:

◆ findVertexProjection()

ProjectionMatch precice::query::Index::findVertexProjection ( const Eigen::VectorXd & location)
private

Closest vertex projection element is always the nearest neighbor.

Definition at line 312 of file Index.cpp.

Here is the call graph for this function:

◆ getClosestEdges()

std::vector< EdgeMatch > precice::query::Index::getClosestEdges ( const Eigen::VectorXd & sourceCoord,
int n )

Get n number of closest edges to the given vertex.

Definition at line 197 of file Index.cpp.

Here is the call graph for this function:

◆ getClosestTriangles()

std::vector< TriangleMatch > precice::query::Index::getClosestTriangles ( const Eigen::VectorXd & sourceCoord,
int n )

Get n number of closest triangles to the given vertex.

Definition at line 210 of file Index.cpp.

Here is the call graph for this function:

◆ getClosestVertex()

VertexMatch precice::query::Index::getClosestVertex ( const Eigen::VectorXd & sourceCoord)

Get the closest vertex to the given vertex.

Definition at line 171 of file Index.cpp.

Here is the call graph for this function:

◆ getClosestVertices()

std::vector< VertexID > precice::query::Index::getClosestVertices ( const Eigen::VectorXd & sourceCoord,
int n )

Get n number of closest vertices to the given vertex.

Definition at line 184 of file Index.cpp.

Here is the call graph for this function:

◆ getEnclosingTetrahedra()

std::vector< TetrahedronID > precice::query::Index::getEnclosingTetrahedra ( const Eigen::VectorXd & location)

Return all the tetrahedra whose axis-aligned bounding box contains a vertex.

Definition at line 263 of file Index.cpp.

Here is the call graph for this function:

◆ getRtreeBounds()

mesh::BoundingBox precice::query::Index::getRtreeBounds ( )

Definition at line 367 of file Index.cpp.

Here is the call graph for this function:

◆ getVerticesInsideBox() [1/2]

std::vector< VertexID > precice::query::Index::getVerticesInsideBox ( const mesh::BoundingBox & bb)

Return all the vertices inside a bounding box.

Definition at line 253 of file Index.cpp.

Here is the call graph for this function:

◆ getVerticesInsideBox() [2/2]

std::vector< VertexID > precice::query::Index::getVerticesInsideBox ( const mesh::Vertex & centerVertex,
double radius )

Return all the vertices inside the box formed by vertex and radius (boundary exclusive)

Definition at line 223 of file Index.cpp.

Here is the call graph for this function:

◆ isAnyVertexInsideBox()

bool precice::query::Index::isAnyVertexInsideBox ( const mesh::Vertex & centerVertex,
double radius )

Returns.

Definition at line 238 of file Index.cpp.

Here is the call graph for this function:

Member Data Documentation

◆ _log

precice::logging::Logger precice::query::Index::_log {"query::Index"}
staticprivate

Definition at line 123 of file Index.hpp.

◆ _mesh

mesh::Mesh* precice::query::Index::_mesh
private

The indexed Mesh.

Definition at line 121 of file Index.hpp.

◆ _pimpl

std::unique_ptr<IndexImpl> precice::query::Index::_pimpl
private

Definition at line 118 of file Index.hpp.


The documentation for this class was generated from the following files: