]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Improve some assertions 12603/head
authorJean-Paul Pelteret <jppelteret@gmail.com>
Wed, 11 Aug 2021 02:51:15 +0000 (04:51 +0200)
committerJean-Paul Pelteret <jppelteret@gmail.com>
Wed, 11 Aug 2021 02:51:15 +0000 (04:51 +0200)
include/deal.II/fe/fe_interface_values.h

index b3ecab1cc3116714818c4eefcd2cecb135068b39..d5b228d2d040c30b26f98327976e8cc7028983ed 100644 (file)
@@ -2836,8 +2836,7 @@ namespace FEInterfaceViews
     std::vector<solution_value_type<typename InputVector::value_type>> &values)
     const
   {
-    Assert(values.size() == this->fe_interface->n_quadrature_points,
-           ExcNotImplemented());
+    AssertDimension(values.size(), this->fe_interface->n_quadrature_points);
 
     const auto &interface_dof_indices =
       this->fe_interface->get_interface_dof_indices();
@@ -2883,8 +2882,7 @@ namespace FEInterfaceViews
     std::vector<solution_value_type<typename InputVector::value_type>> &values)
     const
   {
-    Assert(values.size() == this->fe_interface->n_quadrature_points,
-           ExcNotImplemented());
+    AssertDimension(values.size(), this->fe_interface->n_quadrature_points);
 
     const auto &interface_dof_indices =
       this->fe_interface->get_interface_dof_indices();
@@ -2927,8 +2925,7 @@ namespace FEInterfaceViews
     std::vector<solution_gradient_type<typename InputVector::value_type>>
       &gradients) const
   {
-    Assert(gradients.size() == this->fe_interface->n_quadrature_points,
-           ExcNotImplemented());
+    AssertDimension(gradients.size(), this->fe_interface->n_quadrature_points);
 
     const auto &interface_dof_indices =
       this->fe_interface->get_interface_dof_indices();
@@ -2972,8 +2969,7 @@ namespace FEInterfaceViews
     std::vector<solution_value_type<typename InputVector::value_type>> &values)
     const
   {
-    Assert(values.size() == this->fe_interface->n_quadrature_points,
-           ExcNotImplemented());
+    AssertDimension(values.size(), this->fe_interface->n_quadrature_points);
 
     const auto &interface_dof_indices =
       this->fe_interface->get_interface_dof_indices();
@@ -3018,8 +3014,7 @@ namespace FEInterfaceViews
       std::vector<solution_gradient_type<typename InputVector::value_type>>
         &gradients) const
   {
-    Assert(gradients.size() == this->fe_interface->n_quadrature_points,
-           ExcNotImplemented());
+    AssertDimension(gradients.size(), this->fe_interface->n_quadrature_points);
 
     const auto &interface_dof_indices =
       this->fe_interface->get_interface_dof_indices();
@@ -3063,8 +3058,7 @@ namespace FEInterfaceViews
     std::vector<solution_hessian_type<typename InputVector::value_type>>
       &hessians) const
   {
-    Assert(hessians.size() == this->fe_interface->n_quadrature_points,
-           ExcNotImplemented());
+    AssertDimension(hessians.size(), this->fe_interface->n_quadrature_points);
 
     const auto &interface_dof_indices =
       this->fe_interface->get_interface_dof_indices();
@@ -3108,8 +3102,7 @@ namespace FEInterfaceViews
     std::vector<solution_hessian_type<typename InputVector::value_type>>
       &hessians) const
   {
-    Assert(hessians.size() == this->fe_interface->n_quadrature_points,
-           ExcNotImplemented());
+    AssertDimension(hessians.size(), this->fe_interface->n_quadrature_points);
 
     const auto &interface_dof_indices =
       this->fe_interface->get_interface_dof_indices();
@@ -3156,8 +3149,8 @@ namespace FEInterfaceViews
         solution_third_derivative_type<typename InputVector::value_type>>
         &third_derivatives) const
   {
-    Assert(third_derivatives.size() == this->fe_interface->n_quadrature_points,
-           ExcNotImplemented());
+    AssertDimension(third_derivatives.size(),
+                    this->fe_interface->n_quadrature_points);
 
     const auto &interface_dof_indices =
       this->fe_interface->get_interface_dof_indices();
@@ -3506,8 +3499,7 @@ namespace FEInterfaceViews
     std::vector<solution_value_type<typename InputVector::value_type>> &values)
     const
   {
-    Assert(values.size() == this->fe_interface->n_quadrature_points,
-           ExcNotImplemented());
+    AssertDimension(values.size(), this->fe_interface->n_quadrature_points);
 
     const auto &interface_dof_indices =
       this->fe_interface->get_interface_dof_indices();
@@ -3553,8 +3545,7 @@ namespace FEInterfaceViews
     std::vector<solution_value_type<typename InputVector::value_type>> &values)
     const
   {
-    Assert(values.size() == this->fe_interface->n_quadrature_points,
-           ExcNotImplemented());
+    AssertDimension(values.size(), this->fe_interface->n_quadrature_points);
 
     const auto &interface_dof_indices =
       this->fe_interface->get_interface_dof_indices();
@@ -3597,8 +3588,7 @@ namespace FEInterfaceViews
     std::vector<solution_gradient_type<typename InputVector::value_type>>
       &gradients) const
   {
-    Assert(gradients.size() == this->fe_interface->n_quadrature_points,
-           ExcNotImplemented());
+    AssertDimension(gradients.size(), this->fe_interface->n_quadrature_points);
 
     const auto &interface_dof_indices =
       this->fe_interface->get_interface_dof_indices();
@@ -3642,8 +3632,7 @@ namespace FEInterfaceViews
     std::vector<solution_value_type<typename InputVector::value_type>> &values)
     const
   {
-    Assert(values.size() == this->fe_interface->n_quadrature_points,
-           ExcNotImplemented());
+    AssertDimension(values.size(), this->fe_interface->n_quadrature_points);
 
     const auto &interface_dof_indices =
       this->fe_interface->get_interface_dof_indices();
@@ -3688,8 +3677,7 @@ namespace FEInterfaceViews
       std::vector<solution_gradient_type<typename InputVector::value_type>>
         &gradients) const
   {
-    Assert(gradients.size() == this->fe_interface->n_quadrature_points,
-           ExcNotImplemented());
+    AssertDimension(gradients.size(), this->fe_interface->n_quadrature_points);
 
     const auto &interface_dof_indices =
       this->fe_interface->get_interface_dof_indices();
@@ -3733,8 +3721,7 @@ namespace FEInterfaceViews
     std::vector<solution_hessian_type<typename InputVector::value_type>>
       &hessians) const
   {
-    Assert(hessians.size() == this->fe_interface->n_quadrature_points,
-           ExcNotImplemented());
+    AssertDimension(hessians.size(), this->fe_interface->n_quadrature_points);
 
     const auto &interface_dof_indices =
       this->fe_interface->get_interface_dof_indices();
@@ -3778,8 +3765,7 @@ namespace FEInterfaceViews
     std::vector<solution_hessian_type<typename InputVector::value_type>>
       &hessians) const
   {
-    Assert(hessians.size() == this->fe_interface->n_quadrature_points,
-           ExcNotImplemented());
+    AssertDimension(hessians.size(), this->fe_interface->n_quadrature_points);
 
     const auto &interface_dof_indices =
       this->fe_interface->get_interface_dof_indices();
@@ -3826,8 +3812,8 @@ namespace FEInterfaceViews
         solution_third_derivative_type<typename InputVector::value_type>>
         &third_derivatives) const
   {
-    Assert(third_derivatives.size() == this->fe_interface->n_quadrature_points,
-           ExcNotImplemented());
+    AssertDimension(third_derivatives.size(),
+                    this->fe_interface->n_quadrature_points);
 
     const auto &interface_dof_indices =
       this->fe_interface->get_interface_dof_indices();

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.