Lagrange
|
This class is used to navigate elements of a mesh. More...
#include <lagrange/MeshNavigation.h>
Public Member Functions | |
MeshNavigation (const MeshType &mesh) | |
Index | get_num_edges () const |
Gets the number of edges. More... | |
Index | get_edge (Index f, Index lv) const |
Gets the edge index corresponding to (f, lv) – (f, lv+1). More... | |
Index | get_edge_from_corner (Index c) const |
Gets the edge index corresponding to a corner index. More... | |
Index | get_first_corner_around_edge (Index e) const |
Get the index of the first corner around a given edge. More... | |
Index | get_next_corner_around_edge (Index c) const |
Gets the next corner around the edge associated to a corner. More... | |
Index | get_first_corner_around_vertex (Index v) const |
Get the index of the first corner around a given vertex. More... | |
Index | get_next_corner_around_vertex (Index c) const |
Gets the next corner around the vertex associated to a corner. More... | |
std::array< Index, 2 > | get_edge_vertices (const FacetArray &facets, Index e) const |
Retrieve edge endpoints. More... | |
Index | get_vertex_opposite_edge (const FacetArray &facets, Index e) const |
Returns a vertex id opposite the edge. More... | |
Index | get_num_facets_around_vertex (Index v) const |
Count the number of facets incident to a given vertex. More... | |
Index | get_num_facets_around_edge (Index e) const |
Count the number of facets incident to a given edge. More... | |
Index | get_one_facet_around_edge (Index e) const |
Get the index of one facet around a given edge. More... | |
Index | get_one_corner_around_edge (Index e) const |
Get the index of one corner around a given edge. More... | |
Index | get_one_corner_around_vertex (Index v) const |
Get the index of one corner around a given vertex. More... | |
bool | is_boundary_edge (Index e) const |
Determines whether the specified edge e is a boundary edge. More... | |
bool | is_boundary_vertex (Index v) const |
Determines whether the specified vertex v is a boundary vertex. More... | |
template<typename Func > | |
void | foreach_facets_around_vertex (Index v, Func func) const |
Applies a function to each facet around a prescribed vertex. More... | |
template<typename Func > | |
void | foreach_facets_around_edge (Index e, Func func) const |
Applies a function to each facet around a prescribed edge. More... | |
template<typename Func > | |
void | foreach_corners_around_vertex (Index v, Func func) const |
Applies a function to each corner around a prescribed vertex. More... | |
template<typename Func > | |
void | foreach_corners_around_edge (Index e, Func func) const |
Applies a function to each corner around a prescribed edge. More... | |
Protected Member Functions | |
void | initialize (const MeshType &mesh) |
This class is used to navigate elements of a mesh.
By chaining facet corners around vertices and edges, this class is able to provide efficient iteration over incident facets of a vertex/edge, as well as detect boundary edges/vertices.
MeshType | Mesh type. |
|
inline |
Gets the number of edges.
|
inline |
Gets the edge index corresponding to (f, lv) – (f, lv+1).
[in] | f | Facet index. |
[in] | lv | Local vertex index [0, get_vertex_per_facet()[. |
|
inline |
Gets the edge index corresponding to a corner index.
Given a face (v0, v1, v2) with associated corners (c0, c1, c2), the edge associated to corner ci is the edge between (vi, vi+1), as determined by the corner_to_edge_mapping function.
[in] | c | Corner index. |
|
inline |
Get the index of the first corner around a given edge.
[in] | e | Queried edge index. |
|
inline |
Gets the next corner around the edge associated to a corner.
If the corner is the last one in the chain, this function returns invalid<Index>.
[in] | c | Corner index. |
|
inline |
Get the index of the first corner around a given vertex.
[in] | v | Queried vertex index. |
|
inline |
Gets the next corner around the vertex associated to a corner.
If the corner is the last one in the chain, this function returns invalid<Index>.
[in] | c | Corner index. |
|
inline |
Retrieve edge endpoints.
[in] | facets | #F x k array of facet indices. |
[in] | e | Queried edge index. |
|
inline |
Returns a vertex id opposite the edge.
If the edge is a boundary edge, there is only one incident facet f, and the returned vertex will the vertex id opposite e on facet f. Otherwise, the returned vertex will be a vertex opposite e on a arbitrary incident facet f.
[in] | facets | #F x k array of facet indices. |
[in] | e | Queried edge index. |
|
inline |
Count the number of facets incident to a given vertex.
[in] | v | Queried vertex index. |
|
inline |
Count the number of facets incident to a given edge.
[in] | e | Queried edge index. |
|
inline |
Get the index of one facet around a given edge.
[in] | e | Queried edge index. |
|
inline |
Get the index of one corner around a given edge.
[in] | e | Queried edge index. |
|
inline |
Get the index of one corner around a given vertex.
[in] | v | Queried vertex index. |
|
inline |
Determines whether the specified edge e is a boundary edge.
[in] | e | Queried edge index. |
|
inline |
Determines whether the specified vertex v is a boundary vertex.
[in] | v | Queried vertex index. |
|
inline |
Applies a function to each facet around a prescribed vertex.
[in] | v | Queried vertex index. |
[in] | func | Callback to apply to each incident facet. |
Func | A callable function of type Index -> void. |
|
inline |
Applies a function to each facet around a prescribed edge.
[in] | e | Queried edge index. |
[in] | func | Callback to apply to each incident facet. |
Func | A callable function of type Index -> void. |
|
inline |
Applies a function to each corner around a prescribed vertex.
[in] | v | Queried vertex index. |
[in] | func | Callback to apply to each incident facet. |
Func | A callable function of type Index -> void. |
|
inline |
Applies a function to each corner around a prescribed edge.
[in] | e | Queried edge index. |
[in] | func | Callback to apply to each incident facet. |
Func | A callable function of type Index -> void. |