* 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
};
+//----------------------------------------------------------------------//
+
+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,