![]() |
OGS
|
|
MeshElementGrid implements a grid data structure supporting search operations and covers a given mesh. It consists of grid cells that are all of the same size. Grid cells contain pointers to intersecting mesh elements.
Definition at line 24 of file MeshElementGrid.h.
#include <MeshElementGrid.h>
Public Member Functions | |
| MeshElementGrid (MeshLib::Mesh const &mesh) | |
| template<typename POINT> | |
| std::vector< MeshLib::Element const * > | getElementsInVolume (POINT const &min, POINT const &max) const |
| Eigen::Vector3d const & | getMinPoint () const |
| Eigen::Vector3d const & | getMaxPoint () const |
Private Member Functions | |
| void | sortElementsInGridCells (MeshLib::Mesh const &mesh) |
| bool | sortElementInGridCells (MeshLib::Element const &element) |
| std::pair< bool, std::array< std::size_t, 3 > > | getGridCellCoordinates (MathLib::Point3d const &p) const |
Private Attributes | |
| GeoLib::AABB | _aabb |
| std::array< double, 3 > | _step_sizes {} |
| std::array< double, 3 > | _inverse_step_sizes {} |
| std::array< std::size_t, 3 > | _n_steps |
| std::vector< std::vector< MeshLib::Element const * > > | _elements_in_grid_box |
|
explicit |
Constructs a grid. Grid cells contains intersecting mesh elements.
| mesh | the MeshLib::Mesh instance the grid will be constructed from |
Definition at line 17 of file MeshElementGrid.cpp.
References _aabb, _n_steps, and getNodes().
|
inline |
Fill and return a vector containing elements of all grid cells that have a non-empty intersection with the box that is defined by min and max.
| min | min point of the box |
| max | max point of the box |
Definition at line 36 of file MeshElementGrid.h.
References _elements_in_grid_box, _n_steps, getGridCellCoordinates(), and MeshLib::POINT.
Referenced by MeshGeoToolsLib::getCandidateElementsForLineSegmentIntersection(), getProjectedElement(), and main().
|
private |
Computes the grid cell coordinates for given point. The first element of the returned pair (bool) is true if the point is within the grid, else false.
Definition at line 201 of file MeshElementGrid.cpp.
References _aabb, _inverse_step_sizes, and _n_steps.
Referenced by getElementsInVolume(), and sortElementInGridCells().
| Eigen::Vector3d const & MeshLib::MeshElementGrid::getMaxPoint | ( | ) | const |
Returns the max point of the internal AABB. The method is a wrapper for AABB::getMaxPoint().
Definition at line 117 of file MeshElementGrid.cpp.
References _aabb.
Referenced by MeshGeoToolsLib::getCandidateElementsForLineSegmentIntersection().
| Eigen::Vector3d const & MeshLib::MeshElementGrid::getMinPoint | ( | ) | const |
Returns the min point of the internal AABB. The method is a wrapper for GeoLib::AABB::getMinPoint().
Definition at line 112 of file MeshElementGrid.cpp.
References _aabb.
Referenced by MeshGeoToolsLib::getCandidateElementsForLineSegmentIntersection().
|
private |
Definition at line 134 of file MeshElementGrid.cpp.
References _elements_in_grid_box, _n_steps, getGridCellCoordinates(), MeshLib::Element::getNode(), and MeshLib::Element::getNumberOfNodes().
Referenced by sortElementsInGridCells().
|
private |
Definition at line 122 of file MeshElementGrid.cpp.
References MeshLib::Mesh::getElements(), OGS_FATAL, and sortElementInGridCells().
|
private |
Definition at line 69 of file MeshElementGrid.h.
Referenced by MeshElementGrid(), getGridCellCoordinates(), getMaxPoint(), and getMinPoint().
|
private |
Definition at line 78 of file MeshElementGrid.h.
Referenced by getElementsInVolume(), and sortElementInGridCells().
|
private |
|
private |
Definition at line 77 of file MeshElementGrid.h.
Referenced by MeshElementGrid(), getElementsInVolume(), getGridCellCoordinates(), and sortElementInGridCells().
|
private |
Definition at line 75 of file MeshElementGrid.h.