From 073bb688c445ddf3cc8f79c4b826d45e94470b5e Mon Sep 17 00:00:00 2001 From: Peter Munch Date: Mon, 22 Jun 2020 11:52:25 +0200 Subject: [PATCH] Remove specialization of Tria::n_raw_lines() --- include/deal.II/grid/tria.h | 9 ----- source/grid/tria.cc | 69 +++++++------------------------------ 2 files changed, 13 insertions(+), 65 deletions(-) diff --git a/include/deal.II/grid/tria.h b/include/deal.II/grid/tria.h index 453c104c93..ba6d59837a 100644 --- a/include/deal.II/grid/tria.h +++ b/include/deal.II/grid/tria.h @@ -4157,9 +4157,6 @@ Triangulation::coarse_cell_index_to_coarse_cell_id( /* -------------- declaration of explicit specializations ------------- */ -template <> -unsigned int -Triangulation<1, 1>::n_raw_lines(const unsigned int level) const; template <> unsigned int Triangulation<1, 1>::n_quads() const; @@ -4190,9 +4187,6 @@ Triangulation<1, 1>::max_adjacent_cells() const; // -- Explicit specializations for codimension one grids -template <> -unsigned int -Triangulation<1, 2>::n_raw_lines(const unsigned int level) const; template <> unsigned int Triangulation<1, 2>::n_quads() const; @@ -4222,9 +4216,6 @@ Triangulation<1, 2>::max_adjacent_cells() const; // -- Explicit specializations for codimension two grids -template <> -unsigned int -Triangulation<1, 3>::n_raw_lines(const unsigned int level) const; template <> unsigned int Triangulation<1, 3>::n_quads() const; diff --git a/source/grid/tria.cc b/source/grid/tria.cc index cd56522dbd..ce6d23b38f 100644 --- a/source/grid/tria.cc +++ b/source/grid/tria.cc @@ -13041,66 +13041,17 @@ Triangulation::n_lines() const } -// TODO: Merge the following 6 functions somehow -template <> -unsigned int -Triangulation<1, 1>::n_raw_lines(const unsigned int level) const -{ - AssertIndexRange(level, n_levels()); - return levels[level]->cells.n_objects(); -} - - -template <> -unsigned int -Triangulation<1, 1>::n_raw_lines() const -{ - Assert(false, ExcNotImplemented()); - return 0; -} - - - -template <> -unsigned int -Triangulation<1, 2>::n_raw_lines(const unsigned int level) const -{ - AssertIndexRange(level, n_levels()); - return levels[level]->cells.n_objects(); -} - - -template <> -unsigned int -Triangulation<1, 2>::n_raw_lines() const -{ - Assert(false, ExcNotImplemented()); - return 0; -} - - -template <> -unsigned int -Triangulation<1, 3>::n_raw_lines(const unsigned int level) const -{ - AssertIndexRange(level, n_levels()); - return levels[level]->cells.n_objects(); -} - -template <> -unsigned int -Triangulation<1, 3>::n_raw_lines() const -{ - Assert(false, ExcNotImplemented()); - return 0; -} - - template unsigned int -Triangulation::n_raw_lines(const unsigned int) const +Triangulation::n_raw_lines(const unsigned int level) const { + if (dim == 1) + { + AssertIndexRange(level, n_levels()); + return levels[level]->cells.n_objects(); + } + Assert(false, ExcFacesHaveNoLevel()); return 0; } @@ -13110,6 +13061,12 @@ template unsigned int Triangulation::n_raw_lines() const { + if (dim == 1) + { + Assert(false, ExcNotImplemented()); + return 0; + } + return faces->lines.n_objects(); } -- 2.39.5