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