PolyFEM
Loading...
Searching...
No Matches
CellConnectivity.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <array>
4#include <vector>
5
6namespace polyfem::mesh
7{
9 enum class StandardCellType
10 {
11 TET,
12 HEX,
13 PRISM,
15 };
16
20 {
24 int facet_vertex[6][4];
25 };
26
32
35 {
38 {
39 vertices.fill(-1);
40 }
41
44 std::array<int, 8> vertices;
45
46 const CellDescriptor &descriptor() const { return *desc; }
47 int n_facets() const { return descriptor().n_facets; }
48 int n_facet_vertices(const int lf) const { return descriptor().n_facet_vertices[lf]; }
49 int facet_vertex(const int lf, const int lv) const { return vertices[descriptor().facet_vertex[lf][lv]]; }
50 };
51
71 std::vector<std::array<int, 6>> connect_cells(const std::vector<StandardCell> &cells, int n_vertices);
72} // namespace polyfem::mesh
std::vector< std::array< int, 6 > > connect_cells(const std::vector< StandardCell > &cells, const int n_vertices)
Computes cell-to-cell adjacency across facets.
StandardCellType
Standard volume cell types with a fixed local facet layout.
const CellDescriptor & cell_descriptor(const StandardCellType type)
Local vertex and facet conventions of each cell type.
Local facets of a standard cell: for each facet, its local vertices, ordered so that the facet normal...
A standard cell referencing global vertex indices.
const CellDescriptor * desc
int n_facet_vertices(const int lf) const
StandardCell(const StandardCellType type)
int facet_vertex(const int lf, const int lv) const
std::array< int, 8 > vertices
const CellDescriptor & descriptor() const