Note: this is documentation for an old release. View the latest documentation at docs.fenicsproject.org/dolfinx/v0.9.0/cpp/doxygen/de/d78/refinement_2utils_8h_source.html
DOLFINx  0.5.1
DOLFINx C++ interface
utils.h
1 // Copyright (C) 2012-2020 Chris Richardson
2 //
3 // This file is part of DOLFINx (https://www.fenicsproject.org)
4 //
5 // SPDX-License-Identifier: LGPL-3.0-or-later
6 
7 #pragma once
8 
9 #include <array>
10 #include <cstdint>
11 #include <dolfinx/common/MPI.h>
12 #include <dolfinx/graph/AdjacencyList.h>
13 #include <map>
14 #include <memory>
15 #include <set>
16 #include <tuple>
17 #include <vector>
18 
19 namespace dolfinx::mesh
20 {
21 template <typename T>
22 class MeshTags;
23 class Mesh;
24 enum class GhostMode;
25 } // namespace dolfinx::mesh
26 
27 namespace dolfinx::common
28 {
29 class IndexMap;
30 } // namespace dolfinx::common
31 
32 namespace dolfinx::refinement
33 {
34 
45  MPI_Comm neighbor_comm,
46  const std::vector<std::vector<std::int32_t>>& marked_for_update,
47  std::vector<std::int8_t>& marked_edges, const common::IndexMap& map);
48 
61 std::tuple<std::map<std::int32_t, std::int64_t>, std::vector<double>,
62  std::array<std::size_t, 2>>
63 create_new_vertices(MPI_Comm neighbor_comm,
64  const graph::AdjacencyList<int>& shared_edges,
65  const mesh::Mesh& mesh,
66  const std::vector<std::int8_t>& marked_edges);
67 
77 mesh::Mesh partition(const mesh::Mesh& old_mesh,
78  const graph::AdjacencyList<std::int64_t>& cell_topology,
79  std::span<const double> new_coords,
80  std::array<std::size_t, 2> xshape, bool redistribute,
81  mesh::GhostMode ghost_mode);
82 
95 std::vector<std::int64_t> adjust_indices(const common::IndexMap& map,
96  std::int32_t n);
97 
107 mesh::MeshTags<std::int32_t>
108 transfer_facet_meshtag(const mesh::MeshTags<std::int32_t>& meshtag,
109  std::shared_ptr<const mesh::Mesh> refined_mesh,
110  const std::vector<std::int32_t>& cell,
111  const std::vector<std::int8_t>& facet);
112 
122 mesh::MeshTags<std::int32_t>
123 transfer_cell_meshtag(const mesh::MeshTags<std::int32_t>& parent_meshtag,
124  std::shared_ptr<const mesh::Mesh> refined_mesh,
125  const std::vector<std::int32_t>& parent_cell);
126 } // namespace dolfinx::refinement
Miscellaneous classes, functions and types.
Mesh data structures and algorithms on meshes.
Definition: DofMap.h:30
GhostMode
Enum for different partitioning ghost modes.
Definition: utils.h:29
Mesh refinement algorithms.
mesh::Mesh partition(const mesh::Mesh &old_mesh, const graph::AdjacencyList< std::int64_t > &cell_topology, std::span< const double > 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.
Definition: utils.cpp:297
std::tuple< std::map< std::int32_t, std::int64_t >, std::vector< double >, std::array< std::size_t, 2 > > create_new_vertices(MPI_Comm neighbor_comm, const graph::AdjacencyList< int > &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 ma...
Definition: utils.cpp:178
mesh::MeshTags< std::int32_t > transfer_facet_meshtag(const mesh::MeshTags< std::int32_t > &meshtag, std::shared_ptr< const mesh::Mesh > refined_mesh, const std::vector< std::int32_t > &cell, const std::vector< std::int8_t > &facet)
Transfer facet MeshTags from coarse mesh to refined mesh.
Definition: utils.cpp:428
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.
Definition: utils.cpp:375
mesh::MeshTags< std::int32_t > transfer_cell_meshtag(const mesh::MeshTags< std::int32_t > &parent_meshtag, std::shared_ptr< const mesh::Mesh > refined_mesh, const std::vector< std::int32_t > &parent_cell)
Transfer cell MeshTags from coarse mesh to refined mesh.
Definition: utils.cpp:553
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)
Communicate edge markers between processes that share edges.
Definition: utils.cpp:120