DOLFINx
0.4.1
DOLFINx C++ interface
|
Mesh refinement algorithms. More...
Namespaces | |
plaza | |
Function in this namespace implement the refinement method described in Plaza and Carey "Local refinement of simplicial grids based on
the skeleton" (Applied Numerical Mathematics 32 (2000) 195-218). | |
Functions | |
mesh::Mesh | refine (const mesh::Mesh &mesh, bool redistribute=true) |
Create a uniformly refined mesh. More... | |
mesh::Mesh | refine (const mesh::Mesh &mesh, const xtl::span< const std::int32_t > &edges, bool redistribute=true) |
Create a locally refined mesh. More... | |
std::pair< MPI_Comm, std::map< std::int32_t, std::vector< int > > > | compute_edge_sharing (const mesh::Mesh &mesh) |
Compute the sharing of edges between processes. More... | |
void | update_logical_edgefunction (MPI_Comm neighbor_comm, const std::vector< std::vector< std::int32_t >> &marked_for_update, std::vector< std::int8_t > &marked_edges, const common::IndexMap &map_e) |
Transfer marked edges between processes. More... | |
std::pair< std::map< std::int32_t, std::int64_t >, xt::xtensor< double, 2 > > | create_new_vertices (MPI_Comm neighbor_comm, const std::map< std::int32_t, std::vector< std::int32_t >> &shared_edges, const mesh::Mesh &mesh, const std::vector< std::int8_t > &marked_edges) |
Add new vertex for each marked edge, and create new_vertex_coordinates and global_edge->new_vertex map. Communicate new vertices with MPI to all affected processes. More... | |
mesh::Mesh | partition (const mesh::Mesh &old_mesh, const graph::AdjacencyList< std::int64_t > &cell_topology, const xt::xtensor< double, 2 > &new_vertex_coordinates, bool redistribute, mesh::GhostMode ghost_mode) |
Use vertex and topology data to partition new mesh across processes. More... | |
std::vector< std::int64_t > | adjust_indices (const common::IndexMap &index_map, std::int32_t n) |
brief description indices to account for extra n values on each process. More... | |
mesh::MeshTags< std::int32_t > | transfer_facet_meshtag (const mesh::MeshTags< std::int32_t > &parent_meshtag, const mesh::Mesh &refined_mesh, const std::vector< std::int32_t > &parent_cell, const std::vector< std::int8_t > &parent_facet) |
Transfer facet MeshTags from coarse mesh to refined mesh. More... | |
mesh::MeshTags< std::int32_t > | transfer_cell_meshtag (const mesh::MeshTags< std::int32_t > &parent_meshtag, const mesh::Mesh &refined_mesh, const std::vector< std::int32_t > &parent_cell) |
Transfer cell MeshTags from coarse mesh to refined mesh. More... | |
Mesh refinement algorithms.
Methods for refining meshes uniformly, or with markers, using edge bisection.
std::vector< std::int64_t > adjust_indices | ( | const common::IndexMap & | index_map, |
std::int32_t | n | ||
) |
brief description indices to account for extra n values on each process.
This is a utility to help add new topological vertices on each process into the space of the index map.
[in] | index_map | Index map for the current mesh vertices |
[in] | n | Number of new entries to be accommodated on this process |
std::pair< MPI_Comm, std::map< std::int32_t, std::vector< int > > > compute_edge_sharing | ( | const mesh::Mesh & | mesh | ) |
Compute the sharing of edges between processes.
The resulting MPI_Comm is over the neighborhood of shared edges, allowing direct communication between peers. The resulting map is from local edge index to the set of neighbors (within the comm) that share that edge.
[in] | mesh | Mesh |
std::pair< std::map< std::int32_t, std::int64_t >, xt::xtensor< double, 2 > > create_new_vertices | ( | MPI_Comm | neighbor_comm, |
const std::map< std::int32_t, std::vector< std::int32_t >> & | shared_edges, | ||
const mesh::Mesh & | mesh, | ||
const std::vector< std::int8_t > & | marked_edges | ||
) |
Add new vertex for each marked edge, and create new_vertex_coordinates and global_edge->new_vertex map. Communicate new vertices with MPI to all affected processes.
[in] | neighbor_comm | MPI Communicator for neighborhood |
[in] | shared_edges | |
[in] | mesh | Existing mesh |
[in] | marked_edges |
mesh::Mesh partition | ( | const mesh::Mesh & | old_mesh, |
const graph::AdjacencyList< std::int64_t > & | cell_topology, | ||
const xt::xtensor< double, 2 > & | new_vertex_coordinates, | ||
bool | redistribute, | ||
mesh::GhostMode | ghost_mode | ||
) |
Use vertex and topology data to partition new mesh across processes.
[in] | old_mesh | |
[in] | cell_topology | Topology of cells, (vertex indices) |
[in] | new_vertex_coordinates | |
[in] | redistribute | Call graph partitioner if true |
[in] | ghost_mode | None or shared_facet |
mesh::Mesh refine | ( | const mesh::Mesh & | mesh, |
bool | redistribute = true |
||
) |
Create a uniformly refined mesh.
[in] | mesh | The mesh from which to build a refined Mesh |
[in] | redistribute | Optional argument to redistribute the refined mesh if mesh is a distributed mesh. |
mesh::Mesh refine | ( | const mesh::Mesh & | mesh, |
const xtl::span< const std::int32_t > & | edges, | ||
bool | redistribute = true |
||
) |
Create a locally refined mesh.
[in] | mesh | The mesh from which to build a refined Mesh |
[in] | edges | Indices of the edges that should be split by this refinement. mesh::compute_incident_entities can be used to compute the edges that are incident to other entities, e.g. incident to cells. |
[in] | redistribute | Optional argument to redistribute the refined mesh if mesh is a distributed mesh. |
mesh::MeshTags< std::int32_t > transfer_cell_meshtag | ( | const mesh::MeshTags< std::int32_t > & | parent_meshtag, |
const mesh::Mesh & | refined_mesh, | ||
const std::vector< std::int32_t > & | parent_cell | ||
) |
Transfer cell MeshTags from coarse mesh to refined mesh.
[in] | parent_meshtag | Cell MeshTags on parent mesh |
[in] | refined_mesh | Refined mesh based on parent mesh |
[in] | parent_cell | Parent cell of each cell in refined mesh |
mesh::MeshTags< std::int32_t > transfer_facet_meshtag | ( | const mesh::MeshTags< std::int32_t > & | parent_meshtag, |
const mesh::Mesh & | refined_mesh, | ||
const std::vector< std::int32_t > & | parent_cell, | ||
const std::vector< std::int8_t > & | parent_facet | ||
) |
Transfer facet MeshTags from coarse mesh to refined mesh.
[in] | parent_meshtag | Facet MeshTags on parent mesh |
[in] | refined_mesh | Refined mesh based on parent mesh |
[in] | parent_cell | Parent cell of each cell in refined mesh |
[in] | parent_facet | Local facets of parent in each cell in refined mesh |
void update_logical_edgefunction | ( | MPI_Comm | neighbor_comm, |
const std::vector< std::vector< std::int32_t >> & | marked_for_update, | ||
std::vector< std::int8_t > & | marked_edges, | ||
const common::IndexMap & | map_e | ||
) |
Transfer marked edges between processes.
[in] | neighbor_comm | MPI Communicator for neighborhood |
[in] | marked_for_update | Lists of edges to be updates on each neighbor |
[in,out] | marked_edges | Marked edges to be updated |
[in] | map_e | IndexMap for edges |