OISEAU
A modern DGTD framework
Loading...
Searching...
No Matches
dg_space.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 <span>
11#include <vector>
12#include <xtensor/containers/xarray.hpp>
13#include <xtensor/core/xtensor_forward.hpp>
14
15#include "oiseau/mesh/cell.hpp"
16#include "oiseau/mesh/mesh.hpp"
17
18namespace oiseau::dg {
19
24class DGSpace {
25 public:
27 struct ElementGroup {
29 mesh::CellKind kind = mesh::CellKind::Undefined;
31 unsigned order = 0;
33 std::vector<std::size_t> cell_indices;
38 xt::xarray<double> nodes;
39 };
40
41 DGSpace(const DGSpace& V) = delete;
51 DGSpace(const mesh::Mesh& mesh, const std::vector<unsigned>& orders);
59 DGSpace(const mesh::Mesh& mesh, unsigned order);
60 DGSpace(DGSpace&& V) = default;
61 ~DGSpace() = default;
62 DGSpace& operator=(const DGSpace& V) = delete;
63 DGSpace& operator=(DGSpace&& V) = delete;
64
66 const mesh::Mesh& mesh() const { return m_mesh; }
68 std::span<const ElementGroup> element_groups() const;
75 const ElementGroup* element_group(mesh::CellKind kind, unsigned order) const;
77 std::span<const unsigned> orders() const;
78
79 private:
80 const mesh::Mesh& m_mesh;
81 std::vector<ElementGroup> m_element_groups;
82 const std::vector<unsigned> m_orders;
83};
84
85} // namespace oiseau::dg
std::span< const unsigned > orders() const
Returns orders for top-dimensional cells in mesh order.
Definition dg_space.cpp:161
const ElementGroup * element_group(mesh::CellKind kind, unsigned order) const
Finds a group by cell kind and polynomial order.
Definition dg_space.cpp:154
std::span< const ElementGroup > element_groups() const
Returns all element groups.
Definition dg_space.cpp:150
const mesh::Mesh & mesh() const
Returns the source mesh.
Definition dg_space.hpp:66
Definition mesh.hpp:15
Stores cells that share a cell kind and polynomial order.
Definition dg_space.hpp:27
std::vector< std::size_t > cell_indices
Source mesh indices for cells in this group.
Definition dg_space.hpp:33
mesh::CellKind kind
Reference-cell kind shared by every cell in the group.
Definition dg_space.hpp:29
xt::xarray< double > nodes
Physical coordinates of the group nodes.
Definition dg_space.hpp:38
unsigned order
Polynomial order shared by every cell in the group.
Definition dg_space.hpp:31