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 32 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 24 of file MeshElementGrid.cpp.
|
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 44 of file MeshElementGrid.h.
References _elements_in_grid_box, _n_steps, and getGridCellCoordinates().
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 208 of file MeshElementGrid.cpp.
References _aabb, _inverse_step_sizes, _n_steps, GeoLib::AABB::getMaxPoint(), and GeoLib::AABB::getMinPoint().
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 124 of file MeshElementGrid.cpp.
References _aabb, and GeoLib::AABB::getMaxPoint().
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 119 of file MeshElementGrid.cpp.
References _aabb, and GeoLib::AABB::getMinPoint().
Referenced by MeshGeoToolsLib::getCandidateElementsForLineSegmentIntersection().
|
private |
Definition at line 141 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 129 of file MeshElementGrid.cpp.
References MeshLib::Mesh::getElements(), OGS_FATAL, and sortElementInGridCells().
|
private |
Definition at line 77 of file MeshElementGrid.h.
Referenced by getGridCellCoordinates(), getMaxPoint(), and getMinPoint().
|
private |
Definition at line 86 of file MeshElementGrid.h.
Referenced by getElementsInVolume(), and sortElementInGridCells().
|
private |
|
private |
Definition at line 85 of file MeshElementGrid.h.
Referenced by getElementsInVolume(), getGridCellCoordinates(), and sortElementInGridCells().
|
private |
Definition at line 83 of file MeshElementGrid.h.