From: Martin Kronbichler Date: Mon, 30 Mar 2020 17:13:08 +0000 (+0200) Subject: Make sure periodicity is set before constructing hierarchy X-Git-Tag: v9.2.0-rc1~322^2~2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2f988601a3d38c052aa35c6c3f94a88416b7705d;p=dealii.git Make sure periodicity is set before constructing hierarchy --- 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(); }