From: Lei Qiao Date: Tue, 13 Oct 2015 00:19:45 +0000 (-0500) Subject: add signal pre_coarsening_on_cell to Triangulation. X-Git-Tag: v8.4.0-rc2~285^2~9 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4ed6457454dc867969c63ad18bd57b4d78f6d769;p=dealii.git add signal pre_coarsening_on_cell to Triangulation. --- diff --git a/include/deal.II/grid/tria.h b/include/deal.II/grid/tria.h index a4dfba2c24..52a81a6a9a 100644 --- a/include/deal.II/grid/tria.h +++ b/include/deal.II/grid/tria.h @@ -1921,6 +1921,13 @@ public: boost::signals2::signal create; boost::signals2::signal pre_refinement; boost::signals2::signal post_refinement; + /** + * @note the signal parameter @p cell is correspond to the new active cell + * after coarsening is done rather than a current active cell. + * In another word, all children of @p cell will be deleted after coarsening + * and @p cell will become the new active cell then. + */ + boost::signals2::signal::cell_iterator &cell)> pre_coarsening_on_cell; boost::signals2::signal::cell_iterator &cell)> post_refinement_on_cell; boost::signals2::signal &original_tria)> copy; boost::signals2::signal clear; diff --git a/source/grid/tria.cc b/source/grid/tria.cc index a68cf0a8ff..be2f5b234e 100644 --- a/source/grid/tria.cc +++ b/source/grid/tria.cc @@ -11669,11 +11669,15 @@ void Triangulation::execute_coarsening () if (levels.size() >= 2) for (cell = last(); cell!=endc; --cell) if (cell->level()<=static_cast(levels.size()-2) && cell->user_flag_set()) - // use a separate function, - // since this is dimension - // specific - internal::Triangulation::Implementation - ::delete_children (*this, cell, line_cell_count, quad_cell_count); + { + // inform all listeners that cell coarsening is going to happen + signals.pre_coarsening_on_cell(cell); + // use a separate function, + // since this is dimension + // specific + internal::Triangulation::Implementation + ::delete_children (*this, cell, line_cell_count, quad_cell_count); + } // re-compute number of lines and // quads