From: Wolfgang Bangerth Date: Mon, 7 May 2001 08:31:38 +0000 (+0000) Subject: Add a constructor to generate dummy quadrature rules with points only X-Git-Tag: v8.0.0~19244 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=69909dc151392ca277e153f3c26475c8c5c16373;p=dealii.git Add a constructor to generate dummy quadrature rules with points only and invalid weights. git-svn-id: https://svn.dealii.org/trunk@4546 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/base/include/base/quadrature.h b/deal.II/base/include/base/quadrature.h index 0191de9b02..95eae23bff 100644 --- a/deal.II/base/include/base/quadrature.h +++ b/deal.II/base/include/base/quadrature.h @@ -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 &, 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 > &points, - const std::vector &weights); + const std::vector &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 > &points); + + /** + * Constructor for a one-point + * quadrature. Sets the weight of + * this point to one. */ Quadrature (const Point &point); diff --git a/deal.II/base/source/quadrature.cc b/deal.II/base/source/quadrature.cc index 2ef9f386af..51c06276a0 100644 --- a/deal.II/base/source/quadrature.cc +++ b/deal.II/base/source/quadrature.cc @@ -41,17 +41,32 @@ using namespace std; template -Quadrature::Quadrature (const typename std::vector > &points, - const std::vector &weights) - : n_quadrature_points(points.size()), - quadrature_points(points), - weights(weights) +Quadrature::Quadrature (const typename std::vector > &points, + const std::vector &weights) + : + n_quadrature_points(points.size()), + quadrature_points(points), + weights(weights) { Assert(weights.size() == points.size(), ExcDimensionMismatch(weights.size(), points.size())); } + +template +Quadrature::Quadrature (const typename std::vector > &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 Quadrature::Quadrature (const Point &point): n_quadrature_points(1),