]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Rename MappingQGeneric to MappingQ in python 12578/head
authorAlexander Grayver <agrayver@erdw.ethz.ch>
Sat, 17 Jul 2021 21:07:14 +0000 (23:07 +0200)
committerAlexander Grayver <agrayver@erdw.ethz.ch>
Mon, 26 Jul 2021 15:03:37 +0000 (17:03 +0200)
contrib/python-bindings/include/cell_accessor_wrapper.h
contrib/python-bindings/include/mapping_wrapper.h
contrib/python-bindings/include/point_wrapper.h
contrib/python-bindings/include/triangulation_wrapper.h
contrib/python-bindings/source/export_mapping.cc
contrib/python-bindings/source/mapping_wrapper.cc
contrib/python-bindings/source/triangulation_wrapper.cc
contrib/python-bindings/tests/mapping_wrapper.py

index 9340349b5490bcb6c5f1f15d11d4255444145394..ff96ee73bc1e5d688cea31a38d12aad0c5b05cae 100644 (file)
@@ -242,7 +242,7 @@ namespace python
      */
     void *cell_accessor;
 
-    friend class MappingQGenericWrapper;
+    friend class MappingQWrapper;
   };
 
 
index d25fd316d1606ef168036bdab98db6ea3c709f46..ab6e27a5057a3a15a0547f09f11dc9e86210ad9e 100644 (file)
@@ -18,7 +18,7 @@
 
 #include <deal.II/base/config.h>
 
-#include <deal.II/fe/mapping_q_generic.h>
+#include <deal.II/fe/mapping_q.h>
 
 #include <boost/python.hpp>
 
@@ -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
      */
index 8780bd0bc2e9cd2407bdba31c39d46496bb0a300..c42c7d94d7c6f7c29a43acc9fb67ca0965e69013 100644 (file)
@@ -233,7 +233,7 @@ namespace python
      */
     void *point;
 
-    friend class MappingQGenericWrapper;
+    friend class MappingQWrapper;
   };
 
 
index 73d308545ddd465d545b4ce2d176096c7811d053..5a2c2aecb4700b9f9acf3c6c7b9809e6dd345f27 100644 (file)
@@ -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
index b5a970200e58a9e7dd8b6a4ac44033dceed8ddd5..9264af323dcbecd6e9101aa0d07b0372c32eb774 100644 (file)
@@ -43,20 +43,20 @@ namespace python
   void
   export_mapping()
   {
-    boost::python::class_<MappingQGenericWrapper>(
-      "MappingQGeneric",
+    boost::python::class_<MappingQWrapper>(
+      "MappingQ",
       boost::python::init<const int, const int, const int>(
         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"));
   }
index 2866bf90d5cada811d5456d661ba74c87d2280fe..b13053d8c83adff9001a2cb561c51d1a0fb2c73c 100644 (file)
@@ -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;
   }
index ddc5c69a84a6009002df82330d7cdce29499d48c..59ea1e171152e403d95b260fd948fd4e37d676f1 100644 (file)
@@ -640,9 +640,9 @@ namespace python
 
     template <int dim, int spacedim>
     std::pair<int, int>
-    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<dim, spacedim> *tria =
         static_cast<Triangulation<dim, spacedim> *>(triangulation);
@@ -671,9 +671,9 @@ namespace python
     template <int dim, int spacedim>
     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<dim, spacedim> *tria =
         static_cast<const Triangulation<dim, spacedim> *>(
@@ -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<int, int> 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,
index 78b181f82d9d5415c423f9cda0f8897a8d8f38f1..be6fbc172db54d69ceaf4595c3e4dee0d05acef3 100644 (file)
@@ -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():

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.