--- /dev/null
+/* ---------------------------------------------------------------------
+ *
+ * Copyright (C) 2017 by the deal.II authors
+ *
+ * This file is part of the deal.II library.
+ *
+ * The deal.II library is free software; you can use it, redistribute
+ * it, and/or modify it under the terms of the GNU Lesser General
+ * Public License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ * The full text of the license can be found in the file LICENSE at
+ * the top level of the deal.II distribution.
+ *
+ * ---------------------------------------------------------------------
+ */
+
+
+// This testcase previously failed due to missing to update the NumberCache in
+// add_periodicity(). This resulted in ghost_owners to be wrong and not sending
+// all required messages in GridTools::exchange_cell_data_to_ghosts.
+
+#include <deal.II/distributed/tria.h>
+#include <deal.II/grid/grid_in.h>
+#include <deal.II/grid/grid_tools.h>
+#include "../tests.h"
+
+
+int main (int argc, char *argv[])
+{
+ Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv);
+ mpi_initlog();
+ const double L=7.6/2.0;
+ parallel::distributed::Triangulation<3> triangulation(MPI_COMM_WORLD);
+ GridIn<3> gridin;
+ gridin.attach_triangulation(triangulation);
+ std::ifstream f(SOURCE_DIR "/periodicity_05.inp");
+ gridin.read_ucd(f);
+
+ typename parallel::distributed::Triangulation<3>::active_cell_iterator cell = triangulation.begin_active(), endc = triangulation.end();
+ for (; cell!=endc; ++cell)
+ {
+ for (unsigned int f=0; f < GeometryInfo<3>::faces_per_cell; ++f)
+ {
+ const Point<3> face_center = cell->face(f)->center();
+ if (cell->face(f)->at_boundary())
+ {
+ if (std::abs(face_center[0]+(L))<1.0e-4)
+ cell->face(f)->set_boundary_id(1);
+ else if (std::abs(face_center[0]-(L))<1.0e-4)
+ cell->face(f)->set_boundary_id(2);
+ else if (std::abs(face_center[1]+(L))<1.0e-4)
+ cell->face(f)->set_boundary_id(3);
+ else if (std::abs(face_center[1]-(L))<1.0e-4)
+ cell->face(f)->set_boundary_id(4);
+ else if (std::abs(face_center[2]+(L))<1.0e-4)
+ cell->face(f)->set_boundary_id(5);
+ else if (std::abs(face_center[2]-(L))<1.0e-4)
+ cell->face(f)->set_boundary_id(6);
+ }
+ }
+ }
+
+ std::vector<GridTools::PeriodicFacePair<typename parallel::distributed::Triangulation<3>::cell_iterator> > periodicity_vector;
+ for (int i = 0; i < 3; ++i)
+ GridTools::collect_periodic_faces(triangulation, /*b_id1*/ 2*i+1, /*b_id2*/ 2*i+2,/*direction*/ i, periodicity_vector);
+ triangulation.add_periodicity(periodicity_vector);
+
+ FE_Q<3> fe(1);
+ DoFHandler<3> dof_handler(triangulation);
+ dof_handler.distribute_dofs(fe);
+ deallog << "OK" << std::endl;
+}
--- /dev/null
+125 64 0 0 0\r
+1 -3.8 3.8 -3.8\r
+2 -1.9 3.8 -3.8\r
+3 -1.9 3.8 -1.9\r
+4 -3.8 3.8 -1.9\r
+5 -3.8 1.9 -3.8\r
+6 -1.9 1.9 -3.8\r
+7 -1.9 1.9 -1.9\r
+8 -3.8 1.9 -1.9\r
+9 0 3.8 -3.8\r
+10 0 3.8 -1.9\r
+11 0 1.9 -3.8\r
+12 0 1.9 -1.9\r
+13 1.9 3.8 -3.8\r
+14 1.9 3.8 -1.9\r
+15 1.9 1.9 -3.8\r
+16 1.9 1.9 -1.9\r
+17 3.8 3.8 -3.8\r
+18 3.8 3.8 -1.9\r
+19 3.8 1.9 -3.8\r
+20 3.8 1.9 -1.9\r
+21 -1.9 3.8 0\r
+22 -3.8 3.8 0\r
+23 -1.9 1.9 0\r
+24 -3.8 1.9 0\r
+25 0 3.8 0\r
+26 0 1.9 0\r
+27 1.9 3.8 0\r
+28 1.9 1.9 0\r
+29 3.8 3.8 0\r
+30 3.8 1.9 0\r
+31 -1.9 3.8 1.9\r
+32 -3.8 3.8 1.9\r
+33 -1.9 1.9 1.9\r
+34 -3.8 1.9 1.9\r
+35 0 3.8 1.9\r
+36 0 1.9 1.9\r
+37 1.9 3.8 1.9\r
+38 1.9 1.9 1.9\r
+39 3.8 3.8 1.9\r
+40 3.8 1.9 1.9\r
+41 -1.9 3.8 3.8\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.9 -3.8 -1.9\r
+104 -3.8 -3.8 -1.9\r
+105 0 -3.8 -3.8\r
+106 0 -3.8 -1.9\r
+107 1.9 -3.8 -3.8\r
+108 1.9 -3.8 -1.9\r
+109 3.8 -3.8 -3.8\r
+110 3.8 -3.8 -1.9\r
+111 -1.9 -3.8 0\r
+112 -3.8 -3.8 0\r
+113 0 -3.8 0\r
+114 1.9 -3.8 0\r
+115 3.8 -3.8 0\r
+116 -1.9 -3.8 1.9\r
+117 -3.8 -3.8 1.9\r
+118 0 -3.8 1.9\r
+119 1.9 -3.8 1.9\r
+120 3.8 -3.8 1.9\r
+121 -1.9 -3.8 3.8\r
+122 -3.8 -3.8 3.8\r
+123 0 -3.8 3.8\r
+124 1.9 -3.8 3.8\r
+125 3.8 -3.8 3.8\r
+1 0 hex 1 4 3 2 5 8 7 6 \r
+2 0 hex 2 3 10 9 6 7 12 11 \r
+3 0 hex 9 10 14 13 11 12 16 15 \r
+4 0 hex 13 14 18 17 15 16 20 19 \r
+5 0 hex 4 22 21 3 8 24 23 7 \r
+6 0 hex 3 21 25 10 7 23 26 12 \r
+7 0 hex 10 25 27 14 12 26 28 16 \r
+8 0 hex 14 27 29 18 16 28 30 20 \r
+9 0 hex 22 32 31 21 24 34 33 23 \r
+10 0 hex 21 31 35 25 23 33 36 26 \r
+11 0 hex 25 35 37 27 26 36 38 28 \r
+12 0 hex 27 37 39 29 28 38 40 30 \r
+13 0 hex 32 42 41 31 34 44 43 33 \r
+14 0 hex 31 41 45 35 33 43 46 36 \r
+15 0 hex 35 45 47 37 36 46 48 38 \r
+16 0 hex 37 47 49 39 38 48 50 40 \r
+17 0 hex 5 8 7 6 51 54 53 52 \r
+18 0 hex 6 7 12 11 52 53 56 55 \r
+19 0 hex 11 12 16 15 55 56 58 57 \r
+20 0 hex 15 16 20 19 57 58 60 59 \r
+21 0 hex 8 24 23 7 54 62 61 53 \r
+22 0 hex 7 23 26 12 53 61 63 56 \r
+23 0 hex 12 26 28 16 56 63 64 58 \r
+24 0 hex 16 28 30 20 58 64 65 60 \r
+25 0 hex 24 34 33 23 62 67 66 61 \r
+26 0 hex 23 33 36 26 61 66 68 63 \r
+27 0 hex 26 36 38 28 63 68 69 64 \r
+28 0 hex 28 38 40 30 64 69 70 65 \r
+29 0 hex 34 44 43 33 67 72 71 66 \r
+30 0 hex 33 43 46 36 66 71 73 68 \r
+31 0 hex 36 46 48 38 68 73 74 69 \r
+32 0 hex 38 48 50 40 69 74 75 70 \r
+33 0 hex 51 54 53 52 76 79 78 77 \r
+34 0 hex 52 53 56 55 77 78 81 80 \r
+35 0 hex 55 56 58 57 80 81 83 82 \r
+36 0 hex 57 58 60 59 82 83 85 84 \r
+37 0 hex 54 62 61 53 79 87 86 78 \r
+38 0 hex 53 61 63 56 78 86 88 81 \r
+39 0 hex 56 63 64 58 81 88 89 83 \r
+40 0 hex 58 64 65 60 83 89 90 85 \r
+41 0 hex 62 67 66 61 87 92 91 86 \r
+42 0 hex 61 66 68 63 86 91 93 88 \r
+43 0 hex 63 68 69 64 88 93 94 89 \r
+44 0 hex 64 69 70 65 89 94 95 90 \r
+45 0 hex 67 72 71 66 92 97 96 91 \r
+46 0 hex 66 71 73 68 91 96 98 93 \r
+47 0 hex 68 73 74 69 93 98 99 94 \r
+48 0 hex 69 74 75 70 94 99 100 95 \r
+49 0 hex 76 79 78 77 101 104 103 102 \r
+50 0 hex 77 78 81 80 102 103 106 105 \r
+51 0 hex 80 81 83 82 105 106 108 107 \r
+52 0 hex 82 83 85 84 107 108 110 109 \r
+53 0 hex 79 87 86 78 104 112 111 103 \r
+54 0 hex 78 86 88 81 103 111 113 106 \r
+55 0 hex 81 88 89 83 106 113 114 108 \r
+56 0 hex 83 89 90 85 108 114 115 110 \r
+57 0 hex 87 92 91 86 112 117 116 111 \r
+58 0 hex 86 91 93 88 111 116 118 113 \r
+59 0 hex 88 93 94 89 113 118 119 114 \r
+60 0 hex 89 94 95 90 114 119 120 115 \r
+61 0 hex 92 97 96 91 117 122 121 116 \r
+62 0 hex 91 96 98 93 116 121 123 118 \r
+63 0 hex 93 98 99 94 118 123 124 119 \r
+64 0 hex 94 99 100 95 119 124 125 120 \r