From 2f988601a3d38c052aa35c6c3f94a88416b7705d Mon Sep 17 00:00:00 2001 From: Martin Kronbichler Date: Mon, 30 Mar 2020 19:13:08 +0200 Subject: [PATCH] Make sure periodicity is set before constructing hierarchy --- source/distributed/tria.cc | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/source/distributed/tria.cc b/source/distributed/tria.cc index 6e6ee051f3..8aa5670873 100644 --- a/source/distributed/tria.cc +++ b/source/distributed/tria.cc @@ -4516,7 +4516,7 @@ namespace parallel // to connect to a vertex that is 'dim' hops away from the locally owned // cell. Depending on the order of the periodic face map, we might // connect to that point by chance or miss it. However, after looping - // through all the periodict directions (which are at most as many as + // through all the periodic directions (which are at most as many as // the number of space dimensions) we can be sure that all connections // to vertices have been created. for (unsigned int repetition = 0; repetition < dim; ++repetition) @@ -4592,6 +4592,11 @@ namespace parallel Assert(this->n_levels() == 1, ExcMessage("The triangulation is refined!")); + // call the base class for storing the periodicity information; we must + // do this before going to p4est and rebuilding the triangulation to get + // the level subdomain ids correct in the multigrid case + dealii::Triangulation::add_periodicity(periodicity_vector); + for (const auto &face_pair : periodicity_vector) { const cell_iterator first_cell = face_pair.cell[0]; @@ -4721,7 +4726,6 @@ namespace parallel /* user_data_constructor = */ nullptr, /* user_pointer */ this); - try { copy_local_forest_to_triangulation(); @@ -4733,9 +4737,6 @@ namespace parallel Assert(false, ExcInternalError()); } - // finally call the base class for storing the periodicity information - dealii::Triangulation::add_periodicity(periodicity_vector); - // The range of ghost_owners might have changed so update that information this->update_number_cache(); } -- 2.39.5