From: Daniel Arndt Date: Mon, 31 Jul 2017 20:40:33 +0000 (+0200) Subject: Documentation update X-Git-Tag: v9.0.0-rc1~1367^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F4668%2Fhead;p=dealii.git Documentation update --- diff --git a/doc/news/changes/minor/20170726DanielArndt-1 b/doc/news/changes/minor/20170726DanielArndt-1 index 843b8ec9a5..387af957a0 100644 --- a/doc/news/changes/minor/20170726DanielArndt-1 +++ b/doc/news/changes/minor/20170726DanielArndt-1 @@ -1,6 +1,6 @@ -New: The Quadrature class has a new boolean is_tensor_product_flag -to indicate if the represented quadrature formula is in fact a -tensor product of 1D formulas. The corresponding 1D objects -can be queried using Quadrature::get_tensor_basis(). +New: Quadrature::is_tensor_product() returns if the corresponding quadrature +formula can be represented as a tensor product and the quadrature points are +sorted lexicographically. The corresponding 1D objects can be queried using +Quadrature::get_tensor_basis().
(Daniel Arndt, 2017/07/26) diff --git a/include/deal.II/base/quadrature.h b/include/deal.II/base/quadrature.h index 50d578fbb0..20d0b0b65a 100644 --- a/include/deal.II/base/quadrature.h +++ b/include/deal.II/base/quadrature.h @@ -225,7 +225,8 @@ public: /** * This function returns true if the quadrature object is a tensor product - * of one-dimensional formulas. + * of one-dimensional formulas and the quadrature points are sorted + * lexicographically. */ bool is_tensor_product() const; @@ -254,7 +255,8 @@ protected: * Indicates if this object represents quadrature formula that is a tensor * product of one-dimensional formulas. * This flag is set if dim==1 or the constructors taking a Quadrature<1> - * (and possibly a Quadrature object) is called. + * (and possibly a Quadrature object) is called. This implies + * that the quadrature points are sorted lexicographically. */ bool is_tensor_product_flag; diff --git a/source/base/quadrature.cc b/source/base/quadrature.cc index 98aa8bada2..898b8fd6de 100644 --- a/source/base/quadrature.cc +++ b/source/base/quadrature.cc @@ -349,7 +349,7 @@ Quadrature<1>::get_tensor_basis () const ExcMessage("This function only makes sense if " "this object represents a tensor product!")); - return std::array, 1> {*this}; + return std::array, 1> {{*this}}; } @@ -397,7 +397,7 @@ QAnisotropic<2>::QAnisotropic(const Quadrature<1> &qx, } Assert (k==this->size(), ExcInternalError()); this->is_tensor_product_flag = true; - const std::array, 2> q_array = {qx, qy}; + const std::array, 2> q_array {{qx, qy}}; this->tensor_basis = std_cxx14::make_unique, 2>>(q_array); } @@ -432,7 +432,7 @@ QAnisotropic<3>::QAnisotropic(const Quadrature<1> &qx, } Assert (k==this->size(), ExcInternalError()); this->is_tensor_product_flag = true; - const std::array, 3> q_array = {qx, qy, qz}; + const std::array, 3> q_array {{qx, qy, qz}}; this->tensor_basis = std_cxx14::make_unique, 3>>(q_array); } diff --git a/source/base/quadrature_lib.cc b/source/base/quadrature_lib.cc index afc11887f4..eb7f8de966 100644 --- a/source/base/quadrature_lib.cc +++ b/source/base/quadrature_lib.cc @@ -939,6 +939,13 @@ QSorted::QSorted(const Quadrature &quad) : std::placeholders::_1, std::placeholders::_2)); + // At this point, the variable is_tensor_product_flag is set + // to the respective value of the given Quadrature in the base + // class copy constructor. + // We only call a quadrature formula 'tensor product' + // if the quadrature points are also sorted lexicographically. + // In particular, any reordering destroys that property + // and we might need to modify the variable accordingly. for (unsigned int i=0; iweights[i] = quad.weight(permutation[i]);