]> https://gitweb.dealii.org/ - dealii.git/commitdiff
GridTools::collect_periodic_faces: Port back to "const int" for the direction
authorMatthias Maier <tamiko@kyomu.43-1.org>
Mon, 30 Sep 2013 23:29:03 +0000 (23:29 +0000)
committerMatthias Maier <tamiko@kyomu.43-1.org>
Mon, 30 Sep 2013 23:29:03 +0000 (23:29 +0000)
It is way too painful to workaround the compiler warnings a "const
unsigned int" produces

git-svn-id: https://svn.dealii.org/branches/branch_port_the_testsuite@31050 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/include/deal.II/grid/grid_tools.h
deal.II/source/grid/grid_tools.cc
deal.II/source/grid/grid_tools.inst.in

index 5731c540da34744301604abfea1d8aeaa6f67cc0..ac6080e5659d4f99acf6b2632d8b9d0929e62b25 100644 (file)
@@ -1050,7 +1050,7 @@ namespace GridTools
   orthogonal_equality (std::bitset<3>     &orientation,
                        const FaceIterator &face1,
                        const FaceIterator &face2,
-                       const unsigned int direction,
+                       const int          direction,
                        const dealii::Tensor<1,FaceIterator::AccessorType::space_dimension> &offset);
 
 
@@ -1061,7 +1061,7 @@ namespace GridTools
   bool
   orthogonal_equality (const FaceIterator &face1,
                        const FaceIterator &face2,
-                       const unsigned int direction,
+                       const int          direction,
                        const dealii::Tensor<1,FaceIterator::AccessorType::space_dimension> &offset);
 
 
@@ -1102,7 +1102,7 @@ namespace GridTools
   (const DH                 &dof_handler,
    const types::boundary_id b_id1,
    const types::boundary_id b_id2,
-   const unsigned int       direction,
+   const int                direction,
    const dealii::Tensor<1,DH::space_dimension> &offset);
 
 
@@ -1131,7 +1131,7 @@ namespace GridTools
   collect_periodic_faces
   (const DH                 &dof_handler,
    const types::boundary_id b_id,
-   const unsigned int       direction,
+   const int                direction,
    const dealii::Tensor<1,DH::space_dimension> &offset);
 
 
index 8561198444e42f02898d30981ce4faa6caf68062..9f1be3567792e6116f04751dd7a43112cee8859a 100644 (file)
@@ -2199,10 +2199,10 @@ next_cell:
   template<int spacedim>
   inline bool orthogonal_equality (const dealii::Point<spacedim> &point1,
                                    const dealii::Point<spacedim> &point2,
-                                   const unsigned int direction,
+                                   const int                     direction,
                                    const dealii::Tensor<1,spacedim> &offset)
   {
-    Assert (direction<spacedim,
+    Assert (0<=direction && direction<spacedim,
             ExcIndexRange (direction, 0, spacedim));
     for (int i = 0; i < spacedim; ++i)
       {
@@ -2300,7 +2300,7 @@ next_cell:
   orthogonal_equality (std::bitset<3>     &orientation,
                        const FaceIterator &face1,
                        const FaceIterator &face2,
-                       const unsigned int direction,
+                       const int          direction,
                        const dealii::Tensor<1,FaceIterator::AccessorType::space_dimension> &offset)
   {
     static const int dim = FaceIterator::AccessorType::dimension;
@@ -2343,7 +2343,7 @@ next_cell:
   inline bool
   orthogonal_equality (const FaceIterator &face1,
                        const FaceIterator &face2,
-                       const unsigned int direction,
+                       const int          direction,
                        const dealii::Tensor<1,FaceIterator::AccessorType::space_dimension> &offset)
   {
     // Call the function above with a dummy orientation array
@@ -2361,11 +2361,11 @@ next_cell:
   match_periodic_face_pairs 
     (std::set<std::pair<CellIterator, unsigned int> > &pairs1,
      std::set<std::pair<typename identity<CellIterator>::type, unsigned int> > &pairs2,
-     const unsigned int direction,
+     const int direction,
      const dealii::Tensor<1,CellIterator::AccessorType::space_dimension> &offset)
   {
     static const int space_dim = CellIterator::AccessorType::space_dimension;
-    Assert (direction<space_dim,
+    Assert (0<=direction && direction<space_dim,
             ExcIndexRange (direction, 0, space_dim));
 
     Assert (pairs1.size() == pairs2.size(),
@@ -2416,12 +2416,12 @@ next_cell:
     (const DH                 &dof_handler,
      const types::boundary_id b_id1,
      const types::boundary_id b_id2,
-     const unsigned int       direction,
+     const int                direction,
      const dealii::Tensor<1,DH::space_dimension> &offset)
   {
     static const unsigned int dim = DH::dimension;
     static const unsigned int space_dim = DH::space_dimension;
-    Assert (direction<space_dim,
+    Assert (0<=direction && direction<space_dim,
             ExcIndexRange (direction, 0, space_dim));
 
     // Loop over all cells on the highest level and collect all boundary
@@ -2465,12 +2465,12 @@ next_cell:
   std::vector<PeriodicFacePair<typename DH::cell_iterator> >
   collect_periodic_faces (const DH                 &dof_handler,
                           const types::boundary_id b_id,
-                          const unsigned int       direction,
+                          const int                direction,
                           const dealii::Tensor<1,DH::space_dimension> &offset)
   {
     static const unsigned int dim = DH::dimension;
     static const unsigned int space_dim = DH::space_dimension;
-    Assert (direction<space_dim,
+    Assert (0<=direction && direction<space_dim,
             ExcIndexRange (direction, 0, space_dim));
 
     Assert(dim == space_dim,
index e76bf22615d07649a34bb6ef40ac6f98299f4524..6f4d0f0d6edb8a072ad3b3f46704894b202cb68f 100644 (file)
@@ -227,26 +227,26 @@ for (X : TRIANGULATION_AND_DOFHANDLERS; deal_II_dimension : DIMENSIONS ; deal_II
     bool orthogonal_equality<X::active_face_iterator> (std::bitset<3> &,
                                                        const X::active_face_iterator&,
                                                        const X::active_face_iterator&,
-                                                       const unsigned int,
+                                                       const int,
                                                        const Tensor<1,deal_II_space_dimension> &);
 
     template
     bool orthogonal_equality<X::face_iterator> (std::bitset<3> &,
                                                 const X::face_iterator&,
                                                 const X::face_iterator&,
-                                                const unsigned int,
+                                                const int,
                                                 const Tensor<1,deal_II_space_dimension> &);
 
     template
     bool orthogonal_equality<X::active_face_iterator> (const X::active_face_iterator&,
                                                        const X::active_face_iterator&,
-                                                       const unsigned int,
+                                                       const int,
                                                        const Tensor<1,deal_II_space_dimension> &);
 
     template
     bool orthogonal_equality<X::face_iterator> (const X::face_iterator&,
                                                 const X::face_iterator&,
-                                                const unsigned int,
+                                                const int,
                                                 const Tensor<1,deal_II_space_dimension> &);
 
     #if deal_II_dimension >= 2
@@ -257,7 +257,7 @@ for (X : TRIANGULATION_AND_DOFHANDLERS; deal_II_dimension : DIMENSIONS ; deal_II
                                  (const X &,
                                   const types::boundary_id,
                                   const types::boundary_id,
-                                  const unsigned int,
+                                  const int,
                                   const Tensor<1,X::space_dimension> &);
 
       template
@@ -265,7 +265,7 @@ for (X : TRIANGULATION_AND_DOFHANDLERS; deal_II_dimension : DIMENSIONS ; deal_II
       collect_periodic_faces<X>
                                  (const X &,
                                   const types::boundary_id,
-                                  const unsigned int,
+                                  const int,
                                   const Tensor<1,X::space_dimension> &);
 
     #endif

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.