A class to accelerate Point-In-Cell queries on a computational mesh.
More...
#include </home/docs/checkouts/readthedocs.org/user_builds/axom/checkouts/v0.5.0/src/axom/quest/PointInCell.hpp>
template<typename mesh_tag>
class axom::quest::PointInCell< mesh_tag >
A class to accelerate Point-In-Cell queries on a computational mesh.
A point in cell query over a computational mesh determines if a given point is contained in one of its cells. If so, it returns the index of the cell containing the point as well as the isoparametric coordinates of the point within the cell.
- Template Parameters
-
mesh_tag | A tag type (e.g. an empty struct) for the underlying computational mesh. There must also be corresponding template specializations of PointInCellMeshWrapper<mesh_tag> and PointInCellTraits<mesh_tag> for the provided mesh_tag in the axom::quest::detail namespace |
- Note
- This class was designed to support point in cell queries against 2D or 3D computational meshes. The queries to the mesh are wrapped in a PointInCellMeshWrapper class templated on a mesh_tag type. To extend this design, one must create a new mesh tag (e.g.. an empty struct custom_mesh_tag) and add custom template specializations of PointInCellMeshWrapper and PointInCellTraits for this tag in the axom::quest namespace.
- See also
- PointInCellMeshWrapper_mfem.hpp for a specialized implementation for mfem meshes of arbitrary order. It uses the mesh_tag quest_point_in_cell_mfem_tag
◆ MeshTraits
template<typename mesh_tag >
◆ MeshType
template<typename mesh_tag >
◆ IndexType
template<typename mesh_tag >
◆ MeshWrapperType
template<typename mesh_tag >
◆ PointFinder2D
template<typename mesh_tag >
◆ PointFinder3D
template<typename mesh_tag >
◆ PointInCell()
template<typename mesh_tag >
Construct a point in cell query structure over a computational mesh
- Parameters
-
[in] | mesh | A pointer to the computational mesh |
[in] | resolution | Grid resolution for the spatial index. Default: NULL |
[in] | bboxTolerance | A tolerance factor by which to expand the bounding boxes. Default: 1e-8 |
- Note
- The bboxTolerance should be a small positive number. It helps avoid numerical issues in the bounding box containment queries by slightly expanding the cell bounding boxes.
-
If the resolution is not provided, a heuristic based on the number of cells in the mesh is used to set the resolution.
- See also
- ImplicitGrid
- Precondition
- mesh must not be a NULL pointer
-
If resolution is not NULL, it must have space for at least meshDimension() entries.
References SLIC_ASSERT, and SLIC_ERROR.
◆ ~PointInCell()
template<typename mesh_tag >
◆ locatePoint()
template<typename mesh_tag >
Attempt to find the index of the mesh cell containing the given point.
If found, and isopar is not NULL, isopar contains the isoparametric coordinates the point within this cell.
- Parameters
-
[in] | pos | The coordinates of the query point in space |
[out] | isopar | The isoparametric coordinates of the query pt. Only valid when a cell is found. |
- Returns
- The index of the mesh cell containing the query point. If no cell is found, returns the special value MeshTraits::NO_CELL. Otherwise, the result will be between 0 and N, where N is the number of cells in the mesh.
- Precondition
- pos is a non-null array with at least meshDimension() coords
-
When not NULL, isopar has space for meshDimension() coords
References SLIC_ASSERT, and SLIC_ERROR.
◆ locatePointInCell()
template<typename mesh_tag >
Determine if a query point is located within a specified mesh cell
- Parameters
-
[in] | cellIdx | The index of the cell within the mesh |
[in] | pos | The coordinates of the query point in space |
[out] | isopar | The isoparametric coordinates of the point within cell cellIdx. Only valid when the return value is true |
- Returns
- True, if the query point is located within the specified cell
- Precondition
- pos is not NULL and has meshDimension() entries
-
isopar is not NULL and has space for meshDimension() entries
◆ reconstructPoint()
template<typename mesh_tag >
Evaluate the position of a point within a mesh cell at the given isoparametric coordinates.
- Parameters
-
[in] | cellIdx | The index of the cell within the mesh |
| [in[ | isopar The isoparametric coordinates at which to evaluate |
[out] | pos | The computed coordinates of the evaluated point |
◆ meshDimension()
template<typename mesh_tag >
Returns the dimension of the mesh
The documentation for this class was generated from the following file:
- /home/docs/checkouts/readthedocs.org/user_builds/axom/checkouts/v0.5.0/src/axom/quest/PointInCell.hpp