From 69909dc151392ca277e153f3c26475c8c5c16373 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Mon, 7 May 2001 08:31:38 +0000 Subject: [PATCH] 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 --- deal.II/base/include/base/quadrature.h | 41 +++++++++++++++++++++----- deal.II/base/source/quadrature.cc | 25 ++++++++++++---- 2 files changed, 54 insertions(+), 12 deletions(-) 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), -- 2.39.5