Reference documentation for deal.II version 9.3.3
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
util.h
Go to the documentation of this file.
1// ---------------------------------------------------------------------
2//
3// Copyright (C) 2020 - 2021 by the deal.II authors
4//
5// This file is part of the deal.II library.
6//
7// The deal.II library is free software; you can use it, redistribute
8// it, and/or modify it under the terms of the GNU Lesser General
9// Public License as published by the Free Software Foundation; either
10// version 2.1 of the License, or (at your option) any later version.
11// The full text of the license can be found in the file LICENSE.md at
12// the top level directory of deal.II.
13//
14// ---------------------------------------------------------------------
15
16
17#ifndef dealii_matrix_free_util_h
18#define dealii_matrix_free_util_h
19
20
21#include <deal.II/base/config.h>
22
25
27
29
31
32
33namespace internal
34{
35 namespace MatrixFreeFunctions
36 {
37 template <int dim>
38 inline std::pair<::ReferenceCell, ::hp::QCollection<dim - 1>>
40 const bool do_assert = true)
41 {
42 if (dim == 2 || dim == 3)
43 {
44 for (unsigned int i = 1; i <= 4; ++i)
45 if (quad == QGaussSimplex<dim>(i))
46 {
47 QGaussSimplex<dim - 1> tri(i);
48
49 if (dim == 2)
51 ::hp::QCollection<dim - 1>(tri, tri, tri)};
52 else
54 ::hp::QCollection<dim - 1>(tri, tri, tri, tri)};
55 }
56
57 for (unsigned int i = 1; i <= 5; ++i)
58 if (quad == QWitherdenVincentSimplex<dim>(i))
59 {
60 QWitherdenVincentSimplex<dim - 1> tri(i);
61
62 if (dim == 2)
64 ::hp::QCollection<dim - 1>(tri, tri, tri)};
65 else
67 ::hp::QCollection<dim - 1>(tri, tri, tri, tri)};
68 }
69 }
70
71 if (dim == 3)
72 for (unsigned int i = 1; i <= 3; ++i)
73 if (quad == QGaussWedge<dim>(i))
74 {
75 QGauss<dim - 1> quad(i);
76 QGaussSimplex<dim - 1> tri(i);
77
78 return {
80 ::hp::QCollection<dim - 1>(tri, tri, quad, quad, quad)};
81 }
82
83 if (dim == 3)
84 for (unsigned int i = 1; i <= 2; ++i)
85 if (quad == QGaussPyramid<dim>(i))
86 {
87 QGauss<dim - 1> quad(i);
88 QGaussSimplex<dim - 1> tri(i);
89
90 return {
92 ::hp::QCollection<dim - 1>(quad, tri, tri, tri, tri)};
93 }
94
95 if (do_assert)
97
98 return {ReferenceCells::Invalid, ::hp::QCollection<dim - 1>()};
99 }
100
101
102
103 template <int dim>
104 inline std::pair<Quadrature<dim - 1>, Quadrature<dim - 1>>
106 {
107 if (dim == 2 || dim == 3)
108 for (unsigned int i = 1; i <= 3; ++i)
109 if (quad == QGaussSimplex<dim>(i))
110 {
111 if (dim == 2)
112 return {QGaussSimplex<dim - 1>(i), Quadrature<dim - 1>()};
113 else
114 return {Quadrature<dim - 1>(), QGaussSimplex<dim - 1>(i)};
115 }
116
117 if (dim == 3)
118 for (unsigned int i = 1; i <= 3; ++i)
119 if (quad == QGaussWedge<dim>(i))
120 return {QGauss<dim - 1>(i), QGaussSimplex<dim - 1>(i)};
121
122 if (dim == 3)
123 for (unsigned int i = 1; i <= 2; ++i)
124 if (quad == QGaussPyramid<dim>(i))
125 return {QGauss<dim - 1>(i), QGaussSimplex<dim - 1>(i)};
126
128
129 return {QGauss<dim - 1>(1), QGauss<dim - 1>(1)};
130 }
131 } // end of namespace MatrixFreeFunctions
132} // end of namespace internal
133
135
136#endif
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:402
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:403
static ::ExceptionBase & ExcNotImplemented()
#define AssertThrow(cond, exc)
Definition: exceptions.h:1575
constexpr const ReferenceCell Tetrahedron
constexpr const ReferenceCell Wedge
constexpr const ReferenceCell Pyramid
constexpr const ReferenceCell Invalid
constexpr const ReferenceCell Triangle
std::pair<::ReferenceCell, ::hp::QCollection< dim - 1 > > get_face_quadrature_collection(const Quadrature< dim > &quad, const bool do_assert=true)
Definition: util.h:39
std::pair< Quadrature< dim - 1 >, Quadrature< dim - 1 > > get_unique_face_quadratures(const Quadrature< dim > &quad)
Definition: util.h:105