From: wolf Date: Thu, 20 Feb 2003 00:00:48 +0000 (+0000) Subject: Move some details into namespace internal. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e22a80df31807ef47bd4ffb93cd71b63f5b85a82;p=dealii-svn.git Move some details into namespace internal. git-svn-id: https://svn.dealii.org/trunk@7188 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/deal.II/include/grid/grid_reordering.h b/deal.II/deal.II/include/grid/grid_reordering.h index 395a185551..ea563e4b9c 100644 --- a/deal.II/deal.II/include/grid/grid_reordering.h +++ b/deal.II/deal.II/include/grid/grid_reordering.h @@ -20,16 +20,18 @@ #include +namespace internal +{ /** * Class declaring some dimension dependent numbers which are needed * for the grid reordering class. * * @author Wolfgang Bangerth, 2000 */ -template -class GridReorderingInfo -{ -}; + template + class GridReorderingInfo + { + }; /** @@ -39,29 +41,29 @@ class GridReorderingInfo * * @author Wolfgang Bangerth, 2000 */ -template <> -class GridReorderingInfo<2> -{ - public: - /** - * Number of possible valid - * orientations of a cell. They - * are the state in which it was - * delivered and three possible - * rotations in counter-clockwise - * sense, thus a total of four. - */ - static const unsigned int rotational_states_of_cells = 4; - - /** - * Number of possible - * orientations of a face in - * 2d. It is the face and the - * face with vertices exchanged, - * thus two. - */ - static const unsigned int rotational_states_of_faces = 2; -}; + template <> + class GridReorderingInfo<2> + { + public: + /** + * Number of possible valid + * orientations of a cell. They + * are the state in which it was + * delivered and three possible + * rotations in counter-clockwise + * sense, thus a total of four. + */ + static const unsigned int rotational_states_of_cells = 4; + + /** + * Number of possible + * orientations of a face in + * 2d. It is the face and the + * face with vertices exchanged, + * thus two. + */ + static const unsigned int rotational_states_of_faces = 2; + }; @@ -72,39 +74,40 @@ class GridReorderingInfo<2> * * @author Wolfgang Bangerth, 2000 */ -template <> -class GridReorderingInfo<3> -{ - public: - /** - * Number of possible - * orientations of a cell in 3d, - * i.e. in how many ways can we - * arrange the eight vertices of - * a cube such that the numbering - * conventions of deal.II are - * satisfied. Since we can put - * the cube on each of its six - * faces and rotate it into four - * ways on each of these faces, - * the total number is 24. - */ - static const unsigned int rotational_states_of_cells = 24; - - /** - * Number of possible - * orientations of a face in - * 2d. It is the quadrilateral - * rotated in all four - * orientations, and also viewed - * from the back, i.e. vertices - * not numbered in - * counter-clockwise sense but in - * the other direction. - */ - static const unsigned int rotational_states_of_faces = 8; -}; - + template <> + class GridReorderingInfo<3> + { + public: + /** + * Number of possible + * orientations of a cell in 3d, + * i.e. in how many ways can we + * arrange the eight vertices of + * a cube such that the numbering + * conventions of deal.II are + * satisfied. Since we can put + * the cube on each of its six + * faces and rotate it into four + * ways on each of these faces, + * the total number is 24. + */ + static const unsigned int rotational_states_of_cells = 24; + + /** + * Number of possible + * orientations of a face in + * 2d. It is the quadrilateral + * rotated in all four + * orientations, and also viewed + * from the back, i.e. vertices + * not numbered in + * counter-clockwise sense but in + * the other direction. + */ + static const unsigned int rotational_states_of_faces = 8; + }; + +} @@ -517,7 +520,7 @@ class GridReorderingInfo<3> * @author Wolfgang Bangerth, 2000 */ template -class GridReordering : private GridReorderingInfo +class GridReordering { public: /** @@ -615,7 +618,7 @@ class GridReordering : private GridReorderingInfo * cell. */ typename std::map::iterator - faces[GridReorderingInfo::rotational_states_of_cells][GeometryInfo::faces_per_cell]; + faces[internal::GridReorderingInfo::rotational_states_of_cells][GeometryInfo::faces_per_cell]; /** * Cell indices of the @@ -827,7 +830,7 @@ class GridReordering : private GridReorderingInfo * algorithm. */ typename std::map::const_iterator - reverse_faces[GridReorderingInfo::rotational_states_of_faces-1]; + reverse_faces[internal::GridReorderingInfo::rotational_states_of_faces-1]; /** * Indices of the one or two diff --git a/deal.II/deal.II/source/grid/grid_reordering.cc b/deal.II/deal.II/source/grid/grid_reordering.cc index 7451ea6226..150ce0ab18 100644 --- a/deal.II/deal.II/source/grid/grid_reordering.cc +++ b/deal.II/deal.II/source/grid/grid_reordering.cc @@ -18,23 +18,25 @@ +namespace internal +{ // static variables #if deal_II_dimension == 2 -const unsigned int GridReorderingInfo<2>::rotational_states_of_cells; -const unsigned int GridReorderingInfo<2>::rotational_states_of_faces; + const unsigned int GridReorderingInfo<2>::rotational_states_of_cells; + const unsigned int GridReorderingInfo<2>::rotational_states_of_faces; #endif #if deal_II_dimension == 3 -const unsigned int GridReorderingInfo<3>::rotational_states_of_cells; -const unsigned int GridReorderingInfo<3>::rotational_states_of_faces; + const unsigned int GridReorderingInfo<3>::rotational_states_of_cells; + const unsigned int GridReorderingInfo<3>::rotational_states_of_faces; #endif -template -const unsigned int GridReordering::Cell::invalid_neighbor; - -template -const unsigned int GridReordering::FaceData::invalid_adjacent_cell; + template + const unsigned int GridReordering::Cell::invalid_neighbor; + template + const unsigned int GridReordering::FaceData::invalid_adjacent_cell; +} @@ -65,7 +67,7 @@ GridReordering::Cell::Cell (const Cell &c) : cell_no(c.cell_no), track_back_to_cell(c.track_back_to_cell) { - for (unsigned int i=0; i::rotational_states_of_cells; ++i) + for (unsigned int i=0; i::rotational_states_of_cells; ++i) for (unsigned int j=0; j::faces_per_cell; ++j) faces[i][j]=c.faces[i][j]; @@ -245,7 +247,7 @@ GridReordering<3>::Cell::insert_faces (std::map &global_faces) this->vertices[6], this->vertices[7] } }, { { this->vertices[0], this->vertices[4], this->vertices[7], this->vertices[3] } } }; - Face new_faces[GeometryInfo::faces_per_cell][GridReorderingInfo::rotational_states_of_faces] + Face new_faces[GeometryInfo::faces_per_cell][internal::GridReorderingInfo::rotational_states_of_faces] = { { new_faces_tmp[0], new_faces_tmp[0], new_faces_tmp[0], new_faces_tmp[0], new_faces_tmp[0], new_faces_tmp[0], new_faces_tmp[0], new_faces_tmp[0] }, { new_faces_tmp[1], new_faces_tmp[0], new_faces_tmp[0], new_faces_tmp[0], @@ -262,7 +264,7 @@ GridReordering<3>::Cell::insert_faces (std::map &global_faces) // first do the faces in their // usual direction for (unsigned int face=0; face::faces_per_cell; ++face) - for (unsigned int rot=1; rot::rotational_states_of_faces/2; ++rot) + for (unsigned int rot=1; rot::rotational_states_of_faces/2; ++rot) for (unsigned int v=0; v::vertices_per_face; ++v) new_faces[face][rot].vertices[v] = new_faces[face][0].vertices[(v+rot) % GeometryInfo::vertices_per_face]; @@ -271,14 +273,14 @@ GridReordering<3>::Cell::insert_faces (std::map &global_faces) // as we only have to revert // indices 1 and 3 for (unsigned int face=0; face::faces_per_cell; ++face) - for (unsigned int rot=GridReorderingInfo::rotational_states_of_faces/2; - rot::rotational_states_of_faces; + for (unsigned int rot=internal::GridReorderingInfo::rotational_states_of_faces/2; + rot::rotational_states_of_faces; ++rot) { for (unsigned int v=0; v::vertices_per_face; ++v) new_faces[face][rot].vertices[v] = new_faces[face] - [rot-GridReorderingInfo::rotational_states_of_faces/2].vertices[v]; + [rot-internal::GridReorderingInfo::rotational_states_of_faces/2].vertices[v]; std::swap (new_faces[face][rot].vertices[1], new_faces[face][rot].vertices[3]); }; @@ -296,11 +298,11 @@ GridReordering<3>::Cell::insert_faces (std::map &global_faces) // it or not. we don't care about // that here, though std::map::iterator - new_faces_ptr[GridReorderingInfo::rotational_states_of_faces] + new_faces_ptr[internal::GridReorderingInfo::rotational_states_of_faces] [GeometryInfo::faces_per_cell]; for (unsigned int face=0; face::faces_per_cell; ++face) for (unsigned int rot=0; - rot::rotational_states_of_faces; + rot::rotational_states_of_faces; ++rot) new_faces_ptr[rot][face] = global_faces.insert (std::make_pair(new_faces[face][rot], FaceData())).first; @@ -308,10 +310,10 @@ GridReordering<3>::Cell::insert_faces (std::map &global_faces) // and crosslink them to each other for (unsigned int face=0; face::faces_per_cell; ++face) for (unsigned int rot=0; - rot::rotational_states_of_faces; + rot::rotational_states_of_faces; ++rot) for (unsigned int other_rot=0; - other_rot::rotational_states_of_faces; + other_rot::rotational_states_of_faces; ++other_rot) { if (other_rot < rot) @@ -346,7 +348,7 @@ GridReordering<3>::Cell::insert_faces (std::map &global_faces) // used before, so we are the // first adjacent cell for (unsigned int rot=0; - rot::rotational_states_of_faces; + rot::rotational_states_of_faces; ++rot) { Assert (new_faces_ptr[rot][face]->second.adjacent_cells[0] @@ -364,7 +366,7 @@ GridReordering<3>::Cell::insert_faces (std::map &global_faces) previous_neighbor = new_faces_ptr[0][face]->second.adjacent_cells[0]; // cout << " as neighbor 1 (previous: " << previous_neighbor << ")" << endl; for (unsigned int rot=0; - rot::rotational_states_of_faces; + rot::rotational_states_of_faces; ++rot) { Assert (new_faces_ptr[rot][face]->second.adjacent_cells[0] == @@ -434,11 +436,11 @@ GridReordering<3>::Cell::insert_faces (std::map &global_faces) // cell (store which face and which // orientation): static std::pair - cell_orientation_faces[GridReorderingInfo::rotational_states_of_cells][GeometryInfo::faces_per_cell]; + cell_orientation_faces[internal::GridReorderingInfo::rotational_states_of_cells][GeometryInfo::faces_per_cell]; if (already_initialized == false) { - for (unsigned int rot=0; rot::rotational_states_of_cells; ++rot) + for (unsigned int rot=0; rot::rotational_states_of_cells; ++rot) { // initialize a standard // cell with the vertex @@ -478,7 +480,7 @@ GridReordering<3>::Cell::insert_faces (std::map &global_faces) for (unsigned int f=0; (!face_found) && (f::faces_per_cell); ++f) for (unsigned int r=0; - r::rotational_states_of_faces; + r::rotational_states_of_faces; ++r) if (standard_faces[face] == new_faces[f][r]) { @@ -543,7 +545,7 @@ GridReordering<3>::Cell::insert_faces (std::map &global_faces) // directions to the cell in each // of its orientations for (unsigned int rot=0; - rot::rotational_states_of_cells; + rot::rotational_states_of_cells; ++rot) for (unsigned int face=0; face::faces_per_cell; ++face) faces[rot][face] = new_faces_ptr @@ -638,7 +640,7 @@ bool GridReordering::Cell::check_consistency (const unsigned int rot) const const FaceData &face = faces[rot][face_no]->second; for (unsigned int face_rot=0; - face_rot::rotational_states_of_faces-1; + face_rot::rotational_states_of_faces-1; ++face_rot) { const FaceData &reverse_face = face.reverse_faces[face_rot]->second; @@ -756,14 +758,14 @@ void GridReordering::track_back (std::vector &cells, // stack rotation_states.pop_back(); }; - Assert (last_rotation_state < GridReorderingInfo::rotational_states_of_cells, ExcInternalError()); + Assert (last_rotation_state < internal::GridReorderingInfo::rotational_states_of_cells, ExcInternalError()); // now we will have to find out // whether we can try the last cell // we have popped from the stack in // another rotation state, or will // have to backtrack further: - if (last_rotation_state < GridReorderingInfo::rotational_states_of_cells-1) + if (last_rotation_state < internal::GridReorderingInfo::rotational_states_of_cells-1) { // possible. push that state to // the stack and leave @@ -840,7 +842,7 @@ bool GridReordering::try_rotate_single_neighbors (std::vector &cells, // that have already been // tried: for (unsigned int neighbor_rot=old_rotation_state+1; - neighbor_rot::rotational_states_of_cells; ++neighbor_rot) + neighbor_rot::rotational_states_of_cells; ++neighbor_rot) { // first, if the // neighbor itself does @@ -860,7 +862,7 @@ bool GridReordering::try_rotate_single_neighbors (std::vector &cells, // orientation cells[neighbor_no].mark_faces_used (neighbor_rot); - for (unsigned int cell_rot=0; cell_rot::rotational_states_of_cells; ++cell_rot) + for (unsigned int cell_rot=0; cell_rot::rotational_states_of_cells; ++cell_rot) if (cells[cell_no].check_consistency (cell_rot) == true) { // ah, see, @@ -989,7 +991,7 @@ void GridReordering::find_reordering (std::vector &cells, // we can rotate the top // cell so that it works if (rotation_states.back()+1 - < GridReorderingInfo::rotational_states_of_cells) + < internal::GridReorderingInfo::rotational_states_of_cells) { // yes, can be // done. then do so and diff --git a/deal.II/doc/news/2002/c-3-4.html b/deal.II/doc/news/2002/c-3-4.html index d08852434e..c2ba3e5b04 100644 --- a/deal.II/doc/news/2002/c-3-4.html +++ b/deal.II/doc/news/2002/c-3-4.html @@ -739,6 +739,14 @@ contributor's names are abbreviated by WB (Wolfgang Bangerth), GK

deal.II

    +
  1. + Changed: Some implementation details of the GridReordering class have been moved to a + namespace internal. +
    + (WB 2003/02/19) +

    +
  2. New: There is now a function FiniteElement::constraints_are_implemented that