From: Alexander Grayver Date: Sat, 17 Jul 2021 21:07:14 +0000 (+0200) Subject: Rename MappingQGeneric to MappingQ in python X-Git-Tag: v9.4.0-rc1~1121^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F12578%2Fhead;p=dealii.git Rename MappingQGeneric to MappingQ in python --- diff --git a/contrib/python-bindings/include/cell_accessor_wrapper.h b/contrib/python-bindings/include/cell_accessor_wrapper.h index 9340349b54..ff96ee73bc 100644 --- a/contrib/python-bindings/include/cell_accessor_wrapper.h +++ b/contrib/python-bindings/include/cell_accessor_wrapper.h @@ -242,7 +242,7 @@ namespace python */ void *cell_accessor; - friend class MappingQGenericWrapper; + friend class MappingQWrapper; }; diff --git a/contrib/python-bindings/include/mapping_wrapper.h b/contrib/python-bindings/include/mapping_wrapper.h index d25fd316d1..ab6e27a505 100644 --- a/contrib/python-bindings/include/mapping_wrapper.h +++ b/contrib/python-bindings/include/mapping_wrapper.h @@ -18,7 +18,7 @@ #include -#include +#include #include @@ -29,28 +29,28 @@ DEAL_II_NAMESPACE_OPEN namespace python { - class MappingQGenericWrapper + class MappingQWrapper { public: /** * Copy constructor. */ - MappingQGenericWrapper(const MappingQGenericWrapper &other); + MappingQWrapper(const MappingQWrapper &other); /** * Default constructor. */ - MappingQGenericWrapper(); + MappingQWrapper(); /** * Constructor. */ - MappingQGenericWrapper(const int dim, const int spacedim, const int degree); + MappingQWrapper(const int dim, const int spacedim, const int degree); /** * Destructor. */ - ~MappingQGenericWrapper(); + ~MappingQWrapper(); /*! @copydoc Mapping::transform_unit_to_real_cell */ diff --git a/contrib/python-bindings/include/point_wrapper.h b/contrib/python-bindings/include/point_wrapper.h index 8780bd0bc2..c42c7d94d7 100644 --- a/contrib/python-bindings/include/point_wrapper.h +++ b/contrib/python-bindings/include/point_wrapper.h @@ -233,7 +233,7 @@ namespace python */ void *point; - friend class MappingQGenericWrapper; + friend class MappingQWrapper; }; diff --git a/contrib/python-bindings/include/triangulation_wrapper.h b/contrib/python-bindings/include/triangulation_wrapper.h index 73d308545d..5a2c2aecb4 100644 --- a/contrib/python-bindings/include/triangulation_wrapper.h +++ b/contrib/python-bindings/include/triangulation_wrapper.h @@ -282,9 +282,8 @@ namespace python /*! @copydoc GridTools::find_active_cell_around_point */ CellAccessorWrapper - find_active_cell_around_point( - PointWrapper & p, - MappingQGenericWrapper mapping = MappingQGenericWrapper()); + find_active_cell_around_point(PointWrapper & p, + MappingQWrapper mapping = MappingQWrapper()); /*! @copydoc GridTools::find_cells_adjacent_to_vertex */ @@ -338,8 +337,8 @@ namespace python /*! @copydoc GridTools::compute_aspect_ratio_of_cells */ boost::python::list - compute_aspect_ratio_of_cells(const MappingQGenericWrapper &mapping, - const QuadratureWrapper & quadrature); + compute_aspect_ratio_of_cells(const MappingQWrapper & mapping, + const QuadratureWrapper &quadrature); /** * Write mesh to the output file @filename according to the given data diff --git a/contrib/python-bindings/source/export_mapping.cc b/contrib/python-bindings/source/export_mapping.cc index b5a970200e..9264af323d 100644 --- a/contrib/python-bindings/source/export_mapping.cc +++ b/contrib/python-bindings/source/export_mapping.cc @@ -43,20 +43,20 @@ namespace python void export_mapping() { - boost::python::class_( - "MappingQGeneric", + boost::python::class_( + "MappingQ", boost::python::init( boost::python::args("dim", "spacedim", "degree"))) .def("transform_real_to_unit_cell", - &MappingQGenericWrapper::transform_real_to_unit_cell, + &MappingQWrapper::transform_real_to_unit_cell, transform_real_to_unit_cell_docstring, boost::python::args("self", "cell", "point")) .def("transform_unit_to_real_cell", - &MappingQGenericWrapper::transform_unit_to_real_cell, + &MappingQWrapper::transform_unit_to_real_cell, transform_unit_to_real_cell_docstring, boost::python::args("self", "cell", "point")) .def("project_real_point_to_unit_point_on_face", - &MappingQGenericWrapper::project_real_point_to_unit_point_on_face, + &MappingQWrapper::project_real_point_to_unit_point_on_face, project_real_point_to_unit_point_on_face_docstring, boost::python::args("self", "cell", "face_no", "point")); } diff --git a/contrib/python-bindings/source/mapping_wrapper.cc b/contrib/python-bindings/source/mapping_wrapper.cc index 2866bf90d5..b13053d8c8 100644 --- a/contrib/python-bindings/source/mapping_wrapper.cc +++ b/contrib/python-bindings/source/mapping_wrapper.cc @@ -124,7 +124,7 @@ namespace python - MappingQGenericWrapper::MappingQGenericWrapper() + MappingQWrapper::MappingQWrapper() : dim(-1) , spacedim(-1) , degree(-1) @@ -133,9 +133,9 @@ namespace python - MappingQGenericWrapper::MappingQGenericWrapper(const int dim, - const int spacedim, - const int degree) + MappingQWrapper::MappingQWrapper(const int dim, + const int spacedim, + const int degree) : dim(dim) , spacedim(spacedim) , degree(degree) @@ -158,8 +158,7 @@ namespace python - MappingQGenericWrapper::MappingQGenericWrapper( - const MappingQGenericWrapper &other) + MappingQWrapper::MappingQWrapper(const MappingQWrapper &other) { dim = other.dim; spacedim = other.spacedim; @@ -186,7 +185,7 @@ namespace python - MappingQGenericWrapper::~MappingQGenericWrapper() + MappingQWrapper::~MappingQWrapper() { if (dim != -1) { @@ -218,8 +217,8 @@ namespace python PointWrapper - MappingQGenericWrapper::transform_unit_to_real_cell(CellAccessorWrapper &cell, - PointWrapper & p) + MappingQWrapper::transform_unit_to_real_cell(CellAccessorWrapper &cell, + PointWrapper & p) { AssertThrow( dim == p.get_dim(), @@ -243,8 +242,8 @@ namespace python PointWrapper - MappingQGenericWrapper::transform_real_to_unit_cell(CellAccessorWrapper &cell, - PointWrapper & p) + MappingQWrapper::transform_real_to_unit_cell(CellAccessorWrapper &cell, + PointWrapper & p) { AssertThrow( spacedim == p.get_dim(), @@ -268,7 +267,7 @@ namespace python PointWrapper - MappingQGenericWrapper::project_real_point_to_unit_point_on_face( + MappingQWrapper::project_real_point_to_unit_point_on_face( CellAccessorWrapper &cell, const unsigned int face_no, PointWrapper & p) @@ -292,7 +291,7 @@ namespace python void * - MappingQGenericWrapper::get_mapping() const + MappingQWrapper::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 ddc5c69a84..59ea1e1711 100644 --- a/contrib/python-bindings/source/triangulation_wrapper.cc +++ b/contrib/python-bindings/source/triangulation_wrapper.cc @@ -640,9 +640,9 @@ namespace python template std::pair - find_active_cell_around_point(PointWrapper & p, - MappingQGenericWrapper &mapping_wrapper, - void * triangulation) + find_active_cell_around_point(PointWrapper & p, + MappingQWrapper &mapping_wrapper, + void * triangulation) { Triangulation *tria = static_cast *>(triangulation); @@ -671,9 +671,9 @@ namespace python template boost::python::list compute_aspect_ratio_of_cells( - const MappingQGenericWrapper &mapping_wrapper, - const QuadratureWrapper & quadrature_wrapper, - const TriangulationWrapper & triangulation_wrapper) + const MappingQWrapper & mapping_wrapper, + const QuadratureWrapper & quadrature_wrapper, + const TriangulationWrapper &triangulation_wrapper) { const Triangulation *tria = static_cast *>( @@ -1655,9 +1655,8 @@ namespace python CellAccessorWrapper - TriangulationWrapper::find_active_cell_around_point( - PointWrapper & p, - MappingQGenericWrapper mapping) + TriangulationWrapper::find_active_cell_around_point(PointWrapper & p, + MappingQWrapper mapping) { std::pair level_index_pair; if ((dim == 2) && (spacedim == 2)) @@ -1699,8 +1698,8 @@ namespace python boost::python::list TriangulationWrapper::compute_aspect_ratio_of_cells( - const MappingQGenericWrapper &mapping, - const QuadratureWrapper & quadrature) + const MappingQWrapper & mapping, + const QuadratureWrapper &quadrature) { if ((dim == 2) && (spacedim == 2)) return internal::compute_aspect_ratio_of_cells<2, 2>(mapping, diff --git a/contrib/python-bindings/tests/mapping_wrapper.py b/contrib/python-bindings/tests/mapping_wrapper.py index 78b181f82d..be6fbc172d 100644 --- a/contrib/python-bindings/tests/mapping_wrapper.py +++ b/contrib/python-bindings/tests/mapping_wrapper.py @@ -24,7 +24,7 @@ class TestMappingWrapperCube(unittest.TestCase): self.triangulation.refine_global(1) def test_mapping(self): - mapping = MappingQGeneric(dim = 2, spacedim = 2, degree = 1) + mapping = MappingQ(dim = 2, spacedim = 2, degree = 1) p_unit = Point([0.5, 0.5]) for cell in self.triangulation.active_cells(): @@ -41,7 +41,7 @@ class TestMappingWrapperSphere(unittest.TestCase): self.triangulation.generate_hyper_sphere(p_center) def test_mapping(self): - mapping = MappingQGeneric(dim = 2, spacedim = 3, degree = 4) + mapping = MappingQ(dim = 2, spacedim = 3, degree = 4) p_unit = Point([0.5, 0.5]) for cell in self.triangulation.active_cells():