* argument given to the constructor needs to be a quadrature formula in
* one space dimension, rather than in #dim# dimensions.
*
+ * The aim of this class is to provide a
+ * low order formula, where the error constant can be tuned by
+ * increasing the number of quadrature points. This is useful in
+ * integrating non-differentiable functions on cells.
+ *
* @author Wolfgang Bangerth 1999
*/
template <int dim>
/**
* Midpoint quadrature rule, exact for linear polynomials.
- * For compatibility, this rule may be accessed as #QGauss1#, too.
*/
template <int dim>
class QMidpoint : public Quadrature<dim>
QMidpoint ();
};
-#define QGauss1 QMidpoint
+
/**
* Simpson quadrature rule, exact for polynomials of degree 3.
};
-/**
- * Iterated trapezoidal rule. The aim of this class is to provide a
- * low order formula, where the error constant can be tuned by
- * increasing the number of quadrature points. This is useful in
- * integrating non-differentiable functions on cells.
- *
- * For internal use, it may be worth to know that the points are
- * ordered in a fashion such that the last coordinate is the one which
- * runs fastest and then lexicographically from back to front.
- */
-template <int dim>
-class QIteratedTrapez :
- public Quadrature<dim>
-{
-public:
- QIteratedTrapez(const unsigned intervals);
-};
-
-/**
- * Iterated Simpson rule.
- * Like #QIteratedTrapez#, this class provides a lower order formula,
- * while the error constant can be tuned by choosing the number of sub-cells.
- */
-template <int dim>
-class QIteratedSimpson :
- public Quadrature<dim>
-{
-public:
- QIteratedSimpson(const unsigned intervals);
-};
/*---------------------------- quadrature_lib.h ---------------------------*/
/* end of #ifndef __quadrature_lib_H */
};
};
-template <>
-QIteratedTrapez<1>::QIteratedTrapez (const unsigned n) :
- Quadrature<1> (n+1)
-{
- // Loop over INTERIOR points
- for (unsigned int i=1; i<n; ++i)
- {
- quadrature_points[i] = Point<1>(1.*i/n);
- weights[i] = 1./n;
- };
- quadrature_points[0] = Point<1>(0.);
- weights[0] = .5/n;
- quadrature_points[n] = Point<1>(1.);
- weights[n] = .5/n;
-}
-
-template<>
-QIteratedSimpson<1>::QIteratedSimpson(const unsigned n) :
- Quadrature<1> (2*n+1)
-{
- weights.clear();
-
- for (unsigned int i=0 ; i<n; ++i)
- {
- quadrature_points[2*i] = Point<1>(1.*i/n);
- quadrature_points[2*i+1] = Point<1>(1.*i/n+.5/n);
-
- weights[2*i] += 1./(6*n);
- weights[2*i+1] += 4./(6*n);
- weights[2*i+2] += 1./(6*n);
- }
- quadrature_points[2*n] = Point<1>(1.);
-}
// construct the quadrature formulae in higher dimensions by
// tensor product of lower dimensions
QTrapez<dim>::QTrapez () :
Quadrature<dim> (QTrapez<dim-1>(), QTrapez<1>()){};
-template <int dim>
-QIteratedTrapez<dim>::QIteratedTrapez (const unsigned n) :
- Quadrature<dim> (QIteratedTrapez<dim-1>(n), QIteratedTrapez<1>(n)) {};
-
-template <int dim>
-QIteratedSimpson<dim>::QIteratedSimpson (const unsigned n) :
- Quadrature<dim> (QIteratedTrapez<dim-1>(n), QIteratedTrapez<1>(n)) {};
// explicite specialization
+// note that 1d formulae are specialized by implementation above
template class QGauss2<2>;
template class QGauss3<2>;
template class QGauss4<2>;
template class QMidpoint<2>;
template class QSimpson<2>;
template class QTrapez<2>;
-template class QIteratedTrapez<2>;
-template class QIteratedSimpson<2>;
template class QGauss2<3>;
template class QGauss3<3>;
template class QMidpoint<3>;
template class QSimpson<3>;
template class QTrapez<3>;
-template class QIteratedTrapez<3>;
-template class QIteratedSimpson<3>;