Reference documentation for deal.II version 9.2.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\}}\)
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 
QSimpson
Definition: quadrature_lib.h:105
QGaussLobattoChebyshev
Definition: quadrature_lib.h:571
quadrature_lib.h
QTrapez
Definition: quadrature_lib.h:126
QMilne
Definition: quadrature_lib.h:141
QuadratureSelector::create_quadrature
static Quadrature< dim > create_quadrature(const std::string &s, const unsigned int order)
Definition: quadrature_selector.cc:24
DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:358
QGaussLobatto
Definition: quadrature_lib.h:76
QGauss
Definition: quadrature_lib.h:40
QuadratureSelector
Definition: quadrature_selector.h:42
QMidpoint
Definition: quadrature_lib.h:93
quadrature_selector.h
QuadratureSelector::get_quadrature_names
static std::string get_quadrature_names()
Definition: quadrature_selector.cc:74
QWeddle
Definition: quadrature_lib.h:155
QGaussChebyshev
Definition: quadrature_lib.h:499
DEAL_II_NAMESPACE_CLOSE
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:359
QuadratureSelector::QuadratureSelector
QuadratureSelector(const std::string &s, const unsigned int order=0)
Definition: quadrature_selector.cc:64
Quadrature
Definition: quadrature.h:85
QGaussRadauChebyshev
Definition: quadrature_lib.h:524
AssertThrow
#define AssertThrow(cond, exc)
Definition: exceptions.h:1531