From: Daniel Jodlbauer Date: Mon, 11 Nov 2019 14:11:58 +0000 (+0100) Subject: Add more choices to QuadratureSelector X-Git-Tag: v9.2.0-rc1~886^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2a7d3884e13b47a08013ec4b884685b7d1080c92;p=dealii.git Add more choices to QuadratureSelector --- diff --git a/doc/news/changes/minor/20191111DanielJodlbauer b/doc/news/changes/minor/20191111DanielJodlbauer new file mode 100644 index 0000000000..fdfa14710e --- /dev/null +++ b/doc/news/changes/minor/20191111DanielJodlbauer @@ -0,0 +1,3 @@ +New: add more quadrature choices to QuadratureSelector class. +
+(Daniel Jodlbauer, 2019/11/11) diff --git a/source/base/quadrature_selector.cc b/source/base/quadrature_selector.cc index ceac8d8c09..f080454309 100644 --- a/source/base/quadrature_selector.cc +++ b/source/base/quadrature_selector.cc @@ -25,10 +25,15 @@ QuadratureSelector::create_quadrature(const std::string &s, const unsigned int order) { if (s == "gauss") - { - AssertThrow(order >= 1, ExcInvalidQGaussOrder(order)); - return QGauss(order); - } + return QGauss(order); + else if (s == "gauss_lobatto") + return QGaussLobatto(order); + else if (s == "gauss_chebyshev") + return QGaussChebyshev(order); + else if (s == "gauss_radau_chebyshev") + return QGaussRadauChebyshev(order); + else if (s == "gauss_lobatto_chebyshev") + return QGaussLobattoChebyshev(order); else { AssertThrow(order == 0, ExcInvalidOrder(s, order)); @@ -68,7 +73,8 @@ template std::string QuadratureSelector::get_quadrature_names() { - return std::string("gauss|midpoint|milne|simpson|trapez|weddle"); + return std::string( + "gauss|gauss_lobatto|gauss_chebyshev|gauss_radau_chebyshev|gauss_lobatto_chebyshev|midpoint|milne|simpson|trapez|weddle"); } diff --git a/tests/base/quadrature_selector.cc b/tests/base/quadrature_selector.cc index e57984825d..5bf2e1e3d7 100644 --- a/tests/base/quadrature_selector.cc +++ b/tests/base/quadrature_selector.cc @@ -53,4 +53,20 @@ main() check("gauss", 10, QGauss<3>(10)); check("weddle", 0, QWeddle<2>()); + + check("gauss_lobatto", 2, QGaussLobatto<1>(2)); + check("gauss_lobatto", 3, QGaussLobatto<2>(3)); + check("gauss_lobatto", 4, QGaussLobatto<3>(4)); + + check("gauss_chebyshev", 2, QGaussChebyshev<1>(2)); + check("gauss_chebyshev", 3, QGaussChebyshev<2>(3)); + check("gauss_chebyshev", 4, QGaussChebyshev<3>(4)); + + check("gauss_radau_chebyshev", 2, QGaussRadauChebyshev<1>(2)); + check("gauss_radau_chebyshev", 3, QGaussRadauChebyshev<2>(3)); + check("gauss_radau_chebyshev", 4, QGaussRadauChebyshev<3>(4)); + + check("gauss_lobatto_chebyshev", 2, QGaussLobattoChebyshev<1>(2)); + check("gauss_lobatto_chebyshev", 3, QGaussLobattoChebyshev<2>(3)); + check("gauss_lobatto_chebyshev", 4, QGaussLobattoChebyshev<3>(4)); } diff --git a/tests/base/quadrature_selector.output b/tests/base/quadrature_selector.output index 6d38047d10..97c20aae71 100644 --- a/tests/base/quadrature_selector.output +++ b/tests/base/quadrature_selector.output @@ -6,3 +6,15 @@ DEAL::gauss 2 ok DEAL::gauss 6 ok DEAL::gauss 10 ok DEAL::weddle 0 ok +DEAL::gauss_lobatto 2 ok +DEAL::gauss_lobatto 3 ok +DEAL::gauss_lobatto 4 ok +DEAL::gauss_chebyshev 2 ok +DEAL::gauss_chebyshev 3 ok +DEAL::gauss_chebyshev 4 ok +DEAL::gauss_radau_chebyshev 2 ok +DEAL::gauss_radau_chebyshev 3 ok +DEAL::gauss_radau_chebyshev 4 ok +DEAL::gauss_lobatto_chebyshev 2 ok +DEAL::gauss_lobatto_chebyshev 3 ok +DEAL::gauss_lobatto_chebyshev 4 ok