A class used to help find the nearest element to a point. More...
#include <MeshUtilities.h>
Public Member Functions | |
| double | distance (const Point &pos, const Point &dir) const |
| Calculate the distance to the object given a ray. | |
| ElementFinder () | |
| Empty constructor. | |
| ElementFinder (const ElementFinder &)=delete | |
| Copy constructor. | |
| ElementFinder (ElementFinder &&)=default | |
| Move constructor. | |
| ElementFinder (std::shared_ptr< AMP::Mesh::Mesh > mesh) | |
| Empty constructor. | |
| ElementFinder (std::shared_ptr< AMP::Mesh::Mesh > mesh, AMP::Mesh::MeshIterator it) | |
| Empty constructor. | |
| const auto & | getTree () const |
| Return the underlying tree. | |
| std::pair< std::unique_ptr< MeshElement >, Point > | nearest (const Point &x) const |
| Get the nearest element and point. | |
| ElementFinder & | operator= (ElementFinder &&)=default |
| Move operator. | |
| void | update () const |
| Ensure the tree is up-to-date. | |
Private Member Functions | |
| void | initialize () const |
Private Attributes | |
| double | d_dist |
| AMP::Mesh::MeshIterator | d_elements |
| std::shared_ptr< AMP::Mesh::Mesh > | d_mesh |
| uint64_t | d_pos_hash |
| kdtree2< 3, AMP::Mesh::MeshElementID > | d_tree |
A class used to help find the nearest element to a point.
This class provides functions to help find the nearest element to a point
Definition at line 51 of file MeshUtilities.h.
|
inline |
Empty constructor.
Definition at line 55 of file MeshUtilities.h.
| AMP::Mesh::ElementFinder::ElementFinder | ( | std::shared_ptr< AMP::Mesh::Mesh > | mesh | ) |
Empty constructor.
| AMP::Mesh::ElementFinder::ElementFinder | ( | std::shared_ptr< AMP::Mesh::Mesh > | mesh, |
| AMP::Mesh::MeshIterator | it | ||
| ) |
Empty constructor.
|
delete |
Copy constructor.
|
default |
Move constructor.
Calculate the distance to the object given a ray.
This function computes the distance to the object given a ray. If the ray is inside the object, this distance is negitive. If the ray will never intersect the object, this distance is inf.
| [in] | pos | Current position of ray |
| [in] | dir | Direction of ray (should be normalized for most uses) |
|
inline |
|
private |
| std::pair< std::unique_ptr< MeshElement >, Point > AMP::Mesh::ElementFinder::nearest | ( | const Point & | x | ) | const |
Get the nearest element and point.
|
default |
Move operator.
| void AMP::Mesh::ElementFinder::update | ( | ) | const |
Ensure the tree is up-to-date.
|
mutableprivate |
Definition at line 100 of file MeshUtilities.h.
|
private |
Definition at line 99 of file MeshUtilities.h.
|
private |
Definition at line 97 of file MeshUtilities.h.
|
mutableprivate |
Definition at line 98 of file MeshUtilities.h.
|
mutableprivate |
Definition at line 101 of file MeshUtilities.h.
Referenced by getTree().
|
Advanced Multi-Physics (AMP) Oak Ridge National Laboratory Idaho National Laboratory Los Alamos National Laboratory |
This page automatically produced from the source code by Last updated: Tue Mar 10 2026 13:06:43. Comments on this page |