From: Wolfgang Bangerth Date: Thu, 21 Jan 2021 19:50:10 +0000 (-0700) Subject: Let ReferenceCell::get_nodal_type_quadrature() return a 'const' reference. X-Git-Tag: v9.3.0-rc1~580^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F11601%2Fhead;p=dealii.git Let ReferenceCell::get_nodal_type_quadrature() return a 'const' reference. --- diff --git a/include/deal.II/grid/reference_cell.h b/include/deal.II/grid/reference_cell.h index 12a6b8cd40..63f216235e 100644 --- a/include/deal.II/grid/reference_cell.h +++ b/include/deal.II/grid/reference_cell.h @@ -732,7 +732,7 @@ namespace ReferenceCell * @note The weights are not filled. */ template - Quadrature & + const Quadrature & get_nodal_type_quadrature(const Type &reference_cell); namespace internal diff --git a/source/grid/reference_cell.cc b/source/grid/reference_cell.cc index 9e473a0592..4643d48c7c 100644 --- a/source/grid/reference_cell.cc +++ b/source/grid/reference_cell.cc @@ -223,7 +223,7 @@ namespace ReferenceCell } template - Quadrature & + const Quadrature & get_nodal_type_quadrature(const Type &reference_cell) { AssertDimension(dim, reference_cell.get_dimension()); @@ -237,22 +237,26 @@ namespace ReferenceCell if (reference_cell == get_hypercube(dim)) { - static Quadrature quadrature = create_quadrature(reference_cell); + static const Quadrature quadrature = + create_quadrature(reference_cell); return quadrature; } else if (reference_cell == Type::Tri || reference_cell == Type::Tet) { - static Quadrature quadrature = create_quadrature(reference_cell); + static const Quadrature quadrature = + create_quadrature(reference_cell); return quadrature; } else if (reference_cell == Type::Pyramid) { - static Quadrature quadrature = create_quadrature(reference_cell); + static const Quadrature quadrature = + create_quadrature(reference_cell); return quadrature; } else if (reference_cell == Type::Wedge) { - static Quadrature quadrature = create_quadrature(reference_cell); + static const Quadrature quadrature = + create_quadrature(reference_cell); return quadrature; } else diff --git a/source/grid/reference_cell.inst.in b/source/grid/reference_cell.inst.in index 29eec7c46d..e5b8045cdf 100644 --- a/source/grid/reference_cell.inst.in +++ b/source/grid/reference_cell.inst.in @@ -38,6 +38,6 @@ for (deal_II_dimension : DIMENSIONS) { template Quadrature get_gauss_type_quadrature( const Type &reference_cell, const unsigned n_points_1D); - template Quadrature &get_nodal_type_quadrature( + template const Quadrature &get_nodal_type_quadrature( const Type &reference_cell); }