* triangulation.
*/
typename dealii::internal::p4est::types<dim>::forest *parallel_forest;
+
/**
* A data structure that holds some information about the ghost cells of
* the triangulation.
*/
typename dealii::internal::p4est::types<dim>::ghost *parallel_ghost;
- /**
- * A flag that indicates whether refinement of a triangulation is
- * currently in progress. This flag is used to disambiguate whether a
- * call to execute_coarsening_and_triangulation came from the outside or
- * through a recursive call. While the first time we want to take over
- * work to copy things from a refined p4est, the other times we don't
- * want to get in the way as these latter calls to
- * Triangulation::execute_coarsening_and_refinement() are simply there
- * in order to re-create a triangulation that matches the p4est.
- */
- bool refinement_in_progress;
-
-
/**
* number of bytes that get attached to the Triangulation through
* register_data_attach() for example SolutionTransfer.
triangulation_has_content (false),
connectivity (nullptr),
parallel_forest (nullptr),
- refinement_in_progress (false),
attached_data_size(0),
n_attached_datas(0),
n_attached_deserialize(0)
ExcInternalError());
Assert (connectivity == nullptr, ExcInternalError());
Assert (parallel_forest == nullptr, ExcInternalError());
- Assert (refinement_in_progress == false, ExcInternalError());
}
}
this->prepare_coarsening_and_refinement();
- const bool saved_refinement_in_progress = refinement_in_progress;
- refinement_in_progress = true;
-
try
{
dealii::Triangulation<dim,spacedim>::execute_coarsening_and_refinement();
// distorted cells
Assert (false, ExcInternalError());
}
-
- refinement_in_progress = saved_refinement_in_progress;
}
break;
}
- // actually do the refinement but prevent the refinement hook below
- // from taking over
- const bool saved_refinement_in_progress = refinement_in_progress;
- refinement_in_progress = true;
-
+ // actually do the refinement to change the local mesh by
+ // calling the base class refinement function directly
try
{
dealii::Triangulation<dim,spacedim>::execute_coarsening_and_refinement();
// distorted cells
Assert (false, ExcInternalError());
}
-
- refinement_in_progress = saved_refinement_in_progress;
}
while (mesh_changed);
void
Triangulation<dim, spacedim>::execute_coarsening_and_refinement ()
{
- // first make sure that recursive calls are handled correctly
- Assert (refinement_in_progress == false, ExcInternalError());
-
// do not allow anisotropic refinement
#ifdef DEBUG
for (typename Triangulation<dim,spacedim>::active_cell_iterator
}
// now do the work we're supposed to do when we are in charge
- refinement_in_progress = true;
this->prepare_coarsening_and_refinement ();
// make sure all flags are cleared on cells we don't own, since nothing
}
#endif
- refinement_in_progress = false;
this->update_number_cache ();
this->update_periodic_face_map();
}
ExcMessage ("Error: There shouldn't be any cells flagged for coarsening/refinement when calling repartition()."));
#endif
- refinement_in_progress = true;
-
// before repartitioning the mesh let others attach mesh related info
// (such as SolutionTransfer data) to the p4est
attach_mesh_data();
Assert (false, ExcInternalError());
}
- refinement_in_progress = false;
-
// update how many cells, edges, etc, we store locally
this->update_number_cache ();
this->update_periodic_face_map();
+ MemoryConsumption::memory_consumption(triangulation_has_content)
+ MemoryConsumption::memory_consumption(connectivity)
+ MemoryConsumption::memory_consumption(parallel_forest)
- + MemoryConsumption::memory_consumption(refinement_in_progress)
+ MemoryConsumption::memory_consumption(attached_data_size)
+ MemoryConsumption::memory_consumption(n_attached_datas)
// + MemoryConsumption::memory_consumption(attached_data_pack_callbacks) //TODO[TH]: how?
if (const dealii::parallel::distributed::Triangulation<dim,spacedim> *
other_tria_x = dynamic_cast<const dealii::parallel::distributed::Triangulation<dim,spacedim> *>(&other_tria))
{
- Assert (!other_tria_x->refinement_in_progress,
- ExcMessage ("Parallel distributed triangulations can only "
- "be copied, if no refinement is in progress!"));
-
coarse_cell_to_p4est_tree_permutation = other_tria_x->coarse_cell_to_p4est_tree_permutation;
p4est_tree_to_coarse_cell_permutation = other_tria_x->p4est_tree_to_coarse_cell_permutation;
attached_data_size = other_tria_x->attached_data_size;