From 48eed3df8e6e228b47c2b7ba37b8a94561c71c07 Mon Sep 17 00:00:00 2001 From: Peter Munch Date: Thu, 19 Sep 2019 19:40:43 +0200 Subject: [PATCH] Move comparator of CellData and ConstructionData out of the tests --- .../distributed/fully_distributed_tria.h | 57 +++++++++++++++++++ tests/fullydistributed_grids/tests.h | 51 ----------------- 2 files changed, 57 insertions(+), 51 deletions(-) diff --git a/include/deal.II/distributed/fully_distributed_tria.h b/include/deal.II/distributed/fully_distributed_tria.h index b035b298bc..78d4f5c9b3 100644 --- a/include/deal.II/distributed/fully_distributed_tria.h +++ b/include/deal.II/distributed/fully_distributed_tria.h @@ -92,6 +92,12 @@ namespace parallel void serialize(Archive &ar, const unsigned int /*version*/); + /** + * Comparison operator. + */ + bool + operator==(const CellData &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 &other) const; + /** * Cells of the locally-relevant coarse-grid triangulation. */ @@ -434,6 +446,51 @@ namespace parallel } + + template + bool + CellData::operator==(const CellData &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 + bool + ConstructionData:: + operator==(const ConstructionData &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 diff --git a/tests/fullydistributed_grids/tests.h b/tests/fullydistributed_grids/tests.h index 4ba696fc90..67cdbd71bb 100644 --- a/tests/fullydistributed_grids/tests.h +++ b/tests/fullydistributed_grids/tests.h @@ -72,55 +72,4 @@ print_statistics(const DoFHandler &dof_handler, deallog << std::endl; } -namespace dealii -{ - namespace parallel - { - namespace fullydistributed - { - template - bool - operator==(const CellData &t1, const CellData &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 - bool - operator==(const ConstructionData &t1, - const ConstructionData &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 -- 2.39.5