]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Add a constructor to generate dummy quadrature rules with points only
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Mon, 7 May 2001 08:31:38 +0000 (08:31 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Mon, 7 May 2001 08:31:38 +0000 (08:31 +0000)
and invalid weights.

git-svn-id: https://svn.dealii.org/trunk@4546 0785d39b-7218-0410-832d-ea1e28bc413d

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

index 0191de9b0246434594b6db3bbfed34e11ba8cabc..95eae23bffa7cbea216ffb1b99fc602eb6a07652 100644 (file)
@@ -83,22 +83,49 @@ class Quadrature : public Subscriptor
     Quadrature (const unsigned int n_quadrature_points);
 
                                     /**
-                                     * Build this quadrature formula as the
-                                     * tensor product of a formula in a
-                                     * dimension one less than the present and
-                                     * a formula in one dimension.
+                                     * Build this quadrature formula
+                                     * as the tensor product of a
+                                     * formula in a dimension one
+                                     * less than the present and a
+                                     * formula in one dimension.
                                      */
     Quadrature (const Quadrature<dim-1> &,
                const Quadrature<1>     &);
     
                                     /**
-                                     * Constructor from given vectors.
+                                     * Construct a quadrature formula
+                                     * from given vectors of
+                                     * quadrature points (which
+                                     * should really be in the unit
+                                     * cell) and the corresponding
+                                     * weights. You will want to have
+                                     * the weights sum up to one, but
+                                     * this is not checked.
                                      */
     Quadrature (const typename std::vector<Point<dim> > &points,
-               const std::vector<double>      &weights);
+               const std::vector<double>               &weights);
 
                                     /**
-                                     * Constructor for a one-point quadrature.
+                                     * Construct a dummy quadrature
+                                     * formula from a list of points,
+                                     * with weights set to
+                                     * infinity. The resulting object
+                                     * is therefore not meant to
+                                     * actually perform integrations,
+                                     * but rather to be used with
+                                     * @ref{FEValues} objects in
+                                     * order to find the position of
+                                     * some points (the quadrature
+                                     * points in this object) on the
+                                     * transformed cell in real
+                                     * space.
+                                     */
+    Quadrature (const typename std::vector<Point<dim> > &points);
+
+                                    /**
+                                     * Constructor for a one-point
+                                     * quadrature. Sets the weight of
+                                     * this point to one.
                                      */
     Quadrature (const Point<dim> &point);
     
index 2ef9f386afca389a457a791f19794d25756cbf88..51c06276a028fc1d08afc9c856a4d13ce3a8a166 100644 (file)
@@ -41,17 +41,32 @@ using namespace std;
 
 
 template <int dim>
-Quadrature<dim>::Quadrature (const typename std::vector<Point<dim> >  &points,
-                            const std::vector<double>       &weights)
-               : n_quadrature_points(points.size()),
-                 quadrature_points(points),
-                 weights(weights)
+Quadrature<dim>::Quadrature (const typename std::vector<Point<dim> > &points,
+                            const std::vector<double>               &weights)
+               :
+               n_quadrature_points(points.size()),
+               quadrature_points(points),
+               weights(weights)
 {
   Assert(weights.size() == points.size(),
         ExcDimensionMismatch(weights.size(), points.size()));
 }
 
 
+
+template <int dim>
+Quadrature<dim>::Quadrature (const typename std::vector<Point<dim> > &points)
+               :
+               n_quadrature_points(points.size()),
+               quadrature_points(points),
+               weights(points.size(), atof("Inf"))
+{
+  Assert(weights.size() == points.size(),
+        ExcDimensionMismatch(weights.size(), points.size()));
+}
+
+
+
 template <int dim>
 Quadrature<dim>::Quadrature (const Point<dim> &point):
                n_quadrature_points(1),

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.