DOLFIN-X
DOLFIN-X C++ interface
|
Namespaces | |
GraphBuilder | |
Tools to build a Graph corresponding to various objects. | |
Partitioning | |
Tools for partitioning meshes. | |
PermutationComputation | |
Tools for computing mesh entity permutations. | |
TopologyComputation | |
This class implements a set of basic algorithms that automate the computation of mesh entities and connectivity. | |
Classes | |
class | Geometry |
Geometry stores the geometry imposed on a mesh. More... | |
class | Mesh |
A Mesh consists of a set of connected and numbered mesh topological entities, and geometry data. More... | |
class | MeshTags |
A MeshTags are used to associate mesh entities with values. The entity index (local to process) identifies the entity. MeshTags is a sparse data storage class; it allows tags to be associated with an arbitrary subset of mesh entities. An entity can have only one associated tag. More... | |
class | Topology |
Topology stores the topology of a mesh, consisting of mesh entities and connectivity (incidence relations for the mesh entities). More... | |
Enumerations | |
enum | CellType : int { point = 1, interval = 2, triangle = 3, tetrahedron = 4, quadrilateral = -4, hexahedron = -8 } |
Cell type identifier. | |
enum | GhostMode : int { none, shared_facet, shared_vertex } |
Enum for different partitioning ghost modes. | |
Functions | |
std::string | to_string (CellType type) |
Get the cell string type for a cell type. More... | |
CellType | to_type (const std::string &cell) |
Get the cell type from a cell string. More... | |
CellType | cell_entity_type (CellType type, int d) |
Return type of cell for entity of dimension d. | |
CellType | cell_facet_type (CellType type) |
Return facet type of cell. More... | |
Eigen::Array< int, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor > | get_entity_vertices (CellType type, int dim) |
Return array entities(num entities, num vertices per entity), where entities(e, k) is the local vertex index for the kth vertex of entity e of dimension dim. | |
Eigen::Array< int, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor > | get_sub_entities (CellType type, int dim0, int dim1) |
Get entities of dimsion dim1 and that make up entities of dimension dim0. | |
int | cell_dim (CellType type) |
Return topological dimension of cell type. | |
int | cell_num_entities (mesh::CellType type, int dim) |
Number of entities of dimension dim. More... | |
bool | is_simplex (CellType type) |
Check if cell is a simplex. More... | |
int | num_cell_vertices (CellType type) |
Number vertices for a cell type. More... | |
std::map< std::array< int, 2 >, std::vector< std::set< int > > > | cell_entity_closure (mesh::CellType cell_type) |
Closure entities for a cell, i.e., all lower-dimensional entities attached to a cell entity. Map from entity {dim_e, entity_e} to closure{sub_dim, (sub_entities)}. | |
mesh::Geometry | create_geometry (MPI_Comm comm, const Topology &topology, const fem::CoordinateElement &coordinate_element, const graph::AdjacencyList< std::int64_t > &cells, const Eigen::Ref< const Eigen::Array< double, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor >> &x) |
Build Geometry FIXME: document. | |
Mesh | create_mesh (MPI_Comm comm, const graph::AdjacencyList< std::int64_t > &cells, const fem::CoordinateElement &element, const Eigen::Array< double, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor > &x, GhostMode ghost_mode) |
Create a mesh. | |
template<typename T > | |
mesh::MeshTags< T > | create_meshtags (const std::shared_ptr< const mesh::Mesh > &mesh, const int dim, const graph::AdjacencyList< std::int32_t > &entities, const std::vector< T > &values) |
Create MeshTags from arrays. More... | |
std::vector< bool > | compute_boundary_facets (const Topology &topology) |
Compute marker for owned facets that are on the exterior of the domain, i.e. are connected to only one cell. The function does not require parallel communication. More... | |
Topology | create_topology (MPI_Comm comm, const graph::AdjacencyList< std::int64_t > &cells, const std::vector< std::int64_t > &original_cell_index, const std::vector< int > &ghost_owners, const CellType &cell_type, mesh::GhostMode ghost_mode) |
Create distributed topology. More... | |
graph::AdjacencyList< std::int64_t > | extract_topology (const CellType &cell_type, const fem::ElementDofLayout &layout, const graph::AdjacencyList< std::int64_t > &cells) |
Extract topology from cell data, i.e. extract cell vertices. More... | |
Eigen::ArrayXd | volume_entities (const Mesh &mesh, const Eigen::Ref< const Eigen::ArrayXi > &entities, int dim) |
Compute (generalized) volume of mesh entities of given dimension. | |
Eigen::ArrayXd | circumradius (const Mesh &mesh, const Eigen::Ref< const Eigen::ArrayXi > &entities, int dim) |
Compute circumradius of mesh entities. | |
Eigen::ArrayXd | h (const Mesh &mesh, const Eigen::Ref< const Eigen::ArrayXi > &entities, int dim) |
Compute greatest distance between any two vertices. | |
Eigen::ArrayXd | inradius (const Mesh &mesh, const Eigen::Ref< const Eigen::ArrayXi > &entities) |
Compute inradius of cells. | |
Eigen::ArrayXd | radius_ratio (const Mesh &mesh, const Eigen::Ref< const Eigen::ArrayXi > &entities) |
Compute dim*inradius/circumradius for given cells. | |
Eigen::Array< double, Eigen::Dynamic, 3, Eigen::RowMajor > | cell_normals (const Mesh &mesh, int dim) |
Compute normal to given cell (viewed as embedded in 3D) | |
Eigen::Array< double, Eigen::Dynamic, 3, Eigen::RowMajor > | midpoints (const mesh::Mesh &mesh, int dim, const Eigen::Ref< const Eigen::Array< int, Eigen::Dynamic, 1 >> &entities) |
Compute midpoints or mesh entities of a given dimension. | |
Eigen::Array< std::int32_t, Eigen::Dynamic, 1 > | locate_entities (const mesh::Mesh &mesh, const int dim, const std::function< Eigen::Array< bool, Eigen::Dynamic, 1 >(const Eigen::Ref< const Eigen::Array< double, 3, Eigen::Dynamic, Eigen::RowMajor >> &)> &marker) |
Compute indicies of all mesh entities that evaluate to true for the provided geometric marking function. An entity is considered marked if the marker function evaluates true for all of its vertices. More... | |
Eigen::Array< std::int32_t, Eigen::Dynamic, 1 > | locate_entities_boundary (const mesh::Mesh &mesh, const int dim, const std::function< Eigen::Array< bool, Eigen::Dynamic, 1 >(const Eigen::Ref< const Eigen::Array< double, 3, Eigen::Dynamic, Eigen::RowMajor >> &)> &marker) |
Compute indicies of all mesh entities that are attached to an owned boundary facet and evaluate to true for the provided geometric marking function. An entity is considered marked if the marker function evaluates true for all of its vertices. More... | |
Eigen::Array< std::int32_t, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor > | entities_to_geometry (const mesh::Mesh &mesh, const int dim, const Eigen::Array< std::int32_t, Eigen::Dynamic, 1 > &entity_list, bool orient) |
Compute the geometry indices of vertices of the given entities from the mesh geometry. More... | |
Eigen::Array< std::int32_t, Eigen::Dynamic, 1 > | exterior_facet_indices (const Mesh &mesh) |
Compute the indices (local) of all exterior facets. An exterior facet (co-dimension 1) is one that is connected globally to only one cell of co-dimension 0). More... | |
Mesh data structures.
Representations of meshes and support for operations on meshes.
mesh::CellType dolfinx::mesh::cell_facet_type | ( | mesh::CellType | type | ) |
Return facet type of cell.
[in] | type | The cell type |
int dolfinx::mesh::cell_num_entities | ( | mesh::CellType | type, |
int | dim | ||
) |
Number of entities of dimension dim.
[in] | dim | Entity dimension |
[in] | type | Cell type |
std::vector< bool > dolfinx::mesh::compute_boundary_facets | ( | const Topology & | topology | ) |
Compute marker for owned facets that are on the exterior of the domain, i.e. are connected to only one cell. The function does not require parallel communication.
[in] | topology | The topology |
mesh::MeshTags<T> dolfinx::mesh::create_meshtags | ( | const std::shared_ptr< const mesh::Mesh > & | mesh, |
const int | dim, | ||
const graph::AdjacencyList< std::int32_t > & | entities, | ||
const std::vector< T > & | values | ||
) |
Create MeshTags from arrays.
[in] | mesh | The Mesh that the tags are associated with |
[in] | dim | Topological dimension of tagged entities |
[in] | entities | Local vertex indices for tagged entities. |
[in] | values | Tag values for each entity in @ entities. The length of @ values must be equal to number of rows in @ entities. |
Topology dolfinx::mesh::create_topology | ( | MPI_Comm | comm, |
const graph::AdjacencyList< std::int64_t > & | cells, | ||
const std::vector< std::int64_t > & | original_cell_index, | ||
const std::vector< int > & | ghost_owners, | ||
const CellType & | cell_type, | ||
mesh::GhostMode | ghost_mode | ||
) |
Create distributed topology.
[in] | comm | MPI communicator across which the topology is distributed |
[in] | cells | The cell topology (list of cell vertices) using global indices for the vertices. It contains cells that have been distributed to this rank, e.g. via a graph partitioner. It must also contain all ghost cells via facet, i.e. cells which are on a neighboring process and share a facet with a local cell. |
[in] | original_cell_index | The original global index associated with each cell. |
[in] | ghost_owners | The ownership of the ghost cells (ghost cells are always at the end of the list of cells, above) |
[in] | cell_type | The cell shape |
[in] | ghost_mode | How to partition the cell overlap: none, shared_facet or shared_vertex. |
Eigen::Array< std::int32_t, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor > dolfinx::mesh::entities_to_geometry | ( | const mesh::Mesh & | mesh, |
const int | dim, | ||
const Eigen::Array< std::int32_t, Eigen::Dynamic, 1 > & | entity_list, | ||
bool | orient | ||
) |
Compute the geometry indices of vertices of the given entities from the mesh geometry.
[in] | mesh | Mesh |
[in] | dim | Topological dimension of the entities of interest |
[in] | entity_list | List of entity indices (local) |
[in] | orient | If true, in 3D, reorients facets to have consistent normal direction |
Eigen::Array< std::int32_t, Eigen::Dynamic, 1 > dolfinx::mesh::exterior_facet_indices | ( | const Mesh & | mesh | ) |
Compute the indices (local) of all exterior facets. An exterior facet (co-dimension 1) is one that is connected globally to only one cell of co-dimension 0).
[in] | mesh | Mesh |
graph::AdjacencyList< std::int64_t > dolfinx::mesh::extract_topology | ( | const CellType & | cell_type, |
const fem::ElementDofLayout & | layout, | ||
const graph::AdjacencyList< std::int64_t > & | cells | ||
) |
Extract topology from cell data, i.e. extract cell vertices.
[in] | cell_type | The cell shape |
[in] | layout | The layout of geometry 'degrees-of-freedom' on the reference cell |
[in] | cells | List of 'nodes' for each cell using global indices. The layout must be consistent with layout . |
cell
. bool dolfinx::mesh::is_simplex | ( | mesh::CellType | type | ) |
Check if cell is a simplex.
[in] | type | Cell type |
Eigen::Array< std::int32_t, Eigen::Dynamic, 1 > dolfinx::mesh::locate_entities | ( | const mesh::Mesh & | mesh, |
const int | dim, | ||
const std::function< Eigen::Array< bool, Eigen::Dynamic, 1 >(const Eigen::Ref< const Eigen::Array< double, 3, Eigen::Dynamic, Eigen::RowMajor >> &)> & | marker | ||
) |
Compute indicies of all mesh entities that evaluate to true for the provided geometric marking function. An entity is considered marked if the marker function evaluates true for all of its vertices.
[in] | mesh | The mesh |
[in] | dim | The topological dimension of the entities to be considered |
[in] | marker | The marking function |
Eigen::Array< std::int32_t, Eigen::Dynamic, 1 > dolfinx::mesh::locate_entities_boundary | ( | const mesh::Mesh & | mesh, |
const int | dim, | ||
const std::function< Eigen::Array< bool, Eigen::Dynamic, 1 >(const Eigen::Ref< const Eigen::Array< double, 3, Eigen::Dynamic, Eigen::RowMajor >> &)> & | marker | ||
) |
Compute indicies of all mesh entities that are attached to an owned boundary facet and evaluate to true for the provided geometric marking function. An entity is considered marked if the marker function evaluates true for all of its vertices.
[in] | mesh | The mesh |
[in] | dim | The topological dimension of the entities to be considered. Must be less than the topological dimension of the mesh. |
[in] | marker | The marking function |
int dolfinx::mesh::num_cell_vertices | ( | mesh::CellType | type | ) |
Number vertices for a cell type.
[in] | type | Cell type |
std::string dolfinx::mesh::to_string | ( | mesh::CellType | type | ) |
Get the cell string type for a cell type.
[in] | type | The cell type |
mesh::CellType dolfinx::mesh::to_type | ( | const std::string & | cell | ) |
Get the cell type from a cell string.
[in] | cell | Cell shape string |