From 41598cb72e63afd84b5bc85b2845fde4d4f7d89c Mon Sep 17 00:00:00 2001 From: wolf Date: Mon, 2 Oct 2000 08:44:58 +0000 Subject: [PATCH] Some functions can be implemented in a dimension independent way. Do so. git-svn-id: https://svn.dealii.org/trunk@3367 0785d39b-7218-0410-832d-ea1e28bc413d --- .../deal.II/source/grid/grid_reordering.cc | 79 ++++++------------- 1 file changed, 22 insertions(+), 57 deletions(-) diff --git a/deal.II/deal.II/source/grid/grid_reordering.cc b/deal.II/deal.II/source/grid/grid_reordering.cc index e4af7e008f..61f5c7452e 100644 --- a/deal.II/deal.II/source/grid/grid_reordering.cc +++ b/deal.II/deal.II/source/grid/grid_reordering.cc @@ -60,6 +60,7 @@ GridReordering::Cell::insert_faces (map &/*global_faces*/) }; +#if deal_II_dimension == 2 template <> void @@ -172,6 +173,19 @@ GridReordering<2>::Cell::insert_faces (map &global_faces) }; }; +#endif +#if deal_II_dimension == 3 + +template <> +void +GridReordering<3>::Cell::insert_faces (map &/*global_faces*/) +{ + const unsigned int dim = 3; + + Assert (false, ExcNotImplemented()); +}; + +#endif template @@ -246,9 +260,6 @@ void GridReordering::Cell::find_backtracking_point () // of course, not hold for cell 0, // from which we should never be // forced to track back -// if (cell_no != 0) -// track_back_to_cell = cell_no-1; - if (cell_no == 0) track_back_to_cell = 0; else @@ -260,23 +271,8 @@ void GridReordering::Cell::find_backtracking_point () template inline -bool GridReordering::Cell::check_consistency (const unsigned int /*rot*/) const +bool GridReordering::Cell::check_consistency (const unsigned int rot) const { - // might be that we can use the - // specialization for dim==2 after - // some modification, but haven't - // thought about that yet - Assert (false, ExcNotImplemented()); - return false; -}; - - - -template <> -inline -bool GridReordering<2>::Cell::check_consistency (const unsigned int rot) const -{ - const unsigned int dim = 2; // make sure that for each face of // the cell the permuted faces are // not already in use, as that @@ -298,43 +294,11 @@ bool GridReordering<2>::Cell::check_consistency (const unsigned int rot) const }; -template -inline -void GridReordering::Cell::mark_faces_used (const unsigned int /*rot*/) -{ - // might be that we can use the - // specialization for dim==2 after - // some modification, but haven't - // thought about that yet. in - // particular, I don't know whether - // we have to treat edges in 3d - // specially - Assert (false, ExcNotImplemented()); -}; - - template inline -void GridReordering::Cell::mark_faces_unused (const unsigned int /*rot*/) +void GridReordering::Cell::mark_faces_used (const unsigned int rot) { - // might be that we can use the - // specialization for dim==2 after - // some modification, but haven't - // thought about that yet. in - // particular, I don't know whether - // we have to treat edges in 3d - // specially - Assert (false, ExcNotImplemented()); -}; - - - -template <> -inline -void GridReordering<2>::Cell::mark_faces_used (const unsigned int rot) -{ - const unsigned int dim=2; for (unsigned int face=0; face::faces_per_cell; ++face) { Assert (faces[rot][face]->second.use_count < 2, @@ -345,11 +309,10 @@ void GridReordering<2>::Cell::mark_faces_used (const unsigned int rot) -template <> +template inline -void GridReordering<2>::Cell::mark_faces_unused (const unsigned int rot) +void GridReordering::Cell::mark_faces_unused (const unsigned int rot) { - const unsigned int dim=2; for (unsigned int face=0; face::faces_per_cell; ++face) { Assert (faces[rot][face]->second.use_count > 0, @@ -443,10 +406,12 @@ void GridReordering::track_back (vector &cells, // backtracking const typename vector::iterator try_cell = cells.begin() + rotation_states.size(); + + track_back_to_cell = try_cell->track_back_to_cell; + // cout << "Further backtracking from " << rotation_states.size() -// << " to " << try_cell->track_back_to_cell << endl; +// << " to " << track_back_to_cell << endl; - track_back_to_cell = try_cell->track_back_to_cell; Assert (track_back_to_cell > 0, ExcInternalError()); // track further back. this -- 2.39.5