]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Move comparator of CellData and ConstructionData out of the tests 8806/head
authorPeter Munch <peterrmuench@gmail.com>
Thu, 19 Sep 2019 17:40:43 +0000 (19:40 +0200)
committerPeter Munch <peterrmuench@gmail.com>
Thu, 19 Sep 2019 17:40:43 +0000 (19:40 +0200)
include/deal.II/distributed/fully_distributed_tria.h
tests/fullydistributed_grids/tests.h

index b035b298bcbac83cab5264722775301da1946669..78d4f5c9b3e56aa7c732a486841fb7f5f9259577 100644 (file)
@@ -92,6 +92,12 @@ namespace parallel
       void
       serialize(Archive &ar, const unsigned int /*version*/);
 
+      /**
+       * Comparison operator.
+       */
+      bool
+      operator==(const CellData<dim> &other) const;
+
       /**
        * Unique CellID of the cell.
        */
@@ -154,6 +160,12 @@ namespace parallel
       void
       serialize(Archive &ar, const unsigned int /*version*/);
 
+      /**
+       * Comparison operator.
+       */
+      bool
+      operator==(const ConstructionData<dim, spacedim> &other) const;
+
       /**
        * Cells of the locally-relevant coarse-grid triangulation.
        */
@@ -434,6 +446,51 @@ namespace parallel
     }
 
 
+
+    template <int dim>
+    bool
+    CellData<dim>::operator==(const CellData<dim> &other) const
+    {
+      if (this->id != other.id)
+        return false;
+      if (this->subdomain_id != other.subdomain_id)
+        return false;
+      if (this->level_subdomain_id != other.level_subdomain_id)
+        return false;
+      if (this->manifold_id != other.manifold_id)
+        return false;
+      if (dim >= 2 && this->manifold_line_ids != other.manifold_line_ids)
+        return false;
+      if (dim >= 3 && this->manifold_quad_ids != other.manifold_quad_ids)
+        return false;
+      if (this->boundary_ids != other.boundary_ids)
+        return false;
+
+      return true;
+    }
+
+
+
+    template <int dim, int spacedim>
+    bool
+    ConstructionData<dim, spacedim>::
+    operator==(const ConstructionData<dim, spacedim> &other) const
+    {
+      if (this->coarse_cells != other.coarse_cells)
+        return false;
+      if (this->coarse_cell_vertices != other.coarse_cell_vertices)
+        return false;
+      if (this->coarse_cell_index_to_coarse_cell_id !=
+          other.coarse_cell_index_to_coarse_cell_id)
+        return false;
+      if (this->cell_infos != other.cell_infos)
+        return false;
+      if (this->settings != other.settings)
+        return false;
+
+      return true;
+    }
+
 #endif
 
   } // namespace fullydistributed
index 4ba696fc90282845c6de5599e156d90fea45fa5b..67cdbd71bb696520d2e901a8848aa314ad792448 100644 (file)
@@ -72,55 +72,4 @@ print_statistics(const DoFHandler<dim, spacedim> &dof_handler,
   deallog << std::endl;
 }
 
-namespace dealii
-{
-  namespace parallel
-  {
-    namespace fullydistributed
-    {
-      template <int dim>
-      bool
-      operator==(const CellData<dim> &t1, const CellData<dim> &t2)
-      {
-        if (t1.id != t2.id)
-          return false;
-        if (t1.subdomain_id != t2.subdomain_id)
-          return false;
-        if (t1.level_subdomain_id != t2.level_subdomain_id)
-          return false;
-        if (t1.manifold_id != t2.manifold_id)
-          return false;
-        if (dim >= 2 && t1.manifold_line_ids != t2.manifold_line_ids)
-          return false;
-        if (dim >= 3 && t1.manifold_quad_ids != t2.manifold_quad_ids)
-          return false;
-        if (t1.boundary_ids != t2.boundary_ids)
-          return false;
-
-        return true;
-      }
-
-      template <int dim, int spacedim>
-      bool
-      operator==(const ConstructionData<dim, spacedim> &t1,
-                 const ConstructionData<dim, spacedim> &t2)
-      {
-        if (t1.coarse_cells != t2.coarse_cells)
-          return false;
-        if (t1.coarse_cell_vertices != t2.coarse_cell_vertices)
-          return false;
-        if (t1.coarse_cell_index_to_coarse_cell_id !=
-            t2.coarse_cell_index_to_coarse_cell_id)
-          return false;
-        if (t1.cell_infos != t2.cell_infos)
-          return false;
-        if (t1.settings != t2.settings)
-          return false;
-
-        return true;
-      }
-    } // namespace fullydistributed
-  }   // namespace parallel
-} // namespace dealii
-
 #endif

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.