From 1e78538da52421617be41c5e75bef60be071172b Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Wed, 9 Apr 2014 18:54:30 +0000 Subject: [PATCH] Simplify code by keeping some functions as templates, rather than specializing them. git-svn-id: https://svn.dealii.org/trunk@32751 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/source/distributed/tria.cc | 152 +++-------------------------- 1 file changed, 16 insertions(+), 136 deletions(-) diff --git a/deal.II/source/distributed/tria.cc b/deal.II/source/distributed/tria.cc index d1616196d4..6a22f877f5 100644 --- a/deal.II/source/distributed/tria.cc +++ b/deal.II/source/distributed/tria.cc @@ -3858,186 +3858,66 @@ namespace parallel - // TODO: again problems with specialization in only one template argument - template <> - Triangulation<1,1>::Triangulation (MPI_Comm) + template + Triangulation<1,spacedim>::Triangulation (MPI_Comm) { Assert (false, ExcNotImplemented()); } - template <> - Triangulation<1,1>::~Triangulation () + template + Triangulation<1,spacedim>::~Triangulation () { Assert (false, ExcNotImplemented()); } - template <> + template types::subdomain_id - Triangulation<1,1>::locally_owned_subdomain () const + Triangulation<1,spacedim>::locally_owned_subdomain () const { Assert (false, ExcNotImplemented()); return 0; } - template <> + template types::global_dof_index - Triangulation<1,1>::n_global_active_cells () const + Triangulation<1,spacedim>::n_global_active_cells () const { Assert (false, ExcNotImplemented()); return 0; } - template <> + template unsigned int - Triangulation<1,1>::n_global_levels () const + Triangulation<1,spacedim>::n_global_levels () const { Assert (false, ExcNotImplemented()); return 0; } - template <> + template MPI_Comm - Triangulation<1,1>::get_communicator () const + Triangulation<1,spacedim>::get_communicator () const { return MPI_COMM_WORLD; } - template <> + template const std::vector & - Triangulation<1,1>::get_p4est_tree_to_coarse_cell_permutation() const + Triangulation<1,spacedim>::get_p4est_tree_to_coarse_cell_permutation() const { static std::vector a; return a; } - template <> - void - Triangulation<1,1>:: - fill_vertices_with_ghost_neighbors - (std::map > - &vertices_with_ghost_neighbors) - { - Assert (false, ExcNotImplemented()); - } - - template <> - Triangulation<1,2>::Triangulation (MPI_Comm) - { - Assert (false, ExcNotImplemented()); - } - - - template <> - Triangulation<1,2>::~Triangulation () - { - Assert (false, ExcNotImplemented()); - } - - - - template <> - types::subdomain_id - Triangulation<1,2>::locally_owned_subdomain () const - { - Assert (false, ExcNotImplemented()); - return 0; - } - - - template <> - types::global_dof_index - Triangulation<1,2>::n_global_active_cells () const - { - Assert (false, ExcNotImplemented()); - return 0; - } - - - template <> - unsigned int - Triangulation<1,2>::n_global_levels () const - { - Assert (false, ExcNotImplemented()); - return 0; - } - - - template <> - MPI_Comm - Triangulation<1,2>::get_communicator () const - { - return MPI_COMM_WORLD; - } - - template <> - void - Triangulation<1,2>:: - fill_vertices_with_ghost_neighbors - (std::map > - &vertices_with_ghost_neighbors) - { - Assert (false, ExcNotImplemented()); - } - - - template <> - Triangulation<1,3>::Triangulation (MPI_Comm) - { - Assert (false, ExcNotImplemented()); - } - - - template <> - Triangulation<1,3>::~Triangulation () - { - Assert (false, ExcNotImplemented()); - } - - - - template <> - types::subdomain_id - Triangulation<1,3>::locally_owned_subdomain () const - { - Assert (false, ExcNotImplemented()); - return 0; - } - - - template <> - types::global_dof_index - Triangulation<1,3>::n_global_active_cells () const - { - Assert (false, ExcNotImplemented()); - return 0; - } - - - template <> - unsigned int - Triangulation<1,3>::n_global_levels () const - { - Assert (false, ExcNotImplemented()); - return 0; - } - - - template <> - MPI_Comm - Triangulation<1,3>::get_communicator () const - { - return MPI_COMM_WORLD; - } - - template <> + template void - Triangulation<1,3>:: + Triangulation<1,spacedim>:: fill_vertices_with_ghost_neighbors (std::map > &vertices_with_ghost_neighbors) -- 2.39.5