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.6.0
DOLFINx C++ interface
Loading...
Searching...
No Matches
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
19namespace dolfinx::mesh
20{
21template <typename T>
22class MeshTags;
23class Mesh;
24enum class GhostMode;
25} // namespace dolfinx::mesh
26
27namespace dolfinx::common
28{
29class IndexMap;
30} // namespace dolfinx::common
31
32namespace 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
61std::tuple<std::map<std::int32_t, std::int64_t>, std::vector<double>,
62 std::array<std::size_t, 2>>
63create_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
77mesh::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
95std::vector<std::int64_t> adjust_indices(const common::IndexMap& map,
96 std::int32_t n);
97
107mesh::MeshTags<std::int32_t>
108transfer_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
122mesh::MeshTags<std::int32_t>
123transfer_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:31
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:383
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
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:330
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:508