From bb0aad048c4eb25264038cdbf2d9d829830e1cf6 Mon Sep 17 00:00:00 2001 From: bangerth Date: Fri, 2 Sep 2011 23:48:30 +0000 Subject: [PATCH] Remove some specializations for 1d since the generic code now also works for 1d. git-svn-id: https://svn.dealii.org/trunk@24243 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/include/deal.II/grid/grid_tools.h | 13 +------------ deal.II/source/grid/grid_tools.cc | 17 ----------------- deal.II/source/grid/grid_tools.inst.in | 5 +---- 3 files changed, 2 insertions(+), 33 deletions(-) diff --git a/deal.II/include/deal.II/grid/grid_tools.h b/deal.II/include/deal.II/grid/grid_tools.h index cacf76a633..c57c608c9c 100644 --- a/deal.II/include/deal.II/grid/grid_tools.h +++ b/deal.II/include/deal.II/grid/grid_tools.h @@ -62,18 +62,7 @@ class GridTools template static double diameter (const Triangulation &tria); - - /** - * Same function, but for 1d. - */ - static - double diameter (const Triangulation<1> &tria); - /** - * Same function, but for 1d, 2sd. - */ - static - double diameter (const Triangulation<1,2> &tria); - + /** * Given a list of vertices (typically * obtained using diff --git a/deal.II/source/grid/grid_tools.cc b/deal.II/source/grid/grid_tools.cc index 991167b619..08131de96a 100644 --- a/deal.II/source/grid/grid_tools.cc +++ b/deal.II/source/grid/grid_tools.cc @@ -126,23 +126,6 @@ GridTools::diameter (const Triangulation &tria) -double -GridTools::diameter (const Triangulation<1> &tria) -{ - // for 1d, simply check the - // vertices of the left- and - // rightmost coarse grid cell - Triangulation<1>::cell_iterator leftmost = tria.begin(0); - Triangulation<1>::cell_iterator rightmost = tria.begin(0); - - while (!leftmost->at_boundary(0)) leftmost = leftmost->neighbor(0); - while (!rightmost->at_boundary(1)) rightmost = rightmost->neighbor(1); - - return std::sqrt((leftmost->vertex(0) - rightmost->vertex(1)).square()); -} - - - template <> double GridTools::cell_measure<3>(const std::vector > &all_vertices, diff --git a/deal.II/source/grid/grid_tools.inst.in b/deal.II/source/grid/grid_tools.inst.in index 8fcdd37d8e..9d0533cd67 100644 --- a/deal.II/source/grid/grid_tools.inst.in +++ b/deal.II/source/grid/grid_tools.inst.in @@ -52,14 +52,11 @@ for (X : TRIANGULATION_AND_DOFHANDLERS; deal_II_dimension : DIMENSIONS) for (deal_II_dimension : DIMENSIONS) { - -#if deal_II_dimension != 1 template double GridTools::diameter (const Triangulation &); -#endif -#if deal_II_dimension == 2 +#if deal_II_dimension < 3 template double GridTools::diameter (const Triangulation &); -- 2.39.5