DOLFINx 0.8.0
DOLFINx C++ interface
Loading...
Searching...
No Matches
cell_types.h
1// Copyright (C) 2019-2020 Garth N. Wells
2//
3// This file is part of DOLFINx (https://www.fenicsproject.org)
4//
5// SPDX-License-Identifier: LGPL-3.0-or-later
6
7#pragma once
8
9#include <array>
10#include <basix/cell.h>
11#include <dolfinx/graph/AdjacencyList.h>
12#include <map>
13#include <set>
14#include <string>
15#include <vector>
16
17namespace dolfinx::mesh
18{
19
21enum class CellType : int
22{
23 // NOTE: Simplex cells have index > 0, see mesh::is_simplex
24 point = 1,
25 interval = 2,
26 triangle = 3,
27 tetrahedron = 4,
28 quadrilateral = -4,
29 pyramid = -5,
30 prism = -6,
31 hexahedron = -8
32};
33
37std::string to_string(CellType type);
38
42CellType to_type(const std::string& cell);
43
45CellType cell_entity_type(CellType type, int d, int index);
46
53CellType cell_facet_type(CellType type, int index);
54
58
62
64int cell_dim(CellType type);
65
70int cell_num_entities(CellType type, int dim);
71
75bool is_simplex(CellType type);
76
81
82// [dim, entity] -> closure{sub_dim, (sub_entities)}
83
87std::map<std::array<int, 2>, std::vector<std::set<int>>>
89
91basix::cell::type cell_type_to_basix_type(CellType celltype);
92
94CellType cell_type_from_basix_type(basix::cell::type celltype);
95
96} // namespace dolfinx::mesh
Definition AdjacencyList.h:28
Mesh data structures and algorithms on meshes.
Definition DofMap.h:32
CellType cell_facet_type(CellType type, int index)
Definition cell_types.cpp:77
int cell_dim(CellType type)
Return topological dimension of cell type.
Definition cell_types.cpp:134
CellType cell_entity_type(CellType type, int d, int index)
Return type of cell for entity of dimension d at given entity index.
Definition cell_types.cpp:64
CellType cell_type_from_basix_type(basix::cell::type celltype)
Get a cell type from a Basix cell type.
Definition cell_types.cpp:237
int num_cell_vertices(CellType type)
Definition cell_types.cpp:147
graph::AdjacencyList< int > get_entity_vertices(CellType type, int dim)
Definition cell_types.cpp:108
basix::cell::type cell_type_to_basix_type(CellType celltype)
Convert a cell type to a Basix cell type.
Definition cell_types.cpp:212
std::map< std::array< int, 2 >, std::vector< std::set< int > > > cell_entity_closure(CellType cell_type)
Definition cell_types.cpp:153
int cell_num_entities(CellType type, int dim)
Definition cell_types.cpp:139
CellType
Cell type identifier.
Definition cell_types.h:22
bool is_simplex(CellType type)
Definition cell_types.cpp:145
std::string to_string(CellType type)
Definition cell_types.cpp:17
CellType to_type(const std::string &cell)
Definition cell_types.cpp:42
graph::AdjacencyList< int > get_sub_entities(CellType type, int dim0, int dim1)
Definition cell_types.cpp:115