From: Guido Kanschat Date: Mon, 8 Jan 2001 21:00:47 +0000 (+0000) Subject: Constructor for QProjector X-Git-Tag: v8.0.0~19844 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6b12b563649795d010d3ece057240ada619ff2d3;p=dealii.git Constructor for QProjector git-svn-id: https://svn.dealii.org/trunk@3617 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/base/include/base/quadrature.h b/deal.II/base/include/base/quadrature.h index b786abf8c1..98dbb106a4 100644 --- a/deal.II/base/include/base/quadrature.h +++ b/deal.II/base/include/base/quadrature.h @@ -244,9 +244,28 @@ class QIterated : public Quadrature * for a description of the orientation of the different faces. */ template -class QProjector +class QProjector : public Quadrature { 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& quadrature, + const bool sub); + /** * Compute the quadrature points on the * cell if the given quadrature formula diff --git a/deal.II/base/source/quadrature.cc b/deal.II/base/source/quadrature.cc index 4009ab68ba..d520b9e99c 100644 --- a/deal.II/base/source/quadrature.cc +++ b/deal.II/base/source/quadrature.cc @@ -189,6 +189,35 @@ Quadrature::memory_consumption () const }; +//----------------------------------------------------------------------// + +template +QProjector::QProjector (const Quadrature &quadrature, + const bool sub) + : + Quadrature (quadrature.n_quadrature_points + * GeometryInfo::faces_per_cell + * (sub ? GeometryInfo::subfaces_per_face : 1)) +{ + if (sub) + project_to_subfaces (quadrature, quadrature_points); + else + project_to_faces (quadrature, quadrature_points); + + const unsigned int n = GeometryInfo::faces_per_cell + * (sub ? GeometryInfo::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 void QProjector<2>::project_to_face (const Quadrature<1> &quadrature,