]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Constructor for QProjector
authorGuido Kanschat <dr.guido.kanschat@gmail.com>
Mon, 8 Jan 2001 21:00:47 +0000 (21:00 +0000)
committerGuido Kanschat <dr.guido.kanschat@gmail.com>
Mon, 8 Jan 2001 21:00:47 +0000 (21:00 +0000)
git-svn-id: https://svn.dealii.org/trunk@3617 0785d39b-7218-0410-832d-ea1e28bc413d

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

index b786abf8c1c876dd6b9f594932090d58a15586be..98dbb106a4f101cfbcb7a3cf9736ae27e19d15be 100644 (file)
@@ -244,9 +244,28 @@ class QIterated : public Quadrature<dim>
  *  for a description of the orientation of the different faces.
  */
 template <int dim>
-class QProjector
+class QProjector : public Quadrature<dim>
 {
   public:
+                                  /**
+                                   * Constructor for a quadrature rule on all (sub)faces.
+                                   * The quadrature rule
+                                   * @p{quadrature} is applied to
+                                   * each face or subface , according
+                                   * to the @{sub} flag.
+                                   *
+                                   * The weights of the new rule are
+                                   * replications of the original
+                                   * weights. This is not a proper
+                                   * handling, but it is
+                                   * consistent with later use. If
+                                   * the (sub)face rule is applied to
+                                   * the unity function, the result
+                                   * is the number of (sub)faces.
+                                   */
+  QProjector (const Quadrature<dim-1>& quadrature,
+             const bool sub);
+
                                     /**
                                      * Compute the quadrature points on the
                                      * cell if the given quadrature formula
index 4009ab68ba9558f6045fbf499cf1bd45df3e3e66..d520b9e99c54a669beed8964ad9f4bec67669f51 100644 (file)
@@ -189,6 +189,35 @@ Quadrature<dim>::memory_consumption () const
 };
 
 
+//----------------------------------------------------------------------//
+
+template <int dim>
+QProjector<dim>::QProjector (const Quadrature<dim-1> &quadrature,
+                            const bool sub)
+  :
+  Quadrature<dim> (quadrature.n_quadrature_points
+                  * GeometryInfo<dim>::faces_per_cell
+                  * (sub ? GeometryInfo<dim>::subfaces_per_face : 1))
+{
+  if (sub)
+    project_to_subfaces (quadrature, quadrature_points);
+  else
+    project_to_faces (quadrature, quadrature_points);
+
+  const unsigned int n = GeometryInfo<dim>::faces_per_cell
+    * (sub ? GeometryInfo<dim>::subfaces_per_face : 1);
+
+//TODO: Can we keep it that simple for non-symmetric formulae?
+// Otherwise we'll have to include the weights in the project* functions.
+// This may pose a problem anyway, since we do not want to switch endpoints
+// in Gauß-Radau formulae.
+
+  unsigned int k=0;
+  for (unsigned int i=0;i<n;++i)
+    for (unsigned int j=0;j<quadrature.n_quadrature_points;++j)
+      weights[k++] = quadrature.weight(j);
+}
+
 
 template <>
 void QProjector<2>::project_to_face (const Quadrature<1> &quadrature,

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.