10 #include <dolfinx/common/MPI.h>
11 #include <dolfinx/common/span.hpp>
12 #include <dolfinx/graph/AdjacencyList.h>
13 #include <dolfinx/graph/partition.h>
20 class ElementDofLayout;
38 graph::AdjacencyList<std::int64_t>
39 extract_topology(const CellType& cell_type, const fem::ElementDofLayout& layout,
40 const graph::AdjacencyList<std::int64_t>& cells);
43 std::vector<double>
h(const Mesh& mesh,
44 const tcb::span<const std::int32_t>& entities, int dim);
47 Eigen::Array<double, Eigen::Dynamic, 3, Eigen::RowMajor>
49 const tcb::span<const std::int32_t>& entities);
52 Eigen::Array<double, Eigen::Dynamic, 3, Eigen::RowMajor>
53 midpoints(const mesh::Mesh& mesh, int dim,
54 const tcb::span<const std::int32_t>& entities);
67 const mesh::Mesh& mesh, int dim,
68 const std::function<Eigen::Array<bool, Eigen::Dynamic, 1>(
69 const Eigen::Ref<const Eigen::Array<double, 3, Eigen::Dynamic,
70 Eigen::RowMajor>>&)>& marker);
93 const mesh::Mesh& mesh, int dim,
94 const std::function<Eigen::Array<bool, Eigen::Dynamic, 1>(
95 const Eigen::Ref<const Eigen::Array<double, 3, Eigen::Dynamic,
96 Eigen::RowMajor>>&)>& marker);
109 Eigen::Array<std::int32_t, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor>
111 const tcb::span<const std::int32_t>& entity_list,
136 graph::AdjacencyList<std::int32_t>
138 const graph::AdjacencyList<std::int64_t>& cells,
139 mesh::GhostMode ghost_mode);
143 graph::AdjacencyList<std::int32_t>
145 const graph::AdjacencyList<std::int64_t>& cells,
146 mesh::GhostMode ghost_mode,
147 const graph::partition_fn& partfn);
graph::AdjacencyList< std::int32_t > partition_cells_graph(MPI_Comm comm, int n, const mesh::CellType cell_type, const graph::AdjacencyList< std::int64_t > &cells, mesh::GhostMode ghost_mode)
Compute destination rank for mesh cells in this rank by applying the default graph partitioner to the...
Definition: utils.cpp:485
Eigen::Array< std::int32_t, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor > entities_to_geometry(const mesh::Mesh &mesh, int dim, const tcb::span< const std::int32_t > &entity_list, bool orient)
Compute the indices the geometry data for the vertices of the given mesh entities.
Definition: utils.cpp:378
Eigen::Array< double, Eigen::Dynamic, 3, Eigen::RowMajor > midpoints(const mesh::Mesh &mesh, int dim, const tcb::span< const std::int32_t > &entities)
Compute midpoints or mesh entities of a given dimension.
Definition: utils.cpp:171
Eigen::Array< double, Eigen::Dynamic, 3, Eigen::RowMajor > cell_normals(const Mesh &mesh, int dim, const tcb::span< const std::int32_t > &entities)
Compute normal to given cell (viewed as embedded in 3D)
Definition: utils.cpp:94
std::vector< std::int32_t > locate_entities_boundary(const mesh::Mesh &mesh, 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 tr...
Definition: utils.cpp:265
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.
Definition: utils.cpp:27
CellType
Cell type identifier.
Definition: cell_types.h:21
std::vector< std::int32_t > locate_entities(const mesh::Mesh &mesh, 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 functi...
Definition: utils.cpp:198
GhostMode
Enum for different partitioning ghost modes.
Definition: Mesh.h:48
std::vector< std::int32_t > exterior_facet_indices(const Mesh &mesh)
Compute the indices (local) of all exterior facets. An exterior facet (co-dimension 1) is one that is...
Definition: utils.cpp:450
std::vector< double > h(const Mesh &mesh, const tcb::span< const std::int32_t > &entities, int dim)
Compute greatest distance between any two vertices.
Definition: utils.cpp:54