]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Remove specialization of Tria::n_raw_lines() 10569/head
authorPeter Munch <peterrmuench@gmail.com>
Mon, 22 Jun 2020 09:52:25 +0000 (11:52 +0200)
committerPeter Munch <peterrmuench@gmail.com>
Mon, 22 Jun 2020 09:52:25 +0000 (11:52 +0200)
include/deal.II/grid/tria.h
source/grid/tria.cc

index 453c104c93967fd37e380544a0eb2c13d11b3fa4..ba6d59837ae35705860f33065b165327a888a421 100644 (file)
@@ -4157,9 +4157,6 @@ Triangulation<dim, spacedim>::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;
index cd56522dbde2bc7548db2b5ad1303bfae6ce8fbe..ce6d23b38f9e9de8ac7a93df0dff56d52cdb4ac1 100644 (file)
@@ -13041,66 +13041,17 @@ Triangulation<dim, spacedim>::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 <int dim, int spacedim>
 unsigned int
-Triangulation<dim, spacedim>::n_raw_lines(const unsigned int) const
+Triangulation<dim, spacedim>::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 <int dim, int spacedim>
 unsigned int
 Triangulation<dim, spacedim>::n_raw_lines() const
 {
+  if (dim == 1)
+    {
+      Assert(false, ExcNotImplemented());
+      return 0;
+    }
+
   return faces->lines.n_objects();
 }
 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.