|
| template<std::floating_point T, typename U = boost::multiprecision::cpp_bin_float_double_extended> |
| std::array< T, 3 > | compute_distance_gjk (std::span< const T > p0, std::span< const T > q0) |
| | Compute the distance between two convex bodies p0 and q0, each defined by a set of points.
|
| template<std::floating_point T, typename U = boost::multiprecision::cpp_bin_float_double_extended> |
| std::vector< T > | compute_distances_gjk (const std::vector< std::span< const T > > &bodies, std::span< const T > q, int num_threads) |
| | Compute the distance between a sequence of convex bodies p0, ...,
pN and q, each defined by a set of points.
|
| template<std::floating_point T> |
| std::vector< T > | shortest_vector (const mesh::Mesh< T > &mesh, int dim, std::span< const std::int32_t > entities, std::span< const T > points) |
| | Compute the shortest vector from a mesh entity to a point.
|
| template<std::floating_point T> |
| T | compute_squared_distance_bbox (std::span< const T, 6 > b, std::span< const T, 3 > x) |
| | Compute squared distance between point and bounding box.
|
| template<std::floating_point T> |
| std::vector< T > | squared_distance (const mesh::Mesh< T > &mesh, int dim, std::span< const std::int32_t > entities, std::span< const T > points) |
| | Compute the squared distance between a point and a mesh entity.
|
| template<std::floating_point T> |
| BoundingBoxTree< T > | create_midpoint_tree (const mesh::Mesh< T > &mesh, int tdim, std::span< const std::int32_t > entities) |
| | Create a bounding box tree for the midpoints of a subset of entities.
|
| template<std::floating_point T> |
| std::vector< std::int32_t > | compute_collisions (const BoundingBoxTree< T > &tree0, const BoundingBoxTree< T > &tree1) |
| | Compute all collisions between two bounding box trees.
|
| template<std::floating_point T> |
| graph::AdjacencyList< std::int32_t > | compute_collisions (const BoundingBoxTree< T > &tree, std::span< const T > points) |
| | Compute collisions between points and leaf bounding boxes.
|
| template<std::floating_point T> |
| std::int32_t | compute_first_colliding_cell (const mesh::Mesh< T > &mesh, std::span< const std::int32_t > cells, std::array< T, 3 > point, T tol, std::span< T > coordinate_dofs) |
| | Given a set of cells, find the first one that collides with a point.
|
| template<std::floating_point T> |
| std::vector< std::int32_t > | compute_closest_entity (const BoundingBoxTree< T > &tree, const BoundingBoxTree< T > &midpoint_tree, const mesh::Mesh< T > &mesh, std::span< const T > points) |
| | Compute closest mesh entity to a point.
|
| template<std::floating_point T> |
| graph::AdjacencyList< std::int32_t > | compute_colliding_cells (const mesh::Mesh< T > &mesh, const graph::AdjacencyList< std::int32_t > &candidate_cells, std::span< const T > points) |
| | Compute which cells collide with a point.
|
| template<std::floating_point T> |
| PointOwnershipData< T > | determine_point_ownership (const mesh::Mesh< T > &mesh, std::span< const T > points, T padding, std::optional< std::span< const std::int32_t > > cells, bool find_closest_cell=true) |
| | Determine, for a set of points, the owning process of the cell (if any) that contains each point.
|
Geometry data structures and algorithms.
Tools for geometric data structures and operations, e.g. searching.
template<std::floating_point T>
| PointOwnershipData< T > determine_point_ownership |
( |
const mesh::Mesh< T > & | mesh, |
|
|
std::span< const T > | points, |
|
|
T | padding, |
|
|
std::optional< std::span< const std::int32_t > > | cells, |
|
|
bool | find_closest_cell = true ) |
Determine, for a set of points, the owning process of the cell (if any) that contains each point.
A cell is a candidate for a point if the cell's bounding box, padded by padding, contains the point. Each candidate is then tested for actual containment of the point with the GJK algorithm. If no candidate actually contains a point, the point is either left unowned or, if find_closest_cell is true, assigned to the candidate cell closest to it (by GJK distance).
- Parameters
-
| [in] | mesh | The mesh |
| [in] | points | Points to check for collision (shape=(num_points,
3)). Storage is row-major. |
| [in] | padding | Amount of absolute padding applied to each cell's bounding box before searching for candidate cells/processes. Increasing padding increases the number of cells considered as candidates for a point; it does not by itself decide whether a point with no actually-containing cell is assigned an owner, which is controlled by find_closest_cell. |
| [in] | cells | Cells to check for ownership |
| [in] | find_closest_cell | If true (default), a point not actually contained in any candidate cell is instead assigned to the process owning the candidate cell closest to it. If false, such a point is left unowned. |
- Returns
- Point ownership data.
- Note
- dest_owner is sorted
-
An entry of src_owner is -1 if the corresponding point was not contained in any candidate cell and, if find_closest_cell is true, had no candidate cell to fall back on either (e.g. because padding was too small).
-
dest_points is flattened row-major, shape (dest_owner.size(),
3)
-
With find_closest_cell set to true, a large padding value can increase the runtime of the function by orders of magnitude, since a point not contained in any candidate then requires a GJK distance computation against every candidate cell across all processes with an intersecting bounding box.
-
find_closest_cell must be the same on every rank of mesh.comm(): it gates collective MPI calls, so ranks disagreeing on its value will deadlock.