From: Alexander Grayver Date: Fri, 7 Feb 2020 10:45:25 +0000 (+0100) Subject: Fix const-ness X-Git-Tag: v9.2.0-rc1~555^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F9429%2Fhead;p=dealii.git Fix const-ness --- diff --git a/contrib/python-bindings/include/mapping_wrapper.h b/contrib/python-bindings/include/mapping_wrapper.h index c9a84e214c..e892cd0c94 100644 --- a/contrib/python-bindings/include/mapping_wrapper.h +++ b/contrib/python-bindings/include/mapping_wrapper.h @@ -83,7 +83,7 @@ namespace python * Get the underlying mapping. */ void * - get_mapping(); + get_mapping() const; private: /** diff --git a/contrib/python-bindings/include/triangulation_wrapper.h b/contrib/python-bindings/include/triangulation_wrapper.h index 1c2517c7a5..ab9da0868e 100644 --- a/contrib/python-bindings/include/triangulation_wrapper.h +++ b/contrib/python-bindings/include/triangulation_wrapper.h @@ -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; } diff --git a/contrib/python-bindings/source/mapping_wrapper.cc b/contrib/python-bindings/source/mapping_wrapper.cc index 195f377480..b573d4c970 100644 --- a/contrib/python-bindings/source/mapping_wrapper.cc +++ b/contrib/python-bindings/source/mapping_wrapper.cc @@ -295,7 +295,7 @@ namespace python void * - MappingQGenericWrapper::get_mapping() + MappingQGenericWrapper::get_mapping() const { return mapping_ptr; } diff --git a/contrib/python-bindings/source/triangulation_wrapper.cc b/contrib/python-bindings/source/triangulation_wrapper.cc index b3faf5d51e..a33173029a 100644 --- a/contrib/python-bindings/source/triangulation_wrapper.cc +++ b/contrib/python-bindings/source/triangulation_wrapper.cc @@ -560,16 +560,17 @@ namespace python template 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 *tria = static_cast *>( triangulation_wrapper.get_triangulation()); - Quadrature *quad = - static_cast *>(quadrature_wrapper.get_quadrature()); + const Quadrature *quad = static_cast *>( + quadrature_wrapper.get_quadrature()); const MappingQGeneric *mapping = static_cast *>( @@ -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,