DOLFINx 0.7.3
DOLFINx C++ interface
|
Mesh refinement algorithms. More...
Namespaces | |
namespace | plaza |
Plaza mesh refinement. | |
Functions | |
template<std::floating_point T> | |
mesh::Mesh< T > | refine (const mesh::Mesh< T > &mesh, bool redistribute=true) |
Create a uniformly refined mesh. | |
template<std::floating_point T> | |
mesh::Mesh< T > | refine (const mesh::Mesh< T > &mesh, std::span< const std::int32_t > edges, bool redistribute=true) |
Create a locally refined mesh. | |
void | update_logical_edgefunction (MPI_Comm comm, const std::vector< std::vector< std::int32_t > > &marked_for_update, std::vector< std::int8_t > &marked_edges, const common::IndexMap &map) |
Communicate edge markers between processes that share edges. | |
template<std::floating_point T> | |
std::tuple< std::map< std::int32_t, std::int64_t >, std::vector< T >, std::array< std::size_t, 2 > > | create_new_vertices (MPI_Comm comm, const graph::AdjacencyList< int > &shared_edges, const mesh::Mesh< T > &mesh, std::span< const std::int8_t > marked_edges) |
Add new vertex for each marked edge, and create new_vertex_coordinates and global_edge->new_vertex map. | |
template<std::floating_point T> | |
mesh::Mesh< T > | partition (const mesh::Mesh< T > &old_mesh, const graph::AdjacencyList< std::int64_t > &cell_topology, std::span< const T > new_coords, std::array< std::size_t, 2 > xshape, bool redistribute, mesh::GhostMode ghost_mode) |
Use vertex and topology data to partition new mesh across processes. | |
std::vector< std::int64_t > | adjust_indices (const common::IndexMap &map, std::int32_t n) |
Add indices to account for extra n values on this process. | |
std::array< std::vector< std::int32_t >, 2 > | transfer_facet_meshtag (const mesh::MeshTags< std::int32_t > &tags0, const mesh::Topology &topology1, std::span< const std::int32_t > cell, std::span< const std::int8_t > facet) |
Transfer facet MeshTags from coarse mesh to refined mesh. | |
std::array< std::vector< std::int32_t >, 2 > | transfer_cell_meshtag (const mesh::MeshTags< std::int32_t > &tags0, const mesh::Topology &topology1, std::span< const std::int32_t > parent_cell) |
Transfer cell MeshTags from coarse mesh to refined mesh. | |
Mesh refinement algorithms.
Methods for refining meshes uniformly, or with markers, using edge bisection.
std::vector< std::int64_t > adjust_indices | ( | const common::IndexMap & | map, |
std::int32_t | n | ||
) |
Add indices to account for extra n values on this process.
This is a utility to help add new topological vertices on each process into the space of the index map.
[in] | map | Index map for the current mesh vertices |
[in] | n | Number of new entries to be accommodated on this process |
std::tuple< std::map< std::int32_t, std::int64_t >, std::vector< T >, std::array< std::size_t, 2 > > create_new_vertices | ( | MPI_Comm | comm, |
const graph::AdjacencyList< int > & | shared_edges, | ||
const mesh::Mesh< T > & | mesh, | ||
std::span< const 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] | comm | MPI Communicator for neighborhood |
[in] | shared_edges | |
[in] | mesh | Existing mesh |
[in] | marked_edges |
mesh::Mesh< T > partition | ( | const mesh::Mesh< T > & | old_mesh, |
const graph::AdjacencyList< std::int64_t > & | cell_topology, | ||
std::span< const T > | new_coords, | ||
std::array< std::size_t, 2 > | xshape, | ||
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_coords | New coordinates, row-major storage |
[in] | xshape | The shape of new_coords |
[in] | redistribute | Call graph partitioner if true |
[in] | ghost_mode | None or shared_facet |
mesh::Mesh< T > refine | ( | const mesh::Mesh< T > & | mesh, |
bool | redistribute = true |
||
) |
Create a uniformly refined mesh.
[in] | mesh | Mesh to create a new, refined mesh from |
[in] | redistribute | If true refined mesh is re-partitioned across MPI ranks. |
mesh::Mesh< T > refine | ( | const mesh::Mesh< T > & | mesh, |
std::span< const std::int32_t > | edges, | ||
bool | redistribute = true |
||
) |
Create a locally refined mesh.
[in] | mesh | Mesh to create a new, refined mesh from. |
[in] | edges | Indices of the edges that should be split during 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 | If true refined mesh is re-partitioned across MPI ranks. |
std::array< std::vector< std::int32_t >, 2 > transfer_cell_meshtag | ( | const mesh::MeshTags< std::int32_t > & | tags0, |
const mesh::Topology & | topology1, | ||
std::span< const std::int32_t > | parent_cell | ||
) |
Transfer cell MeshTags from coarse mesh to refined mesh.
[in] | tags0 | Tags on the parent mesh |
[in] | topology1 | Refined mesh topology |
[in] | parent_cell | Parent cell of each cell in refined mesh |
std::array< std::vector< std::int32_t >, 2 > transfer_facet_meshtag | ( | const mesh::MeshTags< std::int32_t > & | tags0, |
const mesh::Topology & | topology1, | ||
std::span< const std::int32_t > | cell, | ||
std::span< const std::int8_t > | facet | ||
) |
Transfer facet MeshTags from coarse mesh to refined mesh.
[in] | tags0 | Tags on the parent mesh |
[in] | topology1 | Refined mesh topology |
[in] | cell | Parent cell of each cell in refined mesh |
[in] | facet | Local facets of parent in each cell in refined mesh |
void update_logical_edgefunction | ( | MPI_Comm | comm, |
const std::vector< std::vector< std::int32_t > > & | marked_for_update, | ||
std::vector< std::int8_t > & | marked_edges, | ||
const common::IndexMap & | map | ||
) |
Communicate edge markers between processes that share edges.
[in] | comm | MPI Communicator for neighborhood |
[in] | marked_for_update | Lists of edges to be updated on each neighbor. marked_for_update[r] is the list of edge indices that are marked by the caller and are shared with local MPI rank r . |
[in,out] | marked_edges | Marker for each edge on the calling process |
[in] | map | Index map for the mesh edges |