]> https://gitweb.dealii.org/ - dealii.git/commitdiff
add signal pre_coarsening_on_cell to Triangulation.
authorLei Qiao <qiaol618@gmail.com>
Tue, 13 Oct 2015 00:19:45 +0000 (19:19 -0500)
committerLei Qiao <qiaol618@gmail.com>
Thu, 22 Oct 2015 14:50:22 +0000 (09:50 -0500)
include/deal.II/grid/tria.h
source/grid/tria.cc

index a4dfba2c24a5a58da96597663dcd4d53a55689b5..52a81a6a9a2fdebef1d84a439d603983fba772af 100644 (file)
@@ -1921,6 +1921,13 @@ public:
     boost::signals2::signal<void ()> create;
     boost::signals2::signal<void ()> pre_refinement;
     boost::signals2::signal<void ()> 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<void (const Triangulation<dim, spacedim>::cell_iterator &cell)> pre_coarsening_on_cell;
     boost::signals2::signal<void (const Triangulation<dim, spacedim>::cell_iterator &cell)> post_refinement_on_cell;
     boost::signals2::signal<void (const Triangulation<dim, spacedim> &original_tria)> copy;
     boost::signals2::signal<void ()> clear;
index a68cf0a8ff1324d5ea19238b1c5e178259872479..be2f5b234e178131532bd0159165a6fa670afaa5 100644 (file)
@@ -11669,11 +11669,15 @@ void Triangulation<dim, spacedim>::execute_coarsening ()
   if (levels.size() >= 2)
     for (cell = last(); cell!=endc; --cell)
       if (cell->level()<=static_cast<int>(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

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.