Loading...
Searching...
No Matches
cell_types.h
// Copyright (C) 2019-2020 Garth N. Wells
//
// This file is part of DOLFINx (https://www.fenicsproject.org)
//
// SPDX-License-Identifier: LGPL-3.0-or-later
#pragma once
#include <array>
#include <basix/cell.h>
#include <dolfinx/graph/AdjacencyList.h>
#include <map>
#include <set>
#include <string>
#include <vector>
namespace dolfinx::mesh
{
enum class CellType : std::int8_t
{
// NOTE: Simplex cells have index > 0, see mesh::is_simplex
point = 1,
interval = 2,
triangle = 3,
tetrahedron = 4,
quadrilateral = -4,
pyramid = -5,
prism = -6,
hexahedron = -8
};
std::string to_string(CellType type);
CellType to_type(const std::string& cell);
CellType cell_entity_type(CellType type, int d, int index);
CellType cell_facet_type(CellType type, int index);
graph::AdjacencyList<int> get_entity_vertices(CellType type, int dim);
graph::AdjacencyList<int> get_sub_entities(CellType type, int dim0, int dim1);
int cell_dim(CellType type);
int cell_num_entities(CellType type, int dim);
bool is_simplex(CellType type);
int num_cell_vertices(CellType type);
// [dim, entity] -> closure{sub_dim, (sub_entities)}
std::map<std::array<int, 2>, std::vector<std::set<int>>>
cell_entity_closure(CellType cell_type);
basix::cell::type cell_type_to_basix_type(CellType celltype);
CellType cell_type_from_basix_type(basix::cell::type celltype);
} // namespace dolfinx::mesh
dolfinx::graph::AdjacencyList
This class provides a static adjacency list data structure.
Definition AdjacencyList.h:38
dolfinx::mesh
Mesh data structures and algorithms on meshes.
Definition DofMap.h:32
dolfinx::mesh::cell_facet_type
CellType cell_facet_type(CellType type, int index)
Definition cell_types.cpp:77
dolfinx::mesh::cell_dim
int cell_dim(CellType type)
Return topological dimension of cell type.
Definition cell_types.cpp:134
dolfinx::mesh::cell_entity_type
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
dolfinx::mesh::cell_type_from_basix_type
CellType cell_type_from_basix_type(basix::cell::type celltype)
Get a cell type from a Basix cell type.
Definition cell_types.cpp:237
dolfinx::mesh::CellType
CellType
Cell type identifier.
Definition cell_types.h:22
dolfinx::mesh::num_cell_vertices
int num_cell_vertices(CellType type)
Definition cell_types.cpp:147
dolfinx::mesh::get_entity_vertices
graph::AdjacencyList< int > get_entity_vertices(CellType type, int dim)
Definition cell_types.cpp:108
dolfinx::mesh::cell_type_to_basix_type
basix::cell::type cell_type_to_basix_type(CellType celltype)
Convert a cell type to a Basix cell type.
Definition cell_types.cpp:212
dolfinx::mesh::cell_entity_closure
std::map< std::array< int, 2 >, std::vector< std::set< int > > > cell_entity_closure(CellType cell_type)
Definition cell_types.cpp:153
dolfinx::mesh::cell_num_entities
int cell_num_entities(CellType type, int dim)
Definition cell_types.cpp:139
dolfinx::mesh::is_simplex
bool is_simplex(CellType type)
Definition cell_types.cpp:145
dolfinx::mesh::to_string
std::string to_string(CellType type)
Definition cell_types.cpp:17
dolfinx::mesh::to_type
CellType to_type(const std::string &cell)
Definition cell_types.cpp:42
dolfinx::mesh::get_sub_entities
graph::AdjacencyList< int > get_sub_entities(CellType type, int dim0, int dim1)
Definition cell_types.cpp:115