deal.II version GIT relicensing-6834-g5b78e6bcdf 2026-10-01 11:20:01+00:00
\(\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\}}\)
Loading...
Searching...
No Matches
quadrature_selector.cc
Go to the documentation of this file.
1// -----------------------------------------------------------------------------
2//
3// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception OR LGPL-2.1-or-later
4// Copyright (C) 2003 - 2026 by the deal.II authors
5//
6// This file is part of the deal.II library.
7//
8// Detailed license information governing the source code and contributions
9// can be found in LICENSE.md and CONTRIBUTING.md at the top level directory.
10//
11// -----------------------------------------------------------------------------
12
13#include <deal.II/base/config.h>
14
20
21#include <string>
22
24
25
26template <int dim>
29 const unsigned int order)
30{
31 if (s == "gauss")
32 return QGauss<dim>(order);
33 else if (s == "gauss_lobatto")
34 return QGaussLobatto<dim>(order);
35 else if (s == "gauss_chebyshev")
36 return QGaussChebyshev<dim>(order);
37 else if (s == "gauss_radau_chebyshev")
38 return QGaussRadauChebyshev<dim>(order);
39 else if (s == "gauss_lobatto_chebyshev")
40 return QGaussLobattoChebyshev<dim>(order);
41 else
42 {
43 AssertThrow(order == 0, ExcInvalidOrder(s, order));
44
45 if (s == "midpoint")
46 return QMidpoint<dim>();
47 else if (s == "milne")
48 return QMilne<dim>();
49 else if (s == "simpson")
50 return QSimpson<dim>();
51 // The following name is DEAL_II_DEPRECATED and should be
52 // removed once the 'using' declaration is removed.
53 else if (s == "trapez")
54 return QTrapezoid<dim>();
55 else if (s == "trapezoid")
56 return QTrapezoid<dim>();
57 else if (s == "weddle")
58 return QWeddle<dim>();
59 }
60
61 // we didn't find this name
62 AssertThrow(false, ExcInvalidQuadrature(s));
63 // return something to suppress
64 // stupid warnings by some
65 // compilers
66 return Quadrature<dim>();
67}
68
69
70
71template <int dim>
73 const unsigned int order)
74 : Quadrature<dim>(create_quadrature(s, order).get_points(),
75 create_quadrature(s, order).get_weights())
76{}
77
78
79
80template <int dim>
81std::string
83{
84 return std::string(
85 "gauss|gauss_lobatto|gauss_chebyshev|gauss_radau_chebyshev|gauss_lobatto_chebyshev|midpoint|milne|simpson|trapez|weddle");
86}
87
88
89
90// explicit instantiations
91template class QuadratureSelector<1>;
92template class QuadratureSelector<2>;
93template class QuadratureSelector<3>;
94
static std::string get_quadrature_names()
QuadratureSelector(const std::string &s, const unsigned int order=0)
static Quadrature< dim > create_quadrature(const std::string &s, const unsigned int order)
#define DEAL_II_NAMESPACE_OPEN
Definition config.h:38
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:39
#define AssertThrow(cond, exc)