]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix const-ness 9429/head
authorAlexander Grayver <agrayver@erdw.ethz.ch>
Fri, 7 Feb 2020 10:45:25 +0000 (11:45 +0100)
committerAlexander Grayver <agrayver@erdw.ethz.ch>
Fri, 7 Feb 2020 10:45:25 +0000 (11:45 +0100)
contrib/python-bindings/include/mapping_wrapper.h
contrib/python-bindings/include/triangulation_wrapper.h
contrib/python-bindings/source/mapping_wrapper.cc
contrib/python-bindings/source/triangulation_wrapper.cc

index c9a84e214c2a996fe5f938527e50c58cf8ab6dec..e892cd0c942d5abad8fd47d93bbbb8a7fc3cede2 100644 (file)
@@ -83,7 +83,7 @@ namespace python
      * Get the underlying mapping.
      */
     void *
-    get_mapping();
+    get_mapping() const;
 
   private:
     /**
index 1c2517c7a5e861ed8c9fc59124fe9510e966ff66..ab9da0868eb19eb0c72c971ab338ce6c8583445a 100644 (file)
@@ -421,8 +421,8 @@ namespace python
      * with one entry per cell.
      */
     boost::python::list
-    compute_aspect_ratio_of_cells(MappingQGenericWrapper mapping,
-                                  QuadratureWrapper      quadrature);
+    compute_aspect_ratio_of_cells(const MappingQGenericWrapper &mapping,
+                                  const QuadratureWrapper &     quadrature);
 
     /**
      * Write mesh to the output file @filename according to the given data
@@ -467,7 +467,7 @@ namespace python
      * object.
      */
     void *
-    get_triangulation();
+    get_triangulation() const;
 
   private:
     /**
@@ -514,7 +514,7 @@ namespace python
 
 
   inline void *
-  TriangulationWrapper::get_triangulation()
+  TriangulationWrapper::get_triangulation() const
   {
     return triangulation;
   }
index 195f37748019dc423ae95c329568127e844c9cf4..b573d4c9707a78761999f9999774fa78224db43a 100644 (file)
@@ -295,7 +295,7 @@ namespace python
 
 
   void *
-  MappingQGenericWrapper::get_mapping()
+  MappingQGenericWrapper::get_mapping() const
   {
     return mapping_ptr;
   }
index b3faf5d51ecdbf3d7458a29eb004104d8f66655e..a33173029a46723c7893de1ed9d36f2fcf6fb3f6 100644 (file)
@@ -560,16 +560,17 @@ namespace python
 
     template <int dim, int spacedim>
     boost::python::list
-    compute_aspect_ratio_of_cells(MappingQGenericWrapper &mapping_wrapper,
-                                  QuadratureWrapper &     quadrature_wrapper,
-                                  TriangulationWrapper &  triangulation_wrapper)
+    compute_aspect_ratio_of_cells(
+      const MappingQGenericWrapper &mapping_wrapper,
+      const QuadratureWrapper &     quadrature_wrapper,
+      const TriangulationWrapper &  triangulation_wrapper)
     {
       const Triangulation<dim, spacedim> *tria =
         static_cast<const Triangulation<dim, spacedim> *>(
           triangulation_wrapper.get_triangulation());
 
-      Quadrature<dim> *quad =
-        static_cast<Quadrature<dim> *>(quadrature_wrapper.get_quadrature());
+      const Quadrature<dim> *quad = static_cast<const Quadrature<dim> *>(
+        quadrature_wrapper.get_quadrature());
 
       const MappingQGeneric<dim, spacedim> *mapping =
         static_cast<const MappingQGeneric<dim, spacedim> *>(
@@ -1443,8 +1444,8 @@ namespace python
 
   boost::python::list
   TriangulationWrapper::compute_aspect_ratio_of_cells(
-    MappingQGenericWrapper mapping,
-    QuadratureWrapper      quadrature)
+    const MappingQGenericWrapper &mapping,
+    const QuadratureWrapper &     quadrature)
   {
     if ((dim == 2) && (spacedim == 2))
       return internal::compute_aspect_ratio_of_cells<2, 2>(mapping,

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.