DeclExceptionMsg (ExcInvalidQuadratureFormula,
"The quadrature formula you provided cannot be used "
"as the basis for iteration.");
-private:
- /**
- * Check whether the given quadrature formula has quadrature points at the
- * left and right end points of the interval.
- */
- static bool
- uses_both_endpoints (const Quadrature<1> &base_quadrature);
};
// ------------------------------------------------------------ //
-
-template <>
-bool
-QIterated<1>::uses_both_endpoints (const Quadrature<1> &base_quadrature)
+namespace internal
{
- bool at_left = false,
- at_right = false;
- for (unsigned int i=0; i<base_quadrature.size(); ++i)
+ namespace QIterated
+ {
+ namespace
{
- if (base_quadrature.point(i) == Point<1>(0.0))
- at_left = true;
- if (base_quadrature.point(i) == Point<1>(1.0))
- at_right = true;
- };
+ bool uses_both_endpoints(const Quadrature<1> &base_quadrature)
+ {
+ bool at_left = false,
+ at_right = false;
+ for (unsigned int i = 0; i<base_quadrature.size(); ++i)
+ {
+ if (base_quadrature.point(i) == Point<1>(0.0))
+ at_left = true;
+ if (base_quadrature.point(i) == Point<1>(1.0))
+ at_right = true;
+ }
- return (at_left && at_right);
+ return (at_left && at_right);
+ }
+ }
+ }
}
-
// template <>
// void
// QIterated<1>::fill(Quadrature<1>& dst,
QIterated<1>::QIterated (const Quadrature<1> &base_quadrature,
const unsigned int n_copies)
:
- Quadrature<1> (uses_both_endpoints(base_quadrature) ?
+ Quadrature<1> (internal::QIterated::uses_both_endpoints(base_quadrature) ?
(base_quadrature.size()-1) * n_copies + 1 :
base_quadrature.size() * n_copies)
{
Assert (base_quadrature.size() > 0, ExcNotInitialized());
Assert (n_copies > 0, ExcZero());
- if (!uses_both_endpoints(base_quadrature))
+ if (!internal::QIterated::uses_both_endpoints(base_quadrature))
// we don't have to skip some
// points in order to get a
// reasonable quadrature formula