From e4861bf60e681a2a2502f08abad7916b0891abf1 Mon Sep 17 00:00:00 2001 From: Martin Kronbichler Date: Wed, 6 Sep 2023 16:09:27 +0200 Subject: [PATCH] Use a simpler form to print an assertion --- source/base/tensor_product_polynomials.cc | 36 ++++++++--------------- 1 file changed, 12 insertions(+), 24 deletions(-) diff --git a/source/base/tensor_product_polynomials.cc b/source/base/tensor_product_polynomials.cc index 9f52511f2f..51eabd0f6d 100644 --- a/source/base/tensor_product_polynomials.cc +++ b/source/base/tensor_product_polynomials.cc @@ -101,8 +101,7 @@ TensorProductPolynomials<0, Polynomials::Polynomial>::compute_index( const unsigned int, std::array &) const { - constexpr int dim = 0; - AssertThrow(dim > 0, ExcNotImplemented()); + AssertThrow(false, ExcNotImplemented("This function does not work in 0-d!")); } @@ -130,8 +129,7 @@ void TensorProductPolynomials<0, Polynomials::Polynomial>::output_indices( std::ostream &) const { - constexpr int dim = 0; - AssertThrow(dim > 0, ExcNotImplemented()); + AssertThrow(false, ExcNotImplemented("This function does not work in 0-d!")); } @@ -156,8 +154,7 @@ void TensorProductPolynomials<0, Polynomials::Polynomial>::set_numbering( const std::vector &) { - constexpr int dim = 0; - AssertThrow(dim > 0, ExcNotImplemented()); + AssertThrow(false, ExcNotImplemented("This function does not work in 0-d!")); } @@ -188,8 +185,7 @@ TensorProductPolynomials<0, Polynomials::Polynomial>::compute_value( const unsigned int, const Point<0> &) const { - constexpr int dim = 0; - AssertThrow(dim > 0, ExcNotImplemented()); + AssertThrow(false, ExcNotImplemented("This function does not work in 0-d!")); return {}; } @@ -239,8 +235,7 @@ TensorProductPolynomials<0, Polynomials::Polynomial>::compute_grad( const unsigned int, const Point<0> &) const { - constexpr int dim = 0; - AssertThrow(dim > 0, ExcNotImplemented()); + AssertThrow(false, ExcNotImplemented("This function does not work in 0-d!")); return {}; } @@ -606,8 +601,7 @@ TensorProductPolynomials<0, Polynomials::Polynomial>::evaluate( std::vector> &, std::vector> &) const { - constexpr int dim = 0; - AssertThrow(dim > 0, ExcNotImplemented()); + AssertThrow(false, ExcNotImplemented("This function does not work in 0-d!")); } @@ -698,8 +692,7 @@ void AnisotropicPolynomials<0>::compute_index(const unsigned int, std::array &) const { - constexpr int dim = 0; - AssertThrow(dim > 0, ExcNotImplemented()); + AssertThrow(false, ExcNotImplemented("This function does not work in 0-d!")); } @@ -726,8 +719,7 @@ double AnisotropicPolynomials<0>::compute_value(const unsigned int, const Point<0> &) const { - constexpr int dim = 0; - AssertThrow(dim > 0, ExcNotImplemented()); + AssertThrow(false, ExcNotImplemented("This function does not work in 0-d!")); return {}; } @@ -768,8 +760,7 @@ Tensor<1, 0> AnisotropicPolynomials<0>::compute_grad(const unsigned int, const Point<0> &) const { - constexpr int dim = 0; - AssertThrow(dim > 0, ExcNotImplemented()); + AssertThrow(false, ExcNotImplemented("This function does not work in 0-d!")); return {}; } @@ -817,8 +808,7 @@ Tensor<2, 0> AnisotropicPolynomials<0>::compute_grad_grad(const unsigned int, const Point<0> &) const { - constexpr int dim = 0; - AssertThrow(dim > 0, ExcNotImplemented()); + AssertThrow(false, ExcNotImplemented("This function does not work in 0-d!")); return {}; } @@ -924,8 +914,7 @@ AnisotropicPolynomials<0>::evaluate(const Point<0> &, std::vector> &, std::vector> &) const { - constexpr int dim = 0; - AssertThrow(dim > 0, ExcNotImplemented()); + AssertThrow(false, ExcNotImplemented("This function does not work in 0-d!")); } @@ -948,8 +937,7 @@ unsigned int AnisotropicPolynomials<0>::get_n_tensor_pols( const std::vector>> &) { - constexpr int dim = 0; - AssertThrow(dim > 0, ExcNotImplemented()); + AssertThrow(false, ExcNotImplemented("This function does not work in 0-d!")); return {}; } -- 2.39.5