From: David Wells Date: Mon, 4 Sep 2023 18:05:32 +0000 (-0400) Subject: Simplify some GridTools functions. X-Git-Tag: relicensing~530^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F15958%2Fhead;p=dealii.git Simplify some GridTools functions. We added Triangulation::get_communicator() awhile back so we don't need the cast any more. --- diff --git a/source/grid/grid_tools.cc b/source/grid/grid_tools.cc index 32448796bd..0fb44268a9 100644 --- a/source/grid/grid_tools.cc +++ b/source/grid/grid_tools.cc @@ -218,17 +218,8 @@ namespace GridTools local_volume += fe_values.JxW(q); } - double global_volume = 0; - -#ifdef DEAL_II_WITH_MPI - if (const parallel::TriangulationBase *p_tria = - dynamic_cast *>( - &triangulation)) - global_volume = - Utilities::MPI::sum(local_volume, p_tria->get_communicator()); - else -#endif - global_volume = local_volume; + const double global_volume = + Utilities::MPI::sum(local_volume, triangulation.get_communicator()); return global_volume; } @@ -4461,18 +4452,8 @@ namespace GridTools if (!cell->is_artificial()) min_diameter = std::min(min_diameter, cell->diameter(mapping)); - double global_min_diameter = 0; - -#ifdef DEAL_II_WITH_MPI - if (const parallel::TriangulationBase *p_tria = - dynamic_cast *>( - &triangulation)) - global_min_diameter = - Utilities::MPI::min(min_diameter, p_tria->get_communicator()); - else -#endif - global_min_diameter = min_diameter; - + const double global_min_diameter = + Utilities::MPI::min(min_diameter, triangulation.get_communicator()); return global_min_diameter; } @@ -4488,18 +4469,8 @@ namespace GridTools if (!cell->is_artificial()) max_diameter = std::max(max_diameter, cell->diameter(mapping)); - double global_max_diameter = 0; - -#ifdef DEAL_II_WITH_MPI - if (const parallel::TriangulationBase *p_tria = - dynamic_cast *>( - &triangulation)) - global_max_diameter = - Utilities::MPI::max(max_diameter, p_tria->get_communicator()); - else -#endif - global_max_diameter = max_diameter; - + const double global_max_diameter = + Utilities::MPI::max(max_diameter, triangulation.get_communicator()); return global_max_diameter; }