From 219b5b183cf2df36ee5c2fe8e19e31bfe28f8418 Mon Sep 17 00:00:00 2001 From: maier Date: Tue, 1 Oct 2013 21:35:47 +0000 Subject: [PATCH] Port grid_tools_05.cc test to collect_periodic_faces git-svn-id: https://svn.dealii.org/trunk@31063 0785d39b-7218-0410-832d-ea1e28bc413d --- tests/deal.II/grid_tools_05.cc | 53 +++----- tests/deal.II/grid_tools_05/cmp/generic | 154 ------------------------ 2 files changed, 14 insertions(+), 193 deletions(-) diff --git a/tests/deal.II/grid_tools_05.cc b/tests/deal.II/grid_tools_05.cc index e099e85470..c1a7d00af9 100644 --- a/tests/deal.II/grid_tools_05.cc +++ b/tests/deal.II/grid_tools_05.cc @@ -17,7 +17,7 @@ // -// check collect_periodic_face_pairs for correct return values +// check collect_periodic_faces for correct return values // @@ -222,30 +222,18 @@ int main() generate_grid(triangulation, i); - typedef Triangulation<2>::face_iterator FaceIterator; - typedef std::map > > FaceMap; - FaceMap test = GridTools::collect_periodic_face_pairs (triangulation, 42, 43, 1, - dealii::Tensor<1,2>()); + typedef std::vector::cell_iterator> > FaceMap; + + FaceMap test = GridTools::collect_periodic_faces (triangulation, 42, 43, 1, + dealii::Tensor<1,2>()); deallog << "Triangulation: " << i << std::endl; deallog << "Coarse match: " << test.size() << std::endl; for (FaceMap::iterator facepair = test.begin(); facepair != test.end(); ++facepair) - print_match(facepair->first, facepair->second.first, facepair->second.second); - - - typedef Triangulation<2>::active_face_iterator FaceIterator2; - typedef std::map > > FaceMap2; - FaceMap2 test2 = GridTools::collect_periodic_face_pairs (triangulation.begin_active_face(), - triangulation.end_face(), - 42, 43, - 1, - dealii::Tensor<1,2>()); - - deallog << "Fine match: " << test2.size() << std::endl; - - for (FaceMap2::iterator facepair = test2.begin(); facepair != test2.end(); ++facepair) - print_match(facepair->first, facepair->second.first, facepair->second.second); + print_match(facepair->cell[0]->face(facepair->face_idx[0]), + facepair->cell[1]->face(facepair->face_idx[1]), + facepair->orientation); } deallog << "Test for 3D: Hypercube" << std::endl << std::endl; @@ -257,30 +245,17 @@ int main() generate_grid(triangulation, i); - typedef Triangulation<3>::face_iterator FaceIterator; - typedef std::map > > FaceMap; - FaceMap test = GridTools::collect_periodic_face_pairs (triangulation, 42, 43, 2, - dealii::Tensor<1,3>()); + typedef std::vector::cell_iterator> > FaceMap; + FaceMap test = GridTools::collect_periodic_faces (triangulation, 42, 43, 2, + dealii::Tensor<1,3>()); deallog << "Triangulation: " << i << std::endl; deallog << "Coarse match: " << test.size() << std::endl; for (FaceMap::iterator facepair = test.begin(); facepair != test.end(); ++facepair) - print_match(facepair->first, facepair->second.first, facepair->second.second); - - - typedef Triangulation<3>::active_face_iterator FaceIterator2; - typedef std::map > > FaceMap2; - FaceMap2 test2 = GridTools::collect_periodic_face_pairs (triangulation.begin_active_face(), - triangulation.end_face(), - 42, 43, - 2, - dealii::Tensor<1,3>()); - - deallog << "Fine match: " << test2.size() << std::endl; - - for (FaceMap2::iterator facepair = test2.begin(); facepair != test2.end(); ++facepair) - print_match(facepair->first, facepair->second.first, facepair->second.second); + print_match(facepair->cell[0]->face(facepair->face_idx[0]), + facepair->cell[1]->face(facepair->face_idx[1]), + facepair->orientation); } return 0; diff --git a/tests/deal.II/grid_tools_05/cmp/generic b/tests/deal.II/grid_tools_05/cmp/generic index 36b7388a9c..9ac1c5e3ef 100644 --- a/tests/deal.II/grid_tools_05/cmp/generic +++ b/tests/deal.II/grid_tools_05/cmp/generic @@ -7,30 +7,12 @@ DEAL::face 1 :: -1.000 3.000 :: 1.000 3.000 DEAL::face 2 :: -1.000 -3.000 :: 1.000 -3.000 DEAL::orientation: 1 flip: 0 rotation: 0 DEAL:: -DEAL::Fine match: 2 -DEAL::face 1 :: -1.000 3.000 :: 0.000 3.000 -DEAL::face 2 :: -1.000 -3.000 :: 0.000 -3.000 -DEAL::orientation: 1 flip: 0 rotation: 0 -DEAL:: -DEAL::face 1 :: 0.000 3.000 :: 1.000 3.000 -DEAL::face 2 :: 0.000 -3.000 :: 1.000 -3.000 -DEAL::orientation: 1 flip: 0 rotation: 0 -DEAL:: DEAL::Triangulation: 1 DEAL::Coarse match: 1 DEAL::face 1 :: 1.000 3.000 :: -1.000 3.000 DEAL::face 2 :: -1.000 -3.000 :: 1.000 -3.000 DEAL::orientation: 1 flip: 1 rotation: 0 DEAL:: -DEAL::Fine match: 2 -DEAL::face 1 :: 1.000 3.000 :: 0.000 3.000 -DEAL::face 2 :: 0.000 -3.000 :: 1.000 -3.000 -DEAL::orientation: 1 flip: 1 rotation: 0 -DEAL:: -DEAL::face 1 :: 0.000 3.000 :: -1.000 3.000 -DEAL::face 2 :: -1.000 -3.000 :: 0.000 -3.000 -DEAL::orientation: 1 flip: 1 rotation: 0 -DEAL:: DEAL::Test for 3D: Hypercube DEAL:: DEAL::Triangulation: 0 @@ -39,181 +21,45 @@ DEAL::face 1 :: -1.000 -1.000 3.000 :: 1.000 -1.000 3.000 :: -1.000 1.000 3.000 DEAL::face 2 :: -1.000 -1.000 -3.000 :: 1.000 -1.000 -3.000 :: -1.000 1.000 -3.000 :: 1.000 1.000 -3.000 DEAL::orientation: 1 flip: 0 rotation: 0 DEAL:: -DEAL::Fine match: 4 -DEAL::face 1 :: -1.000 -1.000 3.000 :: 0.000 -1.000 3.000 :: -1.000 0.000 3.000 :: 0.000 0.000 3.000 -DEAL::face 2 :: -1.000 -1.000 -3.000 :: 0.000 -1.000 -3.000 :: -1.000 0.000 -3.000 :: 0.000 0.000 -3.000 -DEAL::orientation: 1 flip: 0 rotation: 0 -DEAL:: -DEAL::face 1 :: 0.000 -1.000 3.000 :: 1.000 -1.000 3.000 :: 0.000 0.000 3.000 :: 1.000 0.000 3.000 -DEAL::face 2 :: 0.000 -1.000 -3.000 :: 1.000 -1.000 -3.000 :: 0.000 0.000 -3.000 :: 1.000 0.000 -3.000 -DEAL::orientation: 1 flip: 0 rotation: 0 -DEAL:: -DEAL::face 1 :: -1.000 0.000 3.000 :: 0.000 0.000 3.000 :: -1.000 1.000 3.000 :: 0.000 1.000 3.000 -DEAL::face 2 :: -1.000 0.000 -3.000 :: 0.000 0.000 -3.000 :: -1.000 1.000 -3.000 :: 0.000 1.000 -3.000 -DEAL::orientation: 1 flip: 0 rotation: 0 -DEAL:: -DEAL::face 1 :: 0.000 0.000 3.000 :: 1.000 0.000 3.000 :: 0.000 1.000 3.000 :: 1.000 1.000 3.000 -DEAL::face 2 :: 0.000 0.000 -3.000 :: 1.000 0.000 -3.000 :: 0.000 1.000 -3.000 :: 1.000 1.000 -3.000 -DEAL::orientation: 1 flip: 0 rotation: 0 -DEAL:: DEAL::Triangulation: 1 DEAL::Coarse match: 1 DEAL::face 1 :: 1.000 -1.000 3.000 :: 1.000 1.000 3.000 :: -1.000 -1.000 3.000 :: -1.000 1.000 3.000 DEAL::face 2 :: -1.000 -1.000 -3.000 :: 1.000 -1.000 -3.000 :: -1.000 1.000 -3.000 :: 1.000 1.000 -3.000 DEAL::orientation: 1 flip: 0 rotation: 1 DEAL:: -DEAL::Fine match: 4 -DEAL::face 1 :: 1.000 -1.000 3.000 :: 1.000 0.000 3.000 :: 0.000 -1.000 3.000 :: 0.000 0.000 3.000 -DEAL::face 2 :: 0.000 -1.000 -3.000 :: 1.000 -1.000 -3.000 :: 0.000 0.000 -3.000 :: 1.000 0.000 -3.000 -DEAL::orientation: 1 flip: 0 rotation: 1 -DEAL:: -DEAL::face 1 :: 1.000 0.000 3.000 :: 1.000 1.000 3.000 :: 0.000 0.000 3.000 :: 0.000 1.000 3.000 -DEAL::face 2 :: 0.000 0.000 -3.000 :: 1.000 0.000 -3.000 :: 0.000 1.000 -3.000 :: 1.000 1.000 -3.000 -DEAL::orientation: 1 flip: 0 rotation: 1 -DEAL:: -DEAL::face 1 :: 0.000 -1.000 3.000 :: 0.000 0.000 3.000 :: -1.000 -1.000 3.000 :: -1.000 0.000 3.000 -DEAL::face 2 :: -1.000 -1.000 -3.000 :: 0.000 -1.000 -3.000 :: -1.000 0.000 -3.000 :: 0.000 0.000 -3.000 -DEAL::orientation: 1 flip: 0 rotation: 1 -DEAL:: -DEAL::face 1 :: 0.000 0.000 3.000 :: 0.000 1.000 3.000 :: -1.000 0.000 3.000 :: -1.000 1.000 3.000 -DEAL::face 2 :: -1.000 0.000 -3.000 :: 0.000 0.000 -3.000 :: -1.000 1.000 -3.000 :: 0.000 1.000 -3.000 -DEAL::orientation: 1 flip: 0 rotation: 1 -DEAL:: DEAL::Triangulation: 2 DEAL::Coarse match: 1 DEAL::face 1 :: 1.000 1.000 3.000 :: -1.000 1.000 3.000 :: 1.000 -1.000 3.000 :: -1.000 -1.000 3.000 DEAL::face 2 :: -1.000 -1.000 -3.000 :: 1.000 -1.000 -3.000 :: -1.000 1.000 -3.000 :: 1.000 1.000 -3.000 DEAL::orientation: 1 flip: 1 rotation: 0 DEAL:: -DEAL::Fine match: 4 -DEAL::face 1 :: 1.000 1.000 3.000 :: 0.000 1.000 3.000 :: 1.000 0.000 3.000 :: 0.000 0.000 3.000 -DEAL::face 2 :: 0.000 0.000 -3.000 :: 1.000 0.000 -3.000 :: 0.000 1.000 -3.000 :: 1.000 1.000 -3.000 -DEAL::orientation: 1 flip: 1 rotation: 0 -DEAL:: -DEAL::face 1 :: 0.000 1.000 3.000 :: -1.000 1.000 3.000 :: 0.000 0.000 3.000 :: -1.000 0.000 3.000 -DEAL::face 2 :: -1.000 0.000 -3.000 :: 0.000 0.000 -3.000 :: -1.000 1.000 -3.000 :: 0.000 1.000 -3.000 -DEAL::orientation: 1 flip: 1 rotation: 0 -DEAL:: -DEAL::face 1 :: 1.000 0.000 3.000 :: 0.000 0.000 3.000 :: 1.000 -1.000 3.000 :: 0.000 -1.000 3.000 -DEAL::face 2 :: 0.000 -1.000 -3.000 :: 1.000 -1.000 -3.000 :: 0.000 0.000 -3.000 :: 1.000 0.000 -3.000 -DEAL::orientation: 1 flip: 1 rotation: 0 -DEAL:: -DEAL::face 1 :: 0.000 0.000 3.000 :: -1.000 0.000 3.000 :: 0.000 -1.000 3.000 :: -1.000 -1.000 3.000 -DEAL::face 2 :: -1.000 -1.000 -3.000 :: 0.000 -1.000 -3.000 :: -1.000 0.000 -3.000 :: 0.000 0.000 -3.000 -DEAL::orientation: 1 flip: 1 rotation: 0 -DEAL:: DEAL::Triangulation: 3 DEAL::Coarse match: 1 DEAL::face 1 :: -1.000 1.000 3.000 :: -1.000 -1.000 3.000 :: 1.000 1.000 3.000 :: 1.000 -1.000 3.000 DEAL::face 2 :: -1.000 -1.000 -3.000 :: 1.000 -1.000 -3.000 :: -1.000 1.000 -3.000 :: 1.000 1.000 -3.000 DEAL::orientation: 1 flip: 1 rotation: 1 DEAL:: -DEAL::Fine match: 4 -DEAL::face 1 :: -1.000 1.000 3.000 :: -1.000 0.000 3.000 :: 0.000 1.000 3.000 :: 0.000 0.000 3.000 -DEAL::face 2 :: -1.000 0.000 -3.000 :: 0.000 0.000 -3.000 :: -1.000 1.000 -3.000 :: 0.000 1.000 -3.000 -DEAL::orientation: 1 flip: 1 rotation: 1 -DEAL:: -DEAL::face 1 :: -1.000 0.000 3.000 :: -1.000 -1.000 3.000 :: 0.000 0.000 3.000 :: 0.000 -1.000 3.000 -DEAL::face 2 :: -1.000 -1.000 -3.000 :: 0.000 -1.000 -3.000 :: -1.000 0.000 -3.000 :: 0.000 0.000 -3.000 -DEAL::orientation: 1 flip: 1 rotation: 1 -DEAL:: -DEAL::face 1 :: 0.000 1.000 3.000 :: 0.000 0.000 3.000 :: 1.000 1.000 3.000 :: 1.000 0.000 3.000 -DEAL::face 2 :: 0.000 0.000 -3.000 :: 1.000 0.000 -3.000 :: 0.000 1.000 -3.000 :: 1.000 1.000 -3.000 -DEAL::orientation: 1 flip: 1 rotation: 1 -DEAL:: -DEAL::face 1 :: 0.000 0.000 3.000 :: 0.000 -1.000 3.000 :: 1.000 0.000 3.000 :: 1.000 -1.000 3.000 -DEAL::face 2 :: 0.000 -1.000 -3.000 :: 1.000 -1.000 -3.000 :: 0.000 0.000 -3.000 :: 1.000 0.000 -3.000 -DEAL::orientation: 1 flip: 1 rotation: 1 -DEAL:: DEAL::Triangulation: 4 DEAL::Coarse match: 1 DEAL::face 1 :: 1.000 -1.000 3.000 :: -1.000 -1.000 3.000 :: 1.000 1.000 3.000 :: -1.000 1.000 3.000 DEAL::face 2 :: -1.000 -1.000 -3.000 :: 1.000 -1.000 -3.000 :: -1.000 1.000 -3.000 :: 1.000 1.000 -3.000 DEAL::orientation: 0 flip: 1 rotation: 1 DEAL:: -DEAL::Fine match: 4 -DEAL::face 1 :: 1.000 -1.000 3.000 :: 0.000 -1.000 3.000 :: 1.000 0.000 3.000 :: 0.000 0.000 3.000 -DEAL::face 2 :: 0.000 -1.000 -3.000 :: 1.000 -1.000 -3.000 :: 0.000 0.000 -3.000 :: 1.000 0.000 -3.000 -DEAL::orientation: 0 flip: 1 rotation: 1 -DEAL:: -DEAL::face 1 :: 0.000 -1.000 3.000 :: -1.000 -1.000 3.000 :: 0.000 0.000 3.000 :: -1.000 0.000 3.000 -DEAL::face 2 :: -1.000 -1.000 -3.000 :: 0.000 -1.000 -3.000 :: -1.000 0.000 -3.000 :: 0.000 0.000 -3.000 -DEAL::orientation: 0 flip: 1 rotation: 1 -DEAL:: -DEAL::face 1 :: 1.000 0.000 3.000 :: 0.000 0.000 3.000 :: 1.000 1.000 3.000 :: 0.000 1.000 3.000 -DEAL::face 2 :: 0.000 0.000 -3.000 :: 1.000 0.000 -3.000 :: 0.000 1.000 -3.000 :: 1.000 1.000 -3.000 -DEAL::orientation: 0 flip: 1 rotation: 1 -DEAL:: -DEAL::face 1 :: 0.000 0.000 3.000 :: -1.000 0.000 3.000 :: 0.000 1.000 3.000 :: -1.000 1.000 3.000 -DEAL::face 2 :: -1.000 0.000 -3.000 :: 0.000 0.000 -3.000 :: -1.000 1.000 -3.000 :: 0.000 1.000 -3.000 -DEAL::orientation: 0 flip: 1 rotation: 1 -DEAL:: DEAL::Triangulation: 5 DEAL::Coarse match: 1 DEAL::face 1 :: -1.000 -1.000 3.000 :: -1.000 1.000 3.000 :: 1.000 -1.000 3.000 :: 1.000 1.000 3.000 DEAL::face 2 :: -1.000 -1.000 -3.000 :: 1.000 -1.000 -3.000 :: -1.000 1.000 -3.000 :: 1.000 1.000 -3.000 DEAL::orientation: 0 flip: 0 rotation: 0 DEAL:: -DEAL::Fine match: 4 -DEAL::face 1 :: -1.000 -1.000 3.000 :: -1.000 0.000 3.000 :: 0.000 -1.000 3.000 :: 0.000 0.000 3.000 -DEAL::face 2 :: -1.000 -1.000 -3.000 :: 0.000 -1.000 -3.000 :: -1.000 0.000 -3.000 :: 0.000 0.000 -3.000 -DEAL::orientation: 0 flip: 0 rotation: 0 -DEAL:: -DEAL::face 1 :: -1.000 0.000 3.000 :: -1.000 1.000 3.000 :: 0.000 0.000 3.000 :: 0.000 1.000 3.000 -DEAL::face 2 :: -1.000 0.000 -3.000 :: 0.000 0.000 -3.000 :: -1.000 1.000 -3.000 :: 0.000 1.000 -3.000 -DEAL::orientation: 0 flip: 0 rotation: 0 -DEAL:: -DEAL::face 1 :: 0.000 -1.000 3.000 :: 0.000 0.000 3.000 :: 1.000 -1.000 3.000 :: 1.000 0.000 3.000 -DEAL::face 2 :: 0.000 -1.000 -3.000 :: 1.000 -1.000 -3.000 :: 0.000 0.000 -3.000 :: 1.000 0.000 -3.000 -DEAL::orientation: 0 flip: 0 rotation: 0 -DEAL:: -DEAL::face 1 :: 0.000 0.000 3.000 :: 0.000 1.000 3.000 :: 1.000 0.000 3.000 :: 1.000 1.000 3.000 -DEAL::face 2 :: 0.000 0.000 -3.000 :: 1.000 0.000 -3.000 :: 0.000 1.000 -3.000 :: 1.000 1.000 -3.000 -DEAL::orientation: 0 flip: 0 rotation: 0 -DEAL:: DEAL::Triangulation: 6 DEAL::Coarse match: 1 DEAL::face 1 :: -1.000 1.000 3.000 :: 1.000 1.000 3.000 :: -1.000 -1.000 3.000 :: 1.000 -1.000 3.000 DEAL::face 2 :: -1.000 -1.000 -3.000 :: 1.000 -1.000 -3.000 :: -1.000 1.000 -3.000 :: 1.000 1.000 -3.000 DEAL::orientation: 0 flip: 0 rotation: 1 DEAL:: -DEAL::Fine match: 4 -DEAL::face 1 :: -1.000 1.000 3.000 :: 0.000 1.000 3.000 :: -1.000 0.000 3.000 :: 0.000 0.000 3.000 -DEAL::face 2 :: -1.000 0.000 -3.000 :: 0.000 0.000 -3.000 :: -1.000 1.000 -3.000 :: 0.000 1.000 -3.000 -DEAL::orientation: 0 flip: 0 rotation: 1 -DEAL:: -DEAL::face 1 :: 0.000 1.000 3.000 :: 1.000 1.000 3.000 :: 0.000 0.000 3.000 :: 1.000 0.000 3.000 -DEAL::face 2 :: 0.000 0.000 -3.000 :: 1.000 0.000 -3.000 :: 0.000 1.000 -3.000 :: 1.000 1.000 -3.000 -DEAL::orientation: 0 flip: 0 rotation: 1 -DEAL:: -DEAL::face 1 :: -1.000 0.000 3.000 :: 0.000 0.000 3.000 :: -1.000 -1.000 3.000 :: 0.000 -1.000 3.000 -DEAL::face 2 :: -1.000 -1.000 -3.000 :: 0.000 -1.000 -3.000 :: -1.000 0.000 -3.000 :: 0.000 0.000 -3.000 -DEAL::orientation: 0 flip: 0 rotation: 1 -DEAL:: -DEAL::face 1 :: 0.000 0.000 3.000 :: 1.000 0.000 3.000 :: 0.000 -1.000 3.000 :: 1.000 -1.000 3.000 -DEAL::face 2 :: 0.000 -1.000 -3.000 :: 1.000 -1.000 -3.000 :: 0.000 0.000 -3.000 :: 1.000 0.000 -3.000 -DEAL::orientation: 0 flip: 0 rotation: 1 -DEAL:: DEAL::Triangulation: 7 DEAL::Coarse match: 1 DEAL::face 1 :: 1.000 1.000 3.000 :: 1.000 -1.000 3.000 :: -1.000 1.000 3.000 :: -1.000 -1.000 3.000 DEAL::face 2 :: -1.000 -1.000 -3.000 :: 1.000 -1.000 -3.000 :: -1.000 1.000 -3.000 :: 1.000 1.000 -3.000 DEAL::orientation: 0 flip: 1 rotation: 0 DEAL:: -DEAL::Fine match: 4 -DEAL::face 1 :: 1.000 1.000 3.000 :: 1.000 0.000 3.000 :: 0.000 1.000 3.000 :: 0.000 0.000 3.000 -DEAL::face 2 :: 0.000 0.000 -3.000 :: 1.000 0.000 -3.000 :: 0.000 1.000 -3.000 :: 1.000 1.000 -3.000 -DEAL::orientation: 0 flip: 1 rotation: 0 -DEAL:: -DEAL::face 1 :: 1.000 0.000 3.000 :: 1.000 -1.000 3.000 :: 0.000 0.000 3.000 :: 0.000 -1.000 3.000 -DEAL::face 2 :: 0.000 -1.000 -3.000 :: 1.000 -1.000 -3.000 :: 0.000 0.000 -3.000 :: 1.000 0.000 -3.000 -DEAL::orientation: 0 flip: 1 rotation: 0 -DEAL:: -DEAL::face 1 :: 0.000 1.000 3.000 :: 0.000 0.000 3.000 :: -1.000 1.000 3.000 :: -1.000 0.000 3.000 -DEAL::face 2 :: -1.000 0.000 -3.000 :: 0.000 0.000 -3.000 :: -1.000 1.000 -3.000 :: 0.000 1.000 -3.000 -DEAL::orientation: 0 flip: 1 rotation: 0 -DEAL:: -DEAL::face 1 :: 0.000 0.000 3.000 :: 0.000 -1.000 3.000 :: -1.000 0.000 3.000 :: -1.000 -1.000 3.000 -DEAL::face 2 :: -1.000 -1.000 -3.000 :: 0.000 -1.000 -3.000 :: -1.000 0.000 -3.000 :: 0.000 0.000 -3.000 -DEAL::orientation: 0 flip: 1 rotation: 0 -DEAL:: -- 2.39.5