From b34e375b6b4cc66f681557283563e3e755336bb8 Mon Sep 17 00:00:00 2001 From: David Wells Date: Sun, 20 Sep 2020 13:19:42 -0400 Subject: [PATCH] Reflow some comments. --- source/base/quadrature.cc | 60 ++++++++++++++------------------------- 1 file changed, 22 insertions(+), 38 deletions(-) diff --git a/source/base/quadrature.cc b/source/base/quadrature.cc index 52825656d5..023dc56dfb 100644 --- a/source/base/quadrature.cc +++ b/source/base/quadrature.cc @@ -136,9 +136,8 @@ Quadrature::Quadrature(const SubQuadrature &q1, const Quadrature<1> &q2) for (unsigned int i2 = 0; i2 < q2.size(); ++i2) for (unsigned int i1 = 0; i1 < q1.size(); ++i1) { - // compose coordinates of - // new quadrature point by tensor - // product in the last component + // compose coordinates of new quadrature point by tensor product in the + // last component for (unsigned int d = 0; d < dim - 1; ++d) quadrature_points[present_index](d) = q1.point(i1)(d); quadrature_points[present_index](dim - 1) = q2.point(i2)(0); @@ -154,9 +153,8 @@ Quadrature::Quadrature(const SubQuadrature &q1, const Quadrature<1> &q2) double sum = 0; for (unsigned int i = 0; i < size(); ++i) sum += weights[i]; - // we cannot guarantee the sum of weights - // to be exactly one, but it should be - // near that. + // we cannot guarantee the sum of weights to be exactly one, but it should + // be near that. Assert((sum > 0.999999) && (sum < 1.000001), ExcInternalError()); } #endif @@ -181,9 +179,8 @@ Quadrature<1>::Quadrature(const SubQuadrature &, const Quadrature<1> &q2) unsigned int present_index = 0; for (unsigned int i2 = 0; i2 < q2.size(); ++i2) { - // compose coordinates of - // new quadrature point by tensor - // product in the last component + // compose coordinates of new quadrature point by tensor product in the + // last component quadrature_points[present_index](0) = q2.point(i2)(0); weights[present_index] = q2.weight(i2); @@ -197,9 +194,8 @@ Quadrature<1>::Quadrature(const SubQuadrature &, const Quadrature<1> &q2) double sum = 0; for (unsigned int i = 0; i < size(); ++i) sum += weights[i]; - // we cannot guarantee the sum of weights - // to be exactly one, but it should be - // near that. + // we cannot guarantee the sum of weights to be exactly one, but it should + // be near that. Assert((sum > 0.999999) && (sum < 1.000001), ExcInternalError()); } # endif @@ -211,7 +207,7 @@ template <> Quadrature<0>::Quadrature(const Quadrature<1> &) : Subscriptor() , - // quadrature_points(1), + // quadrature_points(1), weights(1, 1.) , is_tensor_product_flag(false) {} @@ -221,9 +217,8 @@ template <> Quadrature<1>::Quadrature(const Quadrature<0> &) : Subscriptor() { - // this function should never be - // called -- this should be the - // copy constructor in 1d... + // this function should never be called -- this should be the copy constructor + // in 1d... Assert(false, ExcImpossibleInDim(1)); } #endif // DOXYGEN @@ -482,9 +477,8 @@ QIterated<1>::QIterated(const Quadrature<1> &base_quadrature, Assert(n_copies > 0, ExcZero()); if (!internal::QIteratedImplementation::uses_both_endpoints(base_quadrature)) - // we don't have to skip some - // points in order to get a - // reasonable quadrature formula + // we don't have to skip some points in order to get a reasonable quadrature + // formula { unsigned int next_point = 0; for (unsigned int copy = 0; copy < n_copies; ++copy) @@ -505,16 +499,12 @@ QIterated<1>::QIterated(const Quadrature<1> &base_quadrature, { unsigned int next_point = 0; - // first find out the weights of - // the left and the right boundary - // points. note that these usually - // are but need not necessarily be - // the same + // first find out the weights of the left and the right boundary points. + // note that these usually are but need not necessarily be the same double double_point_weight = 0; unsigned int n_end_points = 0; for (unsigned int i = 0; i < base_quadrature.size(); ++i) - // add up the weight if this - // is an endpoint + // add up the weight if this is an endpoint if ((base_quadrature.point(i) == Point<1>(0.0)) || (base_quadrature.point(i) == Point<1>(1.0))) { @@ -524,9 +514,8 @@ QIterated<1>::QIterated(const Quadrature<1> &base_quadrature, // scale the weight correctly double_point_weight /= n_copies; - // make sure the base quadrature formula - // has only one quadrature point - // per end point + // make sure the base quadrature formula has only one quadrature point per + // end point Assert(n_end_points == 2, ExcInvalidQuadratureFormula()); @@ -534,10 +523,8 @@ QIterated<1>::QIterated(const Quadrature<1> &base_quadrature, for (unsigned int q_point = 0; q_point < base_quadrature.size(); ++q_point) { - // skip the left point of - // this copy since we - // have already entered - // it the last time + // skip the left point of this copy since we have already entered it + // the last time if ((copy > 0) && (base_quadrature.point(q_point) == Point<1>(0.0))) continue; @@ -545,11 +532,8 @@ QIterated<1>::QIterated(const Quadrature<1> &base_quadrature, Point<1>(base_quadrature.point(q_point)(0) / n_copies + (1.0 * copy) / n_copies); - // if this is the - // rightmost point of one - // of the non-last - // copies: give it the - // double weight + // if this is the rightmost point of one of the non-last copies: + // give it the double weight if ((copy != n_copies - 1) && (base_quadrature.point(q_point) == Point<1>(1.0))) this->weights[next_point] = double_point_weight; -- 2.39.5