Reference documentation for deal.II version Git 193422c69f 2020-07-08 17:07:46 +0200
\(\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\}}\)
quadrature_selector.cc
Go to the documentation of this file.
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 2003 - 2019 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 
22 template <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  else if (s == "trapez")
48  return QTrapez<dim>();
49  else if (s == "weddle")
50  return QWeddle<dim>();
51  }
52 
53  // we didn't find this name
54  AssertThrow(false, ExcInvalidQuadrature(s));
55  // return something to suppress
56  // stupid warnings by some
57  // compilers
58  return Quadrature<dim>();
59 }
60 
61 
62 
63 template <int dim>
65  const unsigned int order)
66  : Quadrature<dim>(create_quadrature(s, order).get_points(),
67  create_quadrature(s, order).get_weights())
68 {}
69 
70 
71 
72 template <int dim>
73 std::string
75 {
76  return std::string(
77  "gauss|gauss_lobatto|gauss_chebyshev|gauss_radau_chebyshev|gauss_lobatto_chebyshev|midpoint|milne|simpson|trapez|weddle");
78 }
79 
80 
81 
82 // explicit instantiations
83 template class QuadratureSelector<1>;
84 template class QuadratureSelector<2>;
85 template class QuadratureSelector<3>;
86 
static Quadrature< dim > create_quadrature(const std::string &s, const unsigned int order)
static std::string get_quadrature_names()
#define AssertThrow(cond, exc)
Definition: exceptions.h:1513
QuadratureSelector(const std::string &s, const unsigned int order=0)
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:363
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:362