]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Added tests for collect_periodic_face_pairs and unified code in make_periodicity_cons...
authordaniel.arndt <daniel.arndt@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 19 Sep 2013 16:33:50 +0000 (16:33 +0000)
committerdaniel.arndt <daniel.arndt@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 19 Sep 2013 16:33:50 +0000 (16:33 +0000)
git-svn-id: https://svn.dealii.org/trunk@30832 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/source/dofs/dof_tools_constraints.cc
deal.II/source/grid/grid_tools.cc
tests/bits/dof_tools_21_b.cc
tests/bits/dof_tools_21_b_x.cc
tests/bits/dof_tools_21_b_x_q3.cc
tests/bits/dof_tools_21_b_y.cc

index adaf93b7f0084543316153f47dd9b5b4aa133e8f..4909d3a7b5935537d3aab09681a838ca0feac1e8 100644 (file)
@@ -2014,38 +2014,12 @@ namespace DoFTools
                           <typename DH::cell_iterator> > FaceVector;
 
     // Collect matching periodic cells on the coarsest level:
-    FaceVector matched_cells =
+    FaceVector matched_faces =
       GridTools::collect_periodic_faces(dof_handler, b_id1, b_id2,
                                         direction, offset);
 
-    // And apply the low level make_periodicity_constraints function to
-    // every matching pair:
-    for (typename FaceVector::iterator it = matched_cells.begin();
-         it != matched_cells.end(); ++it)
-      {
-        typedef typename DH::face_iterator FaceIterator;
-        const FaceIterator &face_1 = it->cell[0]->face(it->face_idx[0]);
-        const FaceIterator &face_2 = it->cell[1]->face(it->face_idx[1]);
-        const std::bitset<3> &orientation = it->orientation;
-
-        Assert(face_1->at_boundary() && face_2->at_boundary(),
-               ExcInternalError());
-
-        Assert (face_1->boundary_indicator() == b_id1 &&
-                face_2->boundary_indicator() == b_id2,
-                ExcInternalError());
-
-        Assert (face_1 != face_2,
-                ExcInternalError());
-
-        make_periodicity_constraints(face_1,
-                                     face_2,
-                                     constraint_matrix,
-                                     component_mask,
-                                     orientation[0],
-                                     orientation[1],
-                                     orientation[2]);
-      }
+    make_periodicity_constraints<DH>
+      (matched_faces, constraint_matrix, component_mask);
   }
 
 
@@ -2091,35 +2065,12 @@ namespace DoFTools
                           <typename DH::cell_iterator> > FaceVector;
 
     // Collect matching periodic cells on the coarsest level:
-    const FaceVector matched_cells =
+    const FaceVector matched_faces =
       GridTools::collect_periodic_faces(dof_handler, b_id,
                                         direction, offset);
 
-    // And apply the low level make_periodicity_constraints function to
-    // every matching pair:
-    for (typename FaceVector::const_iterator it = matched_cells.begin();
-         it != matched_cells.end(); ++it)
-      {
-        typedef typename DH::face_iterator FaceIterator;
-        const FaceIterator &face_1 = it->cell[0]->face(it->face_idx[0]);
-        const FaceIterator &face_2 = it->cell[1]->face(it->face_idx[1]);
-
-        Assert(face_1->at_boundary() && face_2->at_boundary(),
-               ExcInternalError());
-
-        Assert (face_1->boundary_indicator() == b_id &&
-                face_2->boundary_indicator() == b_id,
-                ExcInternalError());
-
-        Assert (face_1 != face_2,
-                ExcInternalError());
-
-        make_periodicity_constraints(face_1,
-                                     face_2,
-                                     constraint_matrix,
-                                     component_mask
-                                     /* standard orientation */);
-      }
+    make_periodicity_constraints<DH>
+      (matched_faces, constraint_matrix, component_mask);
   }
 
 
@@ -2137,13 +2088,22 @@ namespace DoFTools
     typename FaceVector::const_iterator it, end_periodic;
     it = periodic_faces.begin();
     end_periodic = periodic_faces.end();
-    
+
+
+    // And apply the low level make_periodicity_constraints function to
+    // every matching pair:
     for(; it!=end_periodic; ++it)
     {
       typedef typename DH::face_iterator FaceIterator;
       const FaceIterator face_1 = it->cell[0]->face(it->face_idx[0]);
       const FaceIterator face_2 = it->cell[1]->face(it->face_idx[1]);
-      
+
+      Assert(face_1->at_boundary() && face_2->at_boundary(),
+             ExcInternalError());
+
+      Assert (face_1 != face_2,
+              ExcInternalError());
+
       make_periodicity_constraints(face_1,
                                    face_2,
                                    constraint_matrix,
index f072a4d3dce4c5a5a98a846431ef60f54b18083b..4f6981479de1bb2b38819191d48f07d8f41ffccb 100644 (file)
@@ -2547,15 +2547,15 @@ next_cell:
            if (face_1->at_boundary() && face_1->boundary_indicator() == b_id)
            {
              const std::pair<typename DH::cell_iterator, unsigned int> pair1
-             = std::make_pair(cell, 2*direction);
+               = std::make_pair(cell, 2*direction);
              pairs1.insert(pair1);
            }
            
            if (face_2->at_boundary() && face_2->boundary_indicator() == b_id)
            {
-             const std::pair<typename DH::cell_iterator, unsigned int> pair1
-             = std::make_pair(cell, 2*direction+1);
-             pairs1.insert(pair1);
+             const std::pair<typename DH::cell_iterator, unsigned int> pair2
+               = std::make_pair(cell, 2*direction+1);
+             pairs2.insert(pair2);
            }
          }
          
index 59cd7bb6dd116b682471cd2a9a4e9c32badf8859..8ea53210b81fcbb5e05b6d15a839d088931cd678 100644 (file)
@@ -49,7 +49,7 @@ using namespace dealii;
 
 /*
  * Generate a grid consisting of two disjoint cells, colorize the two
- * outermost faces. They will be matched via collect_periodic_face_pairs
+ * outermost faces. They will be matched via collect_periodic_faces
  *
  * The integer orientation determines the orientation of the second cell
  * to get something else than the boring default orientation.
index c6d8ef6c68f44e3b7266ac4892386190d58347e8..0e5dba13080a37c8c13c304bf0a40bcb290b1b28 100644 (file)
@@ -52,7 +52,7 @@ using namespace dealii;
 
 /*
  * Generate a grid consisting of two disjoint cells, colorize the two
- * outermost faces. They will be matched via collect_periodic_face_pairs
+ * outermost faces. They will be matched via collect_periodic_faces
  *
  * The integer orientation determines the orientation of the second cell
  * to get something else than the boring default orientation.
index 9324ce51c5bed4723cdd8c823ea0fa62d8a087c3..df47f64bed58b54794dbe0e47c8a090e32947640 100644 (file)
@@ -86,7 +86,7 @@ using namespace dealii;
 
 /*
  * Generate a grid consisting of two disjoint cells, colorize the two
- * outermost faces. They will be matched via collect_periodic_face_pairs
+ * outermost faces. They will be matched via collect_periodic_faces
  *
  * The integer orientation determines the orientation of the second cell
  * to get something else than the boring default orientation.
index ca82a6cbac924605bbda3357b875a3b0f921ba81..e819ff257e946f0a108a2b5f7daeb7771f2ed698 100644 (file)
@@ -50,7 +50,7 @@ using namespace dealii;
 
 /*
  * Generate a grid consisting of two disjoint cells, colorize the two
- * outermost faces. They will be matched via collect_periodic_face_pairs
+ * outermost faces. They will be matched via collect_periodic_faces
  *
  * The integer orientation determines the orientation of the second cell
  * to get something else than the boring default orientation.

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.