OISEAU
A modern DGTD framework
Loading...
Searching...
No Matches
dg_connectivity.hpp
1// Copyright (C) 2026 Tiago V. L. Amorim (@tiagovla)
2//
3// This file is part of oiseau (https://github.com/tiagovla/oiseau)
4//
5// SPDX-License-Identifier: GPL-3.0-or-later
6
7#pragma once
8
9#include <cstddef>
10#include <limits>
11#include <span>
12#include <vector>
13
14#include "oiseau/mesh/mesh.hpp"
15
16namespace oiseau::dg {
17
26 public:
28 static constexpr std::size_t no_neighbor = std::numeric_limits<std::size_t>::max();
29
41 std::vector<std::size_t> vertex_permutation;
42
44 bool is_boundary() const { return neighbor_cell == no_neighbor; }
45 };
46
58 explicit DGConnectivity(mesh::Mesh& mesh);
59
61 const mesh::Mesh& mesh() const { return m_mesh; }
62
69 std::span<const FaceConnection> faces(std::size_t mesh_cell_index) const;
70
71 private:
72 const mesh::Mesh& m_mesh;
73 std::vector<std::vector<FaceConnection>> m_faces;
74};
75
76} // namespace oiseau::dg
std::span< const FaceConnection > faces(std::size_t mesh_cell_index) const
Returns the face connections for a mesh cell in local face order.
Definition dg_connectivity.cpp:121
static constexpr std::size_t no_neighbor
Sentinel for missing neighbor cell and face indices.
Definition dg_connectivity.hpp:28
const mesh::Mesh & mesh() const
Definition dg_connectivity.hpp:61
DGConnectivity(mesh::Mesh &mesh)
Calculates mesh adjacency and builds DG face connections.
Definition dg_connectivity.cpp:75
Definition mesh.hpp:15
Connection from one local face to its neighbor.
Definition dg_connectivity.hpp:31
std::size_t neighbor_cell
Mesh index of the neighboring cell, or no_neighbor on a boundary.
Definition dg_connectivity.hpp:33
bool is_boundary() const
Definition dg_connectivity.hpp:44
std::size_t neighbor_face
Local face index on the neighboring cell, or no_neighbor on a boundary.
Definition dg_connectivity.hpp:35
std::vector< std::size_t > vertex_permutation
Maps local face vertex positions to positions on the neighboring face.
Definition dg_connectivity.hpp:41