From 5048593c7b6f42bbeaa89c278d7ae62606c3fec6 Mon Sep 17 00:00:00 2001 From: Matthias Maier Date: Tue, 1 Oct 2013 20:43:14 +0000 Subject: [PATCH] Port grid_tools_05.cc test to collect_periodic_faces git-svn-id: https://svn.dealii.org/branches/branch_port_the_testsuite@31061 0785d39b-7218-0410-832d-ea1e28bc413d --- tests/deal.II/grid_tools_05.cc | 53 +++------- tests/deal.II/grid_tools_05.output | 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 ea394d5038..6c439c47cc 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.output b/tests/deal.II/grid_tools_05.output index 36b7388a9c..9ac1c5e3ef 100644 --- a/tests/deal.II/grid_tools_05.output +++ b/tests/deal.II/grid_tools_05.output @@ -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