#include <base/quadrature.h>
+/*!@addtogroup Quadrature */
+/*@{*/
+
/**
* Gauss-Legendre quadrature of arbitrary order.
*
* The coefficients of these quadrature rules are computed by the
- * function found in <tt>Numerical Recipies</tt>. For lower order
- * quadrature rules, the use of this class is thus equivalent to the
- * use of the QGauss1 through QGauss7 classes, for which
- * the coefficients are hardcoded, but this class can provide higher
- * order formulae as well.
+ * function found in <tt>Numerical Recipies</tt>.
*
* @author Guido Kanschat, 2001
*/
{
public:
/**
- * Generate a formula with <tt>p</tt>
- * quadrature points, exact for
- * polynomials of degree <tt>2p-1</tt>.
+ * Generate a formula with
+ * <tt>n</tt> quadrature points (in
+ * each space direction), exact for
+ * polynomials of degree
+ * <tt>2n-1</tt>.
*/
- QGauss (const unsigned int p);
+ QGauss (const unsigned int n);
};
+/**
+ * Gauss quadrature rule using the Gauss-Lobatto points.
+ *
+ * @note The quadrature weights are not implemented yet.
+ *
+ * @author Guido Kanschat, 2005
+ */
+template<int dim>
+class QGaussLobatto : public Quadrature<dim>
+{
+ public:
+ /**
+ * Generate a formula with
+ * <tt>n</tt> quadrature points
+ * (in each space direction).
+ */
+ QGaussLobatto(const unsigned int n);
+};
+
/**
* @deprecated Use QGauss for arbitrary order Gauss formulae instead!
QWeddle ();
};
-
+/*@}*/
/* -------------- declaration of explicit specializations ------------- */
template <> QGauss<1>::QGauss (const unsigned int n);
+template <> QGaussLobatto<1>::QGaussLobatto (const unsigned int n);
template <> QGauss2<1>::QGauss2 ();
template <> QGauss3<1>::QGauss3 ();
template <> QGauss4<1>::QGauss4 ();
}
+template <>
+QGaussLobatto<1>::QGaussLobatto (unsigned int n)
+ :
+ Quadrature<1> (n)
+{
+ for (unsigned int k=0;k<n;++k)
+ {
+ this->quadrature_points[k] = Point<1>(std::sin(2.*M_PI*k/(n-1)));
+ }
+}
+
template <>
QGauss2<1>::QGauss2 ()
// explicit specialization
// note that 1d formulae are specialized by implementation above
template class QGauss<2>;
+template class QGaussLobatto<2>;
template class QGauss2<2>;
template class QGauss3<2>;
template class QGauss4<2>;
template class QWeddle<2>;
template class QGauss<3>;
+template class QGaussLobatto<3>;
template class QGauss2<3>;
template class QGauss3<3>;
template class QGauss4<3>;