From 1422c5792f79e97001931d3be8abd45c09407cb7 Mon Sep 17 00:00:00 2001 From: Timo Heister Date: Fri, 17 Apr 2020 10:06:17 -0400 Subject: [PATCH] move is_multilevel_hierarchy_constructed() up Move is_multilevel_hierarchy_constructed() from DistributedTriangulationBase to parallel::TriangulationBase --- include/deal.II/distributed/shared_tria.h | 12 ++++++++++++ include/deal.II/distributed/tria_base.h | 12 ++++++------ source/distributed/shared_tria.cc | 16 +++++++++++++++- 3 files changed, 33 insertions(+), 7 deletions(-) diff --git a/include/deal.II/distributed/shared_tria.h b/include/deal.II/distributed/shared_tria.h index 41295be797..b9b24d09da 100644 --- a/include/deal.II/distributed/shared_tria.h +++ b/include/deal.II/distributed/shared_tria.h @@ -248,6 +248,12 @@ namespace parallel */ virtual ~Triangulation() override = default; + /** + * Return if multilevel hierarchy is supported and has been constructed. + */ + virtual bool + is_multilevel_hierarchy_constructed() const override; + /** * Coarsen and refine the mesh according to refinement and coarsening * flags set. @@ -423,6 +429,12 @@ namespace parallel */ Triangulation() = delete; + /** + * Return if multilevel hierarchy is supported and has been constructed. + */ + virtual bool + is_multilevel_hierarchy_constructed() const override; + /** * A dummy function to return empty vector. */ diff --git a/include/deal.II/distributed/tria_base.h b/include/deal.II/distributed/tria_base.h index 0203f6cc77..6b6efd4b38 100644 --- a/include/deal.II/distributed/tria_base.h +++ b/include/deal.II/distributed/tria_base.h @@ -96,6 +96,12 @@ namespace parallel virtual const MPI_Comm & get_communicator() const; + /** + * Return if multilevel hierarchy is supported and has been constructed. + */ + virtual bool + is_multilevel_hierarchy_constructed() const = 0; + /** * Implementation of the same function as in the base class. * @@ -361,12 +367,6 @@ namespace parallel const typename dealii::Triangulation::MeshSmoothing smooth_grid = (dealii::Triangulation::none), const bool check_for_distorted_cells = false); - - /** - * Return if multilevel hierarchy is supported and has been constructed. - */ - virtual bool - is_multilevel_hierarchy_constructed() const = 0; }; } // namespace parallel diff --git a/source/distributed/shared_tria.cc b/source/distributed/shared_tria.cc index 31cdf26447..a21102ad37 100644 --- a/source/distributed/shared_tria.cc +++ b/source/distributed/shared_tria.cc @@ -69,6 +69,15 @@ namespace parallel + template + bool + Triangulation::is_multilevel_hierarchy_constructed() const + { + return (settings & construct_multigrid_hierarchy); + } + + + template void Triangulation::partition() @@ -439,7 +448,12 @@ namespace parallel return true; } - + template + bool + Triangulation::is_multilevel_hierarchy_constructed() const + { + return false; + } template const std::vector & -- 2.39.5