|
hp-FEM
Adaptive hp-FEM suite for nano-optics
|
#include <point_location.hpp>
Public Member Functions | |
| PointLocator (const Mesh< Dim > &mesh, Real tolerance=1e-10) | |
| std::optional< LocatedPoint< Dim > > | locate (const Point< Dim > &x) const |
| std::optional< LocatedPoint< Dim > > | locate (const Point< Dim > &x, Index hint) const |
| std::optional< Point< Dim > > | reference_coordinates (Index c, const Point< Dim > &x) const |
| const Mesh< Dim > & | mesh () const noexcept |
| Real | tolerance () const noexcept |
| const std::array< Index, static_cast< std::size_t >(Dim)> & | grid_divisions () const noexcept |
| Grid buckets per axis (for diagnostics and tests). | |
Locates physical points in a mesh with a uniform background grid over the mesh's bounding box: every grid bucket lists the cells whose bounding box meets it (curved cells use the Bézier control points of the quadratic map, which enclose the cell). A query tests the candidate cells of the point's bucket in ascending cell order and returns the first cell containing the point, so points on shared facets are assigned to the lowest adjacent cell id. Build O(#cells), query O(candidates per bucket), about one cell per bucket on quasi-uniform meshes.
|
explicit |
| tolerance | a point counts as inside a cell if all barycentric coordinates are \( \ge -\text{tolerance} \) (dimensionless, in reference coordinates), so boundary points and rounding noise are resolved. Must be \( \ge 0 \). |
| InvalidArgument | for a negative tolerance. |
|
inlinenoexcept |
Grid buckets per axis (for diagnostics and tests).
| std::optional< LocatedPoint< Dim > > hpfem::mesh::PointLocator< Dim >::locate | ( | const Point< Dim > & | x | ) | const |
Cell containing \( x \) and its reference coordinates, or nothing if \( x \) lies outside the mesh (beyond the tolerance).
| std::optional< LocatedPoint< Dim > > hpfem::mesh::PointLocator< Dim >::locate | ( | const Point< Dim > & | x, |
| Index | hint | ||
| ) | const |
As locate(x), but first tries hint and its facet neighbours; falls back to the grid search. Fast for sequences of nearby points (line scans, particle tracks).
|
inlinenoexcept |
| std::optional< Point< Dim > > hpfem::mesh::PointLocator< Dim >::reference_coordinates | ( | Index | c, |
| const Point< Dim > & | x | ||
| ) | const |
Reference coordinates of \( x \) in cell c if the cell contains it (within tolerance). Curved cells invert the map by Newton iteration; a failed iteration means "outside".
|
inlinenoexcept |