Reference documentation for deal.II version 9.5.0
\(\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// Copyright (C) 2003 - 2020 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
18
20
21
22template <int dim>
25 const unsigned int order)
26{
27 if (s == "gauss")
28 return QGauss<dim>(order);
29 else if (s == "gauss_lobatto")
30 return QGaussLobatto<dim>(order);
31 else if (s == "gauss_chebyshev")
32 return QGaussChebyshev<dim>(order);
33 else if (s == "gauss_radau_chebyshev")
34 return QGaussRadauChebyshev<dim>(order);
35 else if (s == "gauss_lobatto_chebyshev")
36 return QGaussLobattoChebyshev<dim>(order);
37 else
38 {
39 AssertThrow(order == 0, ExcInvalidOrder(s, order));
40
41 if (s == "midpoint")
42 return QMidpoint<dim>();
43 else if (s == "milne")
44 return QMilne<dim>();
45 else if (s == "simpson")
46 return QSimpson<dim>();
47 // The following name is DEAL_II_DEPRECATED and should be
48 // removed once the 'using' declaration is removed.
49 else if (s == "trapez")
50 return QTrapezoid<dim>();
51 else if (s == "trapezoid")
52 return QTrapezoid<dim>();
53 else if (s == "weddle")
54 return QWeddle<dim>();
55 }
56
57 // we didn't find this name
58 AssertThrow(false, ExcInvalidQuadrature(s));
59 // return something to suppress
60 // stupid warnings by some
61 // compilers
62 return Quadrature<dim>();
63}
64
65
66
67template <int dim>
69 const unsigned int order)
70 : Quadrature<dim>(create_quadrature(s, order).get_points(),
71 create_quadrature(s, order).get_weights())
72{}
73
74
75
76template <int dim>
77std::string
79{
80 return std::string(
81 "gauss|gauss_lobatto|gauss_chebyshev|gauss_radau_chebyshev|gauss_lobatto_chebyshev|midpoint|milne|simpson|trapez|weddle");
82}
83
84
85
86// explicit instantiations
87template class QuadratureSelector<1>;
88template class QuadratureSelector<2>;
89template class QuadratureSelector<3>;
90
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:472
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:473
#define AssertThrow(cond, exc)