Skip to content

Commit

Permalink
Merge pull request dealii#13923 from kronbichler/simplify_distr_tria
Browse files Browse the repository at this point in the history
Avoid saving and setting refinement flags in distributed Tria
  • Loading branch information
kronbichler committed Jun 17, 2022
2 parents 1e78116 + f241f0f commit 14c5d89
Showing 1 changed file with 6 additions and 13 deletions.
19 changes: 6 additions & 13 deletions source/distributed/tria.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2738,19 +2738,17 @@ namespace parallel
bool
Triangulation<dim, spacedim>::prepare_coarsening_and_refinement()
{
std::vector<bool> flags_before[2];
this->save_coarsen_flags(flags_before[0]);
this->save_refine_flags(flags_before[1]);

bool mesh_changed = false;
unsigned int loop_counter = 0;
unsigned int n_changes = 0;
do
{
this->dealii::Triangulation<dim, spacedim>::
prepare_coarsening_and_refinement();
n_changes += this->dealii::Triangulation<dim, spacedim>::
prepare_coarsening_and_refinement();
this->update_periodic_face_map();
// enforce 2:1 mesh balance over periodic boundaries
mesh_changed = enforce_mesh_balance_over_periodic_boundaries(*this);
n_changes += mesh_changed;

// We can't be sure that we won't run into a situation where we can
// not reconcile mesh smoothing and balancing of periodic faces. As
Expand All @@ -2766,13 +2764,8 @@ namespace parallel
}
while (mesh_changed);

// check if any of the refinement flags were changed during this
// function and return that value
std::vector<bool> flags_after[2];
this->save_coarsen_flags(flags_after[0]);
this->save_refine_flags(flags_after[1]);
return ((flags_before[0] != flags_after[0]) ||
(flags_before[1] != flags_after[1]));
// report if we observed changes in any of the sub-functions
return n_changes > 0;
}


Expand Down

0 comments on commit 14c5d89

Please sign in to comment.