Graphite  Version 3
An experimental 3D geometry processing program
GEO::MeshCells Class Reference

The cells of a mesh. More...

#include <geogram/mesh/mesh.h>

Inheritance diagram for GEO::MeshCells:
GEO::MeshCellsStore GEO::MeshElements GEO::MeshSubElementsStore

Public Member Functions

 MeshCells (Mesh &mesh)
 MeshCells constructor. More...
 
index_t nb_vertices (index_t c) const
 Gets the number of vertices of a cell. More...
 
index_t vertex (index_t c, index_t lv) const
 Gets a vertex of a cell by local vertex index. More...
 
void set_vertex (index_t c, index_t lv, index_t v)
 Sets a vertex of a cell by local vertex index. More...
 
index_t adjacent (index_t c, index_t lf) const
 Gets a cell adjacent to another one by local facet index. More...
 
void set_adjacent (index_t c, index_t lf, index_t c2)
 Sets a cell adjacent to another one by local facet index. More...
 
index_t facet_nb_vertices (index_t c, index_t lf) const
 Gets the number of vertices in a cell facet. More...
 
index_t facet_vertex (index_t c, index_t lf, index_t lv) const
 Gets a vertex of a cell by local facet index and local vertex index in the facet. More...
 
index_t facet_corner (index_t c, index_t lf, index_t lc) const
 Gets a corner of a cell by local facet index and local corner index in the facet. More...
 
index_t edge_vertex (index_t c, index_t le, index_t lv) const
 Gets a cell vertex by local edge index and local vertex index in the edge. More...
 
index_t edge_adjacent_facet (index_t c, index_t le, index_t lf) const
 Gets a cell local facet index by local edge index and local facet index in the edge. More...
 
index_range corners (index_t c) const
 Gets the corners of a cell. More...
 
void clear (bool keep_attributes=true, bool keep_memory=false) override
 Removes all the elements and attributes. More...
 
void delete_elements (vector< index_t > &to_delete, bool remove_isolated_vertices=true) override
 Deletes a set of elements. More...
 
void permute_elements (vector< index_t > &permutation) override
 Applies a permutation to the elements and their attributes. More...
 
index_t create_cells (index_t nb_cells, MeshCellType type)
 Creates a contiguous chunk of cells of the same type. More...
 
index_t create_tets (index_t nb_tets)
 Creates a contiguous chunk of tetrahedra. More...
 
index_t create_hexes (index_t nb_hexes)
 Creates a contiguous chunk of hexahedra. More...
 
index_t create_prisms (index_t nb_prisms)
 Creates a contiguous chunk of prisms. More...
 
index_t create_pyramids (index_t nb_pyramids)
 Creates a contiguous chunk of pyramids. More...
 
index_t create_tet (index_t v1, index_t v2, index_t v3, index_t v4, index_t adj1=NO_CELL, index_t adj2=NO_CELL, index_t adj3=NO_CELL, index_t adj4=NO_CELL)
 Creates a tetrahedron. More...
 
index_t create_hex (index_t v1, index_t v2, index_t v3, index_t v4, index_t v5, index_t v6, index_t v7, index_t v8, index_t adj1=NO_CELL, index_t adj2=NO_CELL, index_t adj3=NO_CELL, index_t adj4=NO_CELL, index_t adj5=NO_CELL, index_t adj6=NO_CELL)
 Creates an hexahedron. More...
 
index_t create_prism (index_t v1, index_t v2, index_t v3, index_t v4, index_t v5, index_t v6, index_t adj1=NO_CELL, index_t adj2=NO_CELL, index_t adj3=NO_CELL, index_t adj4=NO_CELL, index_t adj5=NO_CELL)
 Creates a prism. More...
 
index_t create_pyramid (index_t v1, index_t v2, index_t v3, index_t v4, index_t v5, index_t adj1=NO_CELL, index_t adj2=NO_CELL, index_t adj3=NO_CELL, index_t adj4=NO_CELL, index_t adj5=NO_CELL)
 Creates a pyramid. More...
 
index_t create_connector (index_t v1, index_t v2, index_t v3, index_t v4, index_t adj1=NO_CELL, index_t adj2=NO_CELL, index_t adj3=NO_CELL)
 Creates a connector. More...
 
void connect (bool remove_trivial_slivers=true, bool verbose_if_OK=false)
 Connects the cells. More...
 
void compute_borders ()
 Replaces the surfacic part of this mesh with the borders of the volumetric part.
 
void compute_borders (Attribute< index_t > &facet_cell)
 Replaces the surfacic part of this mesh with the borders of the volumetric part. More...
 
void assign_tet_mesh (coord_index_t dim, vector< double > &vertices, vector< index_t > &tets, bool steal_args)
 Copies a tetrahedron mesh into this Mesh. More...
 
void assign_tet_mesh (vector< index_t > &tets, bool steal_args)
 Copies a tetrahedron mesh into this Mesh. More...
 
void pop () override
 Removes the last element.
 
index_t tet_adjacent (index_t t, index_t lf) const
 
index_t find_tet_adjacent (index_t t, index_t t2) const
 
index_t tet_vertex (index_t t, index_t lv) const
 
index_t find_tet_vertex (index_t t, index_t v) const
 
index_t tet_facet_vertex (index_t t, index_t lf, index_t lv) const
 Gets a vertex of a tetrahedron by local facet index and local vertex index in facet. More...
 
index_t find_tet_facet (index_t t, index_t v1, index_t v2, index_t v3) const
 Finds the local index of a facet in a tetrahedron by the global indices of its vertices. More...
 
- Public Member Functions inherited from GEO::MeshCellsStore
 MeshCellsStore (Mesh &mesh)
 
bool are_simplices () const
 Tests whether all the cells are tetrahedra. More...
 
MeshCellType type (index_t c) const
 Gets the type of a cell. More...
 
const CellDescriptordescriptor (index_t c) const
 Gets the descriptor of a cell. More...
 
index_t nb_corners (index_t c) const
 Gets the number of corners of a cell. More...
 
index_t corners_begin (index_t c) const
 Gets the first element for iterating over the corners of a cell. More...
 
index_t corners_end (index_t c) const
 Gets the upper limit for iterating over the corners of a cell. More...
 
index_t corner (index_t c, index_t lv) const
 Gets a corner of a cell by local vertex index. More...
 
index_t nb_facets (index_t c) const
 Gets the number of facets of a cell. More...
 
index_t facets_begin (index_t c) const
 Gets the first element for iterating over the facets of a cell. More...
 
index_t facets_end (index_t c) const
 Gets the upper limit for iterating over the facets of a cell. More...
 
index_t facet (index_t c, index_t lf) const
 Gets a facet of a cell by local facet index. More...
 
index_t nb_edges (index_t c) const
 Gets the number of edges in a cell. More...
 
- Public Member Functions inherited from GEO::MeshSubElementsStore
 MeshSubElementsStore (Mesh &mesh)
 Constructs a new MeshSubElementStore. More...
 
virtual ~MeshSubElementsStore ()
 MeshElementStore destructor.
 
index_t nb () const
 Gets the number of (sub-)elements. More...
 
AttributesManagerattributes () const
 Gets the attributes manager. More...
 
index_as_iterator begin () const
 Used by range-based for. More...
 
index_as_iterator end () const
 Used by range-based for. More...
 

Static Public Member Functions

static index_t local_tet_facet_vertex_index (index_t lf, index_t lv)
 Gives the local index of a vertex in a tetrahedron from its facet and vertex local indices. More...
 
- Static Public Member Functions inherited from GEO::MeshCellsStore
static const CellDescriptorcell_type_to_cell_descriptor (MeshCellType t)
 Gets a descriptor by cell type. More...
 

Protected Member Functions

void is_not_simplicial ()
 Indicates that the stored elements are no longer only tetrahedra. More...
 
bool facets_match (index_t c1, index_t f1, index_t c2, index_t f2) const
 Tests whether two cell facets can be connected. More...
 
index_t find_cell_vertex (index_t c, index_t v) const
 Finds the local index of a vertex in a cell. More...
 
index_t find_cell_facet (index_t c1, index_t c2, index_t f2) const
 Finds the local index of a facet in a cell that can be connected to a facet of another cell. More...
 
bool triangular_facet_matches_quad_facet (index_t c1, index_t lf1, index_t c2, index_t lf2) const
 Tests whether a triangular facet matches a quad facet. More...
 
bool triangular_facets_have_common_edge (index_t c1, index_t f1, index_t c2, index_t f2, index_t &e1, index_t &e2) const
 Tests whether two triangular cell facets have a common edge. More...
 
bool create_connector (index_t c1, index_t lf1, const std::vector< std::pair< index_t, index_t > > &matches)
 Creates a connector between a quadrandular facet and two triangular facets. More...
 
void connect_tets ()
 Optimized implementation of connect() used when the mesh is simplicial.
 
- Protected Member Functions inherited from GEO::MeshCellsStore
void clear_store (bool keep_attributes, bool keep_memory=false) override
 Removes all the elements and attributes. More...
 
void resize_store (index_t new_size) override
 Resizes this MeshSubElementsStore. More...
 
index_t create_sub_element (MeshCellType type)
 
index_t create_sub_elements (index_t nb, MeshCellType type)
 
void copy (const MeshCellsStore &rhs, bool copy_attributes=true)
 
- Protected Member Functions inherited from GEO::MeshSubElementsStore
void reserve_store (index_t nb_to_reserve)
 Reserves space for new elements. More...
 
index_t create_sub_elements (index_t nb)
 Creates a contiguous chunk of attributes for sub-elements. More...
 
index_t create_sub_element ()
 Creates attributes for a sub-element. More...
 
void adjust_store ()
 Makes the size of the store tightly match the number of the elements. More...
 
void copy (const MeshSubElementsStore &rhs, bool copy_attributes=true)
 Copies a MeshSubElementsStore into this one. More...
 

Protected Attributes

MeshVerticesvertices_
 
MeshCellCornersStorecell_corners_
 
MeshCellFacetsStorecell_facets_
 
- Protected Attributes inherited from GEO::MeshCellsStore
bool is_simplicial_
 
vector< Numeric::uint8cell_type_
 
vector< index_tcell_ptr_
 
- Protected Attributes inherited from GEO::MeshSubElementsStore
Meshmesh_
 
AttributesManager attributes_
 
index_t nb_
 

Friends

class Mesh
 
class GeogramIOHandler
 

Additional Inherited Members

- Static Protected Member Functions inherited from GEO::MeshElements
static bool has_non_zero (const GEO::vector< index_t > &I)
 Tests whether a vector contains a non-zero value. More...
 

Detailed Description

The cells of a mesh.

Definition at line 1927 of file mesh.h.

Constructor & Destructor Documentation

◆ MeshCells()

GEO::MeshCells::MeshCells ( Mesh mesh)

MeshCells constructor.

Parameters
[in]meshthe mesh this MeshCells is attached to

Member Function Documentation

◆ adjacent()

index_t GEO::MeshCells::adjacent ( index_t  c,
index_t  lf 
) const
inline

Gets a cell adjacent to another one by local facet index.

Parameters
[in]cthe cell, in 0..nb()-1
[in]lflocal facet index, in 0..nb_facets(c)-1
Returns
the cell adjacent to c along facet lf or NO_CELL if no such cell exists

Definition at line 1971 of file mesh.h.

◆ assign_tet_mesh() [1/2]

void GEO::MeshCells::assign_tet_mesh ( coord_index_t  dim,
vector< double > &  vertices,
vector< index_t > &  tets,
bool  steal_args 
)

Copies a tetrahedron mesh into this Mesh.

Tetrahedron adjacences are not computed.

Parameters
[in]dimdimension of the vertices
[in]verticescoordinates of the vertices
[in]tetstetrahedron to vertex links
[in]steal_argsif set, vertices and tets are 'stolen' from the arguments (using vector::swap).

◆ assign_tet_mesh() [2/2]

void GEO::MeshCells::assign_tet_mesh ( vector< index_t > &  tets,
bool  steal_args 
)

Copies a tetrahedron mesh into this Mesh.

Tetrahedron adjacences are not computed.

Parameters
[in]tetstetrahedron to vertex links
[in]steal_argsif set, vertices and tets are 'stolen' from the arguments (using vector::swap).

◆ clear()

void GEO::MeshCells::clear ( bool  keep_attributes = true,
bool  keep_memory = false 
)
overridevirtual

Removes all the elements and attributes.

Parameters
[in]keep_attributesif true, then all the existing attribute names / bindings are kept (but they are cleared). If false, they are destroyed.
[in]keep_memoryif true, then memory is kept and can be reused by subsequent mesh element creations.

Implements GEO::MeshElements.

◆ compute_borders()

void GEO::MeshCells::compute_borders ( Attribute< index_t > &  facet_cell)

Replaces the surfacic part of this mesh with the borders of the volumetric part.

Parameters
[out]facet_cellon exit, stores the index of the cell adjacent to the facet on the border.

◆ connect()

void GEO::MeshCells::connect ( bool  remove_trivial_slivers = true,
bool  verbose_if_OK = false 
)

Connects the cells.

This creates as needed the connectors that represent non-conformal connections between a quadrilateral facet and two triangular facets.

Parameters
[in]remove_trivial_sliversif set, this removes the slivers that are adjacent to a quadrilateral facet.
[in]verbose_if_OKif set, says OK if no bad connector configuration was detected.

◆ corners()

index_range GEO::MeshCells::corners ( index_t  c) const
inline

Gets the corners of a cell.

Parameters
[in]cthe index of the cell.
Returns
a range with all the corners of the facet.

Definition at line 2061 of file mesh.h.

◆ create_cells()

index_t GEO::MeshCells::create_cells ( index_t  nb_cells,
MeshCellType  type 
)
inline

Creates a contiguous chunk of cells of the same type.

Parameters
[in]nb_cellsnumber of cells to create
[in]typetype of the cells to create, one of MESH_TET, MESH_HEX, MESH_PRISM, MESH_PYRAMID, MESH_CONNECTOR.
Returns
the first created cell

Definition at line 2088 of file mesh.h.

◆ create_connector() [1/2]

bool GEO::MeshCells::create_connector ( index_t  c1,
index_t  lf1,
const std::vector< std::pair< index_t, index_t > > &  matches 
)
protected

Creates a connector between a quadrandular facet and two triangular facets.

This function is used by connect_cells()

Parameters
[in]c1index of the cell that has the quadrangular facet
[in]lf1index of the quadrangular facet in c1
[in]matchesa const reference to a vector of (cell index, facet index) pairs that are candidate triangles to be connected to the quadrangular facet. Each of them has three vertices in common with the quadrangular facet. It may contain more than two (cell,facet) index pairs. In this case, among them we select the pair of triangular facets that have an edge in common.
Return values
trueif a connector was created. A connector is created if among the candidate triangular facets there are exactly two facets on the border with an edge in common.
falseotherwise

◆ create_connector() [2/2]

index_t GEO::MeshCells::create_connector ( index_t  v1,
index_t  v2,
index_t  v3,
index_t  v4,
index_t  adj1 = NO_CELL,
index_t  adj2 = NO_CELL,
index_t  adj3 = NO_CELL 
)
inline

Creates a connector.

Connector are automatically created by connect() (most client codes do not use this function)

Parameters
[in]v1,v2,v3,v4the vertices of the connector all in 0 .. mesh.vertices.nb()-1
[in]adj1,adj2,adj3adjacent cells, or NO_CELL if unspecified / on border
Returns
the created connector

Definition at line 2326 of file mesh.h.

◆ create_hex()

index_t GEO::MeshCells::create_hex ( index_t  v1,
index_t  v2,
index_t  v3,
index_t  v4,
index_t  v5,
index_t  v6,
index_t  v7,
index_t  v8,
index_t  adj1 = NO_CELL,
index_t  adj2 = NO_CELL,
index_t  adj3 = NO_CELL,
index_t  adj4 = NO_CELL,
index_t  adj5 = NO_CELL,
index_t  adj6 = NO_CELL 
)
inline

Creates an hexahedron.

Parameters
[in]v1,v2,v3,v4,v5,v6,v7,v8the vertices of the hexahedron, all in 0 .. mesh.vertices.nb()-1
[in]adj1,adj2,adj3,adj4,adj5,adj6adjacent cells, or NO_CELL if unspecified / on border
Returns
the created hexahedron

Definition at line 2209 of file mesh.h.

◆ create_hexes()

index_t GEO::MeshCells::create_hexes ( index_t  nb_hexes)
inline

Creates a contiguous chunk of hexahedra.

Parameters
[in]nb_hexesnumber of hexahedra to create
Returns
the first created hexahedron

Definition at line 2147 of file mesh.h.

◆ create_prism()

index_t GEO::MeshCells::create_prism ( index_t  v1,
index_t  v2,
index_t  v3,
index_t  v4,
index_t  v5,
index_t  v6,
index_t  adj1 = NO_CELL,
index_t  adj2 = NO_CELL,
index_t  adj3 = NO_CELL,
index_t  adj4 = NO_CELL,
index_t  adj5 = NO_CELL 
)
inline

Creates a prism.

Parameters
[in]v1,v2,v3,v4,v5,v6the vertices of the prism all in 0 .. mesh.vertices.nb()-1
[in]adj1,adj2,adj3,adj4,adj5adjacent cells, or NO_CELL if unspecified / on border
Returns
the created prism

Definition at line 2251 of file mesh.h.

◆ create_prisms()

index_t GEO::MeshCells::create_prisms ( index_t  nb_prisms)
inline

Creates a contiguous chunk of prisms.

Parameters
[in]nb_prismsnumber of prisms to create
Returns
the first created prism

Definition at line 2156 of file mesh.h.

◆ create_pyramid()

index_t GEO::MeshCells::create_pyramid ( index_t  v1,
index_t  v2,
index_t  v3,
index_t  v4,
index_t  v5,
index_t  adj1 = NO_CELL,
index_t  adj2 = NO_CELL,
index_t  adj3 = NO_CELL,
index_t  adj4 = NO_CELL,
index_t  adj5 = NO_CELL 
)
inline

Creates a pyramid.

Parameters
[in]v1,v2,v3,v4,v5the vertices of the pyramid all in 0 .. mesh.vertices.nb()-1
[in]adj1,adj2,adj3,adj4,adj5adjacent cells, or NO_CELL if unspecified / on border
Returns
the created pyramid

Definition at line 2289 of file mesh.h.

◆ create_pyramids()

index_t GEO::MeshCells::create_pyramids ( index_t  nb_pyramids)
inline

Creates a contiguous chunk of pyramids.

Parameters
[in]nb_pyramidsnumber of pyramids to create
Returns
the first created pyramid

Definition at line 2165 of file mesh.h.

◆ create_tet()

index_t GEO::MeshCells::create_tet ( index_t  v1,
index_t  v2,
index_t  v3,
index_t  v4,
index_t  adj1 = NO_CELL,
index_t  adj2 = NO_CELL,
index_t  adj3 = NO_CELL,
index_t  adj4 = NO_CELL 
)
inline

Creates a tetrahedron.

Parameters
[in]v1,v2,v3,v4the vertices of the tetrahedron, all in 0 .. mesh.vertices.nb()-1
[in]adj1,adj2,adj3,adj4adjacent cells, or NO_CELL if unspecified / on border
Returns
the created tetrahedron

Definition at line 2177 of file mesh.h.

◆ create_tets()

index_t GEO::MeshCells::create_tets ( index_t  nb_tets)
inline

Creates a contiguous chunk of tetrahedra.

Parameters
[in]nb_tetsnumber of tetrahedra to create
Returns
the first created tetrahedron

Definition at line 2138 of file mesh.h.

◆ delete_elements()

void GEO::MeshCells::delete_elements ( vector< index_t > &  to_delete,
bool  remove_isolated_vertices = true 
)
overridevirtual

Deletes a set of elements.

Parameters
[in]to_deletea vector of size nb(). If to_delete[e] is different from 0, then element e will be destroyed, else it will be kept. On exit, to_delete is modified (it is used for internal bookkeeping).
[in]remove_isolated_verticesif true, then the vertices that are no longer incident to any element are deleted.

Implements GEO::MeshElements.

◆ edge_adjacent_facet()

index_t GEO::MeshCells::edge_adjacent_facet ( index_t  c,
index_t  le,
index_t  lf 
) const
inline

Gets a cell local facet index by local edge index and local facet index in the edge.

Parameters
[in]cthe cell, in 0..nb()-1
[in]lethe local edge index, in 0..nb_edges(c)-1
[in]lfthe local index in the edge, one of 0,1
Returns
the local facet index of the facet adjacent to the edge.
  • If lf=0, it gets the facet on the left of the oriented edge.
  • If lf=1, it gets the facet on the right of the oriented edge.

Definition at line 2050 of file mesh.h.

◆ edge_vertex()

index_t GEO::MeshCells::edge_vertex ( index_t  c,
index_t  le,
index_t  lv 
) const
inline

Gets a cell vertex by local edge index and local vertex index in the edge.

Parameters
[in]cthe cell, in 0..nb()-1
[in]lethe local edge index, in 0..nb_edges(c)-1
[in]lvthe local index in the edge, one of 0,1
Returns
vertex lv of edge le in cell c

Definition at line 2032 of file mesh.h.

◆ facet_corner()

index_t GEO::MeshCells::facet_corner ( index_t  c,
index_t  lf,
index_t  lc 
) const
inline

Gets a corner of a cell by local facet index and local corner index in the facet.

Parameters
[in]cthe cell, in 0..nb()-1
[in]lfthe local facet index, in 0..nb_facets(c)-1
[in]lcthe local corner index, in 0..facet_nb_vertices(c,lf)-1
Returns
corner lc of facet lf in cell c

Definition at line 2019 of file mesh.h.

◆ facet_nb_vertices()

index_t GEO::MeshCells::facet_nb_vertices ( index_t  c,
index_t  lf 
) const
inline

Gets the number of vertices in a cell facet.

Parameters
[in]cthe cell, in 0..nb()-1
[in]lfthe local facet index, in 0..nb_facets(c)-1
Returns
the number of vertices of facet lf in cell c

Definition at line 1992 of file mesh.h.

◆ facet_vertex()

index_t GEO::MeshCells::facet_vertex ( index_t  c,
index_t  lf,
index_t  lv 
) const
inline

Gets a vertex of a cell by local facet index and local vertex index in the facet.

Parameters
[in]cthe cell, in 0..nb()-1
[in]lfthe local facet index, in 0..nb_facets(c)-1
[in]lvthe local vertex index, in 0..facet_nb_vertices(c,lf)-1
Returns
vertex lv of facet lf in cell c

Definition at line 2005 of file mesh.h.

◆ facets_match()

bool GEO::MeshCells::facets_match ( index_t  c1,
index_t  f1,
index_t  c2,
index_t  f2 
) const
protected

Tests whether two cell facets can be connected.

Two cell facets can be connected if they have the same vertices in reverse order.

Parameters
[in]c1index of the first cell
[in]f1index of the first facet in c1
[in]c2index of the second cell
[in]f2index of the second facet in c2
Return values
trueif c1 and c2 can be connected by f1 and f2
falseotherwise

◆ find_cell_facet()

index_t GEO::MeshCells::find_cell_facet ( index_t  c1,
index_t  c2,
index_t  f2 
) const
inlineprotected

Finds the local index of a facet in a cell that can be connected to a facet of another cell.

Parameters
[in]c1index of the cell
[in]c2index of the other cell
[in]f2facet of the other cell
Returns
the local index (in 0 .. cell_nb_facets(c1)) of the facet of c1 that has the same vertices as f2 in c2 in reverse order, modulo a circular permutation, or NO_FACET if such a facet does not exist in c1.

Definition at line 2578 of file mesh.h.

◆ find_cell_vertex()

index_t GEO::MeshCells::find_cell_vertex ( index_t  c,
index_t  v 
) const
inlineprotected

Finds the local index of a vertex in a cell.

Parameters
[in]cindex of the cell
[in]vglobal index of the vertex
Returns
the local index (in 0..cell_nb_vertices(c)-1) of the vertex in cell c or NO_VERTEX if c is not incident to v

Definition at line 2556 of file mesh.h.

◆ find_tet_facet()

index_t GEO::MeshCells::find_tet_facet ( index_t  t,
index_t  v1,
index_t  v2,
index_t  v3 
) const
inline

Finds the local index of a facet in a tetrahedron by the global indices of its vertices.

Parameters
[in]tindex of the tetrahedron
[in]v1global index of the first vertex
[in]v2global index of the second vertex
[in]v3global index of the third vertex
Returns
the local index (0,1,2 or 3) of the facet of t that has v1, v2, v3 as vertices modulo a circular permutation, or NO_FACET if such a facet does not exist in t.
Precondition
are_simplices()

Definition at line 2481 of file mesh.h.

◆ is_not_simplicial()

void GEO::MeshCells::is_not_simplicial ( )
inlineprotected

Indicates that the stored elements are no longer only tetrahedra.

Creates the cell pointers and cell types for the pre-existing cells if any.

Definition at line 2522 of file mesh.h.

◆ local_tet_facet_vertex_index()

static index_t GEO::MeshCells::local_tet_facet_vertex_index ( index_t  lf,
index_t  lv 
)
inlinestatic

Gives the local index of a vertex in a tetrahedron from its facet and vertex local indices.

Parameters
[in]lflocal facet index (0,1,2 or 3)
[in]lvlocal vertex index in lf (0,1 or 2)
Returns
the local vertex index (0,1,2 or 3) of the lvth vertex in facet lf

Definition at line 2508 of file mesh.h.

◆ nb_vertices()

index_t GEO::MeshCells::nb_vertices ( index_t  c) const
inline

Gets the number of vertices of a cell.

Parameters
[in]ca cell, in 0..nb()-1
Returns
the number of vertices of cell c

Definition at line 1940 of file mesh.h.

◆ permute_elements()

void GEO::MeshCells::permute_elements ( vector< index_t > &  permutation)
overridevirtual

Applies a permutation to the elements and their attributes.

On exit, permutation is modified (used for internal bookkeeping). Applying a permutation permutation is equivalent to:

for(i=0; i<permutation.size(); i++) {
data2[i] = data[permutation[i]]
}
data = data2 ;

Implements GEO::MeshElements.

◆ set_adjacent()

void GEO::MeshCells::set_adjacent ( index_t  c,
index_t  lf,
index_t  c2 
)
inline

Sets a cell adjacent to another one by local facet index.

Parameters
[in]cthe cell, in 0..nb()-1
[in]lflocal facet index, in 0..nb_facets(c)-1
[in]c2specifies the cell adjacent to c along facet lf or NO_CELL if no such cell exists

Definition at line 1982 of file mesh.h.

◆ set_vertex()

void GEO::MeshCells::set_vertex ( index_t  c,
index_t  lv,
index_t  v 
)
inline

Sets a vertex of a cell by local vertex index.

Parameters
[in]cthe cell, in 0..nb()-1
[in]lvlocal vertex index, in 0..nb_vertices(c)-1
[in]vspecifies the vertex lv of cell c

Definition at line 1960 of file mesh.h.

◆ tet_facet_vertex()

index_t GEO::MeshCells::tet_facet_vertex ( index_t  t,
index_t  lf,
index_t  lv 
) const
inline

Gets a vertex of a tetrahedron by local facet index and local vertex index in facet.

Parameters
[in]tglobal index of the tetrahedron
[in]lflocal facet index (0,1,2 or 3)
[in]lvlocal vertex index in facet (0,1 or 2)
Returns
the global index of vertex lv in facet lf of tetrahedron t
Precondition
are_simplices()

Definition at line 2456 of file mesh.h.

◆ triangular_facet_matches_quad_facet()

bool GEO::MeshCells::triangular_facet_matches_quad_facet ( index_t  c1,
index_t  lf1,
index_t  c2,
index_t  lf2 
) const
protected

Tests whether a triangular facet matches a quad facet.

Used to detect non-conformal configurations that should be resolved by a connector.

Parameters
[in]c1index of the first cell
[in]lf1index of a triangular facet in c1
[in]c2index of the second cell
[in]lf2index of a quadrangular facet in c2
Return values
trueif the three vertices of f1 appear in f2 in reverse order
falseotherwise

◆ triangular_facets_have_common_edge()

bool GEO::MeshCells::triangular_facets_have_common_edge ( index_t  c1,
index_t  f1,
index_t  c2,
index_t  f2,
index_t e1,
index_t e2 
) const
protected

Tests whether two triangular cell facets have a common edge.

Parameters
[in]c1index of the first cell
[in]f1index of a triangular facet of c1
[in]c2index of the second cell
[in]f2index of a triangular facet of c2
[out]e1index of the common edge in f1 or NO_EDGE if no such edge exists
[out]e2index of the common edge in f2 or NO_EDGE if no such edge exists
Return values
trueif f1 and f2 have a common edge
falseotherwise

◆ vertex()

index_t GEO::MeshCells::vertex ( index_t  c,
index_t  lv 
) const
inline

Gets a vertex of a cell by local vertex index.

Parameters
[in]cthe cell, in 0..nb()-1
[in]lvlocal vertex index, in 0..nb_vertices(c)-1
Returns
the vertex lv of cell c

Definition at line 1950 of file mesh.h.


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