From: David Wells Date: Tue, 3 Jan 2017 17:44:41 +0000 (-0500) Subject: Remove variables that only appear in assertions. X-Git-Tag: v8.5.0-rc1~291^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=507dae13d60cdafbaa74000c6506e0a1517698e7;p=dealii.git Remove variables that only appear in assertions. This was caught by cppcheck. --- diff --git a/include/deal.II/base/quadrature_point_data.h b/include/deal.II/base/quadrature_point_data.h index 9542728d6e..80c603dc6b 100644 --- a/include/deal.II/base/quadrature_point_data.h +++ b/include/deal.II/base/quadrature_point_data.h @@ -639,12 +639,11 @@ void pack_cell_data const std::vector > qpd = data_storage->get_data(cell); - const unsigned int m = matrix_data.m(); const unsigned int n = matrix_data.n(); std::vector single_qp_data(n); - Assert (qpd.size() == m, - ExcDimensionMismatch(qpd.size(),m)); + Assert (qpd.size() == matrix_data.m(), + ExcDimensionMismatch(qpd.size(), matrix_data.m())); for (unsigned int q = 0; q < qpd.size(); q++) { qpd[q]->pack_values(single_qp_data); @@ -673,12 +672,11 @@ void unpack_to_cell_data std::vector > qpd = data_storage->get_data(cell); - const unsigned int m = values_at_qp.m(); const unsigned int n = values_at_qp.n(); std::vector single_qp_data(n); - Assert(qpd.size() == m, - ExcDimensionMismatch(qpd.size(),m)); + Assert(qpd.size() == values_at_qp.m(), + ExcDimensionMismatch(qpd.size(), values_at_qp.m())); for (unsigned int q = 0; q < qpd.size(); q++) { diff --git a/include/deal.II/integrators/maxwell.h b/include/deal.II/integrators/maxwell.h index e7e08589c5..80fa9cff91 100644 --- a/include/deal.II/integrators/maxwell.h +++ b/include/deal.II/integrators/maxwell.h @@ -225,11 +225,12 @@ namespace LocalIntegrators const FEValuesBase &fetest, double factor = 1.) { - unsigned int t_comp = (dim==3) ? dim : 1; const unsigned int n_dofs = fe.dofs_per_cell; const unsigned int t_dofs = fetest.dofs_per_cell; AssertDimension(fe.get_fe().n_components(), dim); - AssertDimension(fetest.get_fe().n_components(), t_comp); + // There should be the right number of components (3 in 3D, otherwise 1) + // for the curl. + AssertDimension(fetest.get_fe().n_components(), (dim == 3) ? dim : 1); AssertDimension(M.m(), t_dofs); AssertDimension(M.n(), n_dofs);