]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Gauss-Lobatto points; weights are missing
authorguido <guido@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 23 May 2005 22:15:29 +0000 (22:15 +0000)
committerguido <guido@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 23 May 2005 22:15:29 +0000 (22:15 +0000)
git-svn-id: https://svn.dealii.org/trunk@10704 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/base/include/base/quadrature_lib.h
deal.II/base/source/quadrature_lib.cc

index 0ec7cb6ea495e94b347f81b048da03cc0f62df17..f869dc7bb35899cf74313f06c4520b262940fe55 100644 (file)
 #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
  */
@@ -35,15 +34,36 @@ class QGauss : public Quadrature<dim>
 {
   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!
@@ -212,11 +232,12 @@ class QWeddle : public Quadrature<dim>
     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 ();
index cdaff06ecdc6fdac35192048fcd7ceb936552797..5975496da33899fc8763615a48e8da1a007716b8 100644 (file)
@@ -100,6 +100,17 @@ QGauss<1>::QGauss (const unsigned int n)
 }
 
 
+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 ()
@@ -500,6 +511,7 @@ QWeddle<dim>::QWeddle ()
 // 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>;
@@ -513,6 +525,7 @@ template class QMilne<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>;

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.