From 6190290a372a609afb1f5614a79058969692969c Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Thu, 21 Jan 2021 12:50:10 -0700 Subject: [PATCH] Let ReferenceCell::get_nodal_type_quadrature() return a 'const' reference. --- include/deal.II/grid/reference_cell.h | 2 +- source/grid/reference_cell.cc | 14 +++++++++----- source/grid/reference_cell.inst.in | 2 +- 3 files changed, 11 insertions(+), 7 deletions(-) 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); } -- 2.39.5