]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Let ReferenceCell::get_nodal_type_quadrature() return a 'const' reference. 11601/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Thu, 21 Jan 2021 19:50:10 +0000 (12:50 -0700)
committerWolfgang Bangerth <bangerth@colostate.edu>
Fri, 22 Jan 2021 00:04:58 +0000 (17:04 -0700)
include/deal.II/grid/reference_cell.h
source/grid/reference_cell.cc
source/grid/reference_cell.inst.in

index 12a6b8cd407840d1e241ebc7665eb4bf416515d2..63f216235e5dde91c8c4bf8097da077d5894c266 100644 (file)
@@ -732,7 +732,7 @@ namespace ReferenceCell
    * @note The weights are not filled.
    */
   template <int dim>
-  Quadrature<dim> &
+  const Quadrature<dim> &
   get_nodal_type_quadrature(const Type &reference_cell);
 
   namespace internal
index 9e473a05923de5f9ebc4483ecb659ba5e8aa4ce4..4643d48c7c489e6498a87de57ee2fadb4f523089 100644 (file)
@@ -223,7 +223,7 @@ namespace ReferenceCell
   }
 
   template <int dim>
-  Quadrature<dim> &
+  const Quadrature<dim> &
   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<dim> quadrature = create_quadrature(reference_cell);
+        static const Quadrature<dim> quadrature =
+          create_quadrature(reference_cell);
         return quadrature;
       }
     else if (reference_cell == Type::Tri || reference_cell == Type::Tet)
       {
-        static Quadrature<dim> quadrature = create_quadrature(reference_cell);
+        static const Quadrature<dim> quadrature =
+          create_quadrature(reference_cell);
         return quadrature;
       }
     else if (reference_cell == Type::Pyramid)
       {
-        static Quadrature<dim> quadrature = create_quadrature(reference_cell);
+        static const Quadrature<dim> quadrature =
+          create_quadrature(reference_cell);
         return quadrature;
       }
     else if (reference_cell == Type::Wedge)
       {
-        static Quadrature<dim> quadrature = create_quadrature(reference_cell);
+        static const Quadrature<dim> quadrature =
+          create_quadrature(reference_cell);
         return quadrature;
       }
     else
index 29eec7c46d7f7928d9bcdcf2cc5d2af6d914f839..e5b8045cdf02cc720b6d558e8408f7eb35ab4441 100644 (file)
@@ -38,6 +38,6 @@ for (deal_II_dimension : DIMENSIONS)
   {
     template Quadrature<deal_II_dimension> get_gauss_type_quadrature(
       const Type &reference_cell, const unsigned n_points_1D);
-    template Quadrature<deal_II_dimension> &get_nodal_type_quadrature(
+    template const Quadrature<deal_II_dimension> &get_nodal_type_quadrature(
       const Type &reference_cell);
   }

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.