ellipsoid_tree 0.1.0
Exact intersection tests for ellipsoids and friends
Loading...
Searching...
No Matches
ellipsoid_tree::SimplexMesh Class Reference

Simplicial mesh in R^d (cells are d-simplices) with point location, closest-point, CG1 evaluation, and ellipsoid queries. More...

#include <ellipsoid_tree/simplex_mesh.hpp>

Public Member Functions

 SimplexMesh (const Eigen::Ref< const Eigen::MatrixXd > &vertices, const Eigen::Ref< const Eigen::MatrixXi > &cells, int num_threads=0)
 Builds a d-simplex mesh from vertex coordinates (dim, num_vertices) and cell vertex-index columns (dim+1, num_cells); the boundary is extracted as the faces belonging to exactly one cell.
 
int dim () const
 Spatial dimension d.
 
int num_vertices () const
 Number of mesh vertices.
 
int num_cells () const
 Number of cells (d-simplices).
 
int num_boundary_faces () const
 Number of boundary faces (faces belonging to exactly one cell).
 
const Eigen::MatrixXd & vertices () const
 Vertex coordinates, shape (dim, num_vertices).
 
const Eigen::MatrixXi & cells () const
 Cell vertex indices, shape (dim+1, num_cells).
 
const Eigen::MatrixXi & boundary_faces () const
 Boundary-face vertex indices, shape (dim, num_boundary_faces).
 
const SimplexTreecell_tree () const
 Underlying spatial index over the cells.
 
const SimplexTreeboundary_face_tree () const
 Underlying spatial index over the boundary faces.
 
std::pair< Eigen::VectorXi, Eigen::MatrixXd > locate_points (const Eigen::Ref< const Eigen::MatrixXd > &points, int num_threads=0) const
 For each query point (column): the index of a containing cell (-1 if outside the mesh) and its barycentric coordinates in that cell (columns of the second output; zero-filled for outside points).
 
Eigen::Array< bool, Eigen::Dynamic, 1 > point_is_in_mesh (const Eigen::Ref< const Eigen::MatrixXd > &points, int num_threads=0) const
 For each query point (column), true if it lies inside the meshed domain (some cell contains it).
 
Eigen::VectorXd closest_point (const Eigen::Ref< const Eigen::VectorXd > &p) const
 Closest point of the meshed domain to p: p itself if p is inside the mesh, otherwise the closest point on the mesh boundary.
 
Eigen::MatrixXd closest_points (const Eigen::Ref< const Eigen::MatrixXd > &points, int num_threads=0) const
 Closest domain point to each query point (column), shape (dim, num_points); see closest_point.
 
Eigen::MatrixXd eval_cg1 (const Eigen::Ref< const Eigen::MatrixXd > &functions_at_vertices, const Eigen::Ref< const Eigen::MatrixXd > &points, bool reflect_exterior=false, int num_threads=0) const
 functions_at_vertices: one function per row, shape (num_functions, num_vertices); points: shape (dim, num_points).
 
std::vector< int > cells_intersecting (const Ellipsoid &E, double tau) const
 Indices of the cells intersecting the ellipsoid E at scale tau.
 
std::vector< std::pair< int, int > > cell_ellipsoid_pairs (const EllipsoidTree &ellipsoids) const
 All (cell, ellipsoid) collision pairs against an EllipsoidTree, via dual-tree traversal.
 
std::vector< std::pair< int, int > > cell_pairs (const SimplexMesh &other) const
 All (cell of this mesh, cell of the other mesh) pairs whose closed cells intersect — the geometric kernel of supermeshing / conservative field transfer between non-matching meshes.
 

Detailed Description

Simplicial mesh in R^d (cells are d-simplices) with point location, closest-point, CG1 evaluation, and ellipsoid queries.

Constructor & Destructor Documentation

◆ SimplexMesh()

ellipsoid_tree::SimplexMesh::SimplexMesh ( const Eigen::Ref< const Eigen::MatrixXd > &  vertices,
const Eigen::Ref< const Eigen::MatrixXi > &  cells,
int  num_threads = 0 
)
inline

Builds a d-simplex mesh from vertex coordinates (dim, num_vertices) and cell vertex-index columns (dim+1, num_cells); the boundary is extracted as the faces belonging to exactly one cell.

Member Function Documentation

◆ dim()

int ellipsoid_tree::SimplexMesh::dim ( ) const
inline

Spatial dimension d.

◆ num_vertices()

int ellipsoid_tree::SimplexMesh::num_vertices ( ) const
inline

Number of mesh vertices.

◆ num_cells()

int ellipsoid_tree::SimplexMesh::num_cells ( ) const
inline

Number of cells (d-simplices).

◆ num_boundary_faces()

int ellipsoid_tree::SimplexMesh::num_boundary_faces ( ) const
inline

Number of boundary faces (faces belonging to exactly one cell).

◆ vertices()

const Eigen::MatrixXd & ellipsoid_tree::SimplexMesh::vertices ( ) const
inline

Vertex coordinates, shape (dim, num_vertices).

◆ cells()

const Eigen::MatrixXi & ellipsoid_tree::SimplexMesh::cells ( ) const
inline

Cell vertex indices, shape (dim+1, num_cells).

◆ boundary_faces()

const Eigen::MatrixXi & ellipsoid_tree::SimplexMesh::boundary_faces ( ) const
inline

Boundary-face vertex indices, shape (dim, num_boundary_faces).

◆ cell_tree()

const SimplexTree & ellipsoid_tree::SimplexMesh::cell_tree ( ) const
inline

Underlying spatial index over the cells.

◆ boundary_face_tree()

const SimplexTree & ellipsoid_tree::SimplexMesh::boundary_face_tree ( ) const
inline

Underlying spatial index over the boundary faces.

◆ locate_points()

std::pair< Eigen::VectorXi, Eigen::MatrixXd > ellipsoid_tree::SimplexMesh::locate_points ( const Eigen::Ref< const Eigen::MatrixXd > &  points,
int  num_threads = 0 
) const
inline

For each query point (column): the index of a containing cell (-1 if outside the mesh) and its barycentric coordinates in that cell (columns of the second output; zero-filled for outside points).

◆ point_is_in_mesh()

Eigen::Array< bool, Eigen::Dynamic, 1 > ellipsoid_tree::SimplexMesh::point_is_in_mesh ( const Eigen::Ref< const Eigen::MatrixXd > &  points,
int  num_threads = 0 
) const
inline

For each query point (column), true if it lies inside the meshed domain (some cell contains it).

◆ closest_point()

Eigen::VectorXd ellipsoid_tree::SimplexMesh::closest_point ( const Eigen::Ref< const Eigen::VectorXd > &  p) const
inline

Closest point of the meshed domain to p: p itself if p is inside the mesh, otherwise the closest point on the mesh boundary.

◆ closest_points()

Eigen::MatrixXd ellipsoid_tree::SimplexMesh::closest_points ( const Eigen::Ref< const Eigen::MatrixXd > &  points,
int  num_threads = 0 
) const
inline

Closest domain point to each query point (column), shape (dim, num_points); see closest_point.

◆ eval_cg1()

Eigen::MatrixXd ellipsoid_tree::SimplexMesh::eval_cg1 ( const Eigen::Ref< const Eigen::MatrixXd > &  functions_at_vertices,
const Eigen::Ref< const Eigen::MatrixXd > &  points,
bool  reflect_exterior = false,
int  num_threads = 0 
) const
inline

functions_at_vertices: one function per row, shape (num_functions, num_vertices); points: shape (dim, num_points).

Returns function values at the points, shape (num_functions, num_points). Points outside the mesh evaluate to zero, unless reflect_exterior is set, in which case they are first reflected across the boundary through their closest boundary point (points whose reflection is still outside give zero).

◆ cells_intersecting()

std::vector< int > ellipsoid_tree::SimplexMesh::cells_intersecting ( const Ellipsoid E,
double  tau 
) const
inline

Indices of the cells intersecting the ellipsoid E at scale tau.

◆ cell_ellipsoid_pairs()

std::vector< std::pair< int, int > > ellipsoid_tree::SimplexMesh::cell_ellipsoid_pairs ( const EllipsoidTree ellipsoids) const
inline

All (cell, ellipsoid) collision pairs against an EllipsoidTree, via dual-tree traversal.

◆ cell_pairs()

std::vector< std::pair< int, int > > ellipsoid_tree::SimplexMesh::cell_pairs ( const SimplexMesh other) const
inline

All (cell of this mesh, cell of the other mesh) pairs whose closed cells intersect — the geometric kernel of supermeshing / conservative field transfer between non-matching meshes.


The documentation for this class was generated from the following file: