Vulpes  0.1.0
Versatile and parallel compUtational Library for high-order discontinuous Polytopal Element Simulations
Loading...
Searching...
No Matches
qfree.hpp
Go to the documentation of this file.
1// ----------------------------------------------------------------------
2//
3// Copyright (C) 2024 - 2026 by the Vulpes authors.
4// This file is part of Vulpes.
5//
6// Vulpes is free software; you can redistribute it and/or modify
7// it under the terms of the GNU General Public License as published by
8// the Free Software Foundation, either version 3 of the License, or
9// (at your option) any later version.
10//
11// Vulpes is distributed in the hope that it will be useful,
12// but WITHOUT ANY WARRANTY; without even the implied warranty of
13// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14// General Public License for more details.
15//
16// You should have received a copy of the GNU General Public License
17// along with Vulpes. If not, see <http://www.gnu.org/licenses/>.
18//
19// ----------------------------------------------------------------------
20
21// Author: Matteo Caldana <matteo.caldana@polimi.it>
22
23#ifndef VULPES_QUADRATURE_QFREE_HPP_
24#define VULPES_QUADRATURE_QFREE_HPP_
25
26#include <algorithm>
27#include <array>
28#include <cassert>
29#include <cstddef>
30#include <iterator>
31#include <set>
32#include <tuple>
33#include <utility>
34#include <vector>
35
36#include <Eigen/Core>
37#include <Eigen/Dense>
38
44
45namespace vulpes {
46
47// forward declaration
48namespace geometry {
49template <typename FloatType, typename IndexType>
50class Cell2D;
51template <typename FloatType, typename IndexType>
52class Cell3D;
53template <
54 std::size_t Dim,
55 typename FloatType,
56 typename IndexType,
57 typename = std::enable_if_t<(Dim == 2) || (Dim == 3)>>
58using Cell = std::conditional_t<
59 Dim == 2,
62} // namespace geometry
63
64namespace qfree {
65
66using geometry::Point;
67
69// 2D
71
72template <bool PPoly, typename FloatType, typename IndexType>
73using AreaIntegral2D =
74 datastructure::TriMatrix<PPoly, false, FloatType, IndexType>;
75
76template <bool PPoly, typename FloatType, typename IndexType>
77using EdgeIntegral2D =
78 datastructure::TriMatrix<PPoly, true, FloatType, IndexType>;
79
121template <bool PPoly, typename FloatType, typename IndexType>
122std::pair<
126 const geometry::Cell2D<FloatType, IndexType>& cell, IndexType deg);
127
129// 3D
131
132template <bool PPoly, typename FloatType, typename IndexType>
133using VolumeIntegral3D =
134 datastructure::TetraTensor<PPoly, false, FloatType, IndexType>;
135template <bool PPoly, typename FloatType, typename IndexType>
136using LowerIntegral3D =
137 datastructure::TetraTensor<PPoly, true, FloatType, IndexType>;
138
213template <bool PPoly, bool Pruning, typename FloatType, typename IndexType>
214std::pair<
218 const geometry::Cell3D<FloatType, IndexType>& elem, IndexType deg);
219
221
222extern template std::pair<
226 const geometry::Cell2D<double, int32_t>& cell, int32_t deg);
227
228extern template std::pair<
232 const geometry::Cell2D<double, int32_t>& cell, int32_t deg);
233
234extern template std::pair<
238 const geometry::Cell3D<double, int32_t>& elem, int32_t deg);
239
240extern template std::pair<
244 const geometry::Cell3D<double, int32_t>& elem, int32_t deg);
245
246extern template std::pair<
250 const geometry::Cell3D<double, int32_t>& elem, int32_t deg);
251
252extern template std::pair<
256 const geometry::Cell3D<double, int32_t>& elem, int32_t deg);
257
258template <
259 bool PPoly,
260 bool Pruning,
261 std::size_t Dim,
262 typename FloatType,
263 typename IndexType>
265 const geometry::Cell<Dim, FloatType, IndexType>& elem, IndexType deg) {
266 if constexpr (Dim == 2) {
268 } else if constexpr (Dim == 3) {
270 elem, deg);
271 } else {
272 static_assert(Dim * 0 && "NotImplementedError");
273 }
274}
275
276} // namespace qfree
277} // namespace vulpes
278#endif // VULPES_QUADRATURE_QFREE_HPP_
Definition cell.hpp:98
Definition cell.hpp:151
Definition abs_agg_model.cpp:40
Eigen::Matrix< DataType, Dim, 1, Eigen::ColMajor > Point
Definition traits.hpp:34
std::conditional_t< Dim==2, Cell2D< FloatType, IndexType >, Cell3D< FloatType, IndexType > > Cell
Definition cell.hpp:267
Definition cell.hpp:49
template std::pair< AreaIntegral2D< false, double, int32_t >, EdgeIntegral2D< false, double, int32_t > > integrateMonomialsQFree2D< false, double, int32_t >(const geometry::Cell2D< double, int32_t > &cell, int32_t deg)
template std::pair< VolumeIntegral3D< true, double, int32_t >, LowerIntegral3D< true, double, int32_t > > integrateMonomialsQFree3D< true, true, double, int32_t >(const geometry::Cell3D< double, int32_t > &elem, int32_t deg)
template std::pair< VolumeIntegral3D< false, double, int32_t >, LowerIntegral3D< false, double, int32_t > > integrateMonomialsQFree3D< false, true, double, int32_t >(const geometry::Cell3D< double, int32_t > &elem, int32_t deg)
datastructure::TetraTensor< PPoly, false, FloatType, IndexType > VolumeIntegral3D
Definition cell.hpp:63
template std::pair< VolumeIntegral3D< true, double, int32_t >, LowerIntegral3D< true, double, int32_t > > integrateMonomialsQFree3D< true, false, double, int32_t >(const geometry::Cell3D< double, int32_t > &elem, int32_t deg)
std::pair< VolumeIntegral3D< PPoly, FloatType, IndexType >, LowerIntegral3D< PPoly, FloatType, IndexType > > integrateMonomialsQFree3D(const geometry::Cell3D< FloatType, IndexType > &elem, IndexType deg)
Computes the volume and lower-dimensional integrals over a 3D element without quadrature.
Definition qfree.cpp:106
datastructure::TriMatrix< PPoly, true, FloatType, IndexType > EdgeIntegral2D
Definition cell.hpp:54
template std::pair< AreaIntegral2D< true, double, int32_t >, EdgeIntegral2D< true, double, int32_t > > integrateMonomialsQFree2D< true, double, int32_t >(const geometry::Cell2D< double, int32_t > &cell, int32_t deg)
datastructure::TetraTensor< PPoly, true, FloatType, IndexType > LowerIntegral3D
Definition cell.hpp:66
auto integrateMonomialsQFree(const geometry::Cell< Dim, FloatType, IndexType > &elem, IndexType deg)
Definition qfree.hpp:264
template std::pair< VolumeIntegral3D< false, double, int32_t >, LowerIntegral3D< false, double, int32_t > > integrateMonomialsQFree3D< false, false, double, int32_t >(const geometry::Cell3D< double, int32_t > &elem, int32_t deg)
std::pair< AreaIntegral2D< PPoly, FloatType, IndexType >, EdgeIntegral2D< PPoly, FloatType, IndexType > > integrateMonomialsQFree2D(const geometry::Cell2D< FloatType, IndexType > &cell, IndexType deg)
Computes the 2D area and edge integrals over a polygonal cell without requiring quadrature points of ...
Definition qfree.cpp:36
datastructure::TriMatrix< PPoly, false, FloatType, IndexType > AreaIntegral2D
Definition cell.hpp:51
Definition cell_manager.hpp:38