]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Add additional listener to grid movement 4050/head
authorMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Wed, 8 Mar 2017 10:10:16 +0000 (11:10 +0100)
committerMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Wed, 8 Mar 2017 10:10:16 +0000 (11:10 +0100)
include/deal.II/grid/grid_tools.h
include/deal.II/grid/tria.h
source/fe/fe_values.cc
source/grid/tria.cc

index 7b1f2e9369961b0fe1d16e1c46696ca9b47c908e..fb8341a64428f7e7dd95f9da43760a274e483b9c 100644 (file)
@@ -1729,7 +1729,7 @@ namespace GridTools
       }
 
     // Make sure FEValues notices that the mesh has changed
-    triangulation.signals.post_refinement();
+    triangulation.signals.mesh_movement();
   }
 
 
index b1380ae512d15009b866ce85264aed163b1e6ba1..c1ddaf57646098fa23bd9d7f57875a291d8d5e01 100644 (file)
@@ -2090,6 +2090,15 @@ public:
      */
     boost::signals2::signal<void ()> post_refinement;
 
+    /**
+     * This signal is triggered when a function in deal.II moves the grid
+     * points of a mesh, e.g. GridTools::transform. Unfortunately,
+     * modification of a vertex in user code through
+     * <code>cell_iterator->vertex(v) = xxxx</code> cannot be detected by this
+     * method.
+     */
+    boost::signals2::signal<void ()> mesh_movement;
+
     /**
      * This signal is triggered for each cell that is going to be coarsened.
      *
index 9736e93d305fbf6e08607f4f3dc87c93fcd7be53..f94e2cc1067934ca2feaefc96a228b9053689d55 100644 (file)
@@ -3492,6 +3492,10 @@ maybe_invalidate_previous_present_cell (const typename Triangulation<dim,spacedi
       // if this FEValues has never been set to any cell at all, then
       // at least subscribe to the triangulation to get notified of
       // changes
+      tria_listener =
+        cell->get_triangulation().signals.mesh_movement.connect
+        (std_cxx11::bind (&FEValuesBase<dim,spacedim>::invalidate_present_cell,
+                          std_cxx11::ref(static_cast<FEValuesBase<dim,spacedim>&>(*this))));
       tria_listener =
         cell->get_triangulation().signals.post_refinement.connect
         (std_cxx11::bind (&FEValuesBase<dim,spacedim>::invalidate_present_cell,
index 6a5ac441059410d84a6e51ba082e81450e5ba9be..a52cde1fd43f01a81d5ac832a4d38c885e811a43 100644 (file)
@@ -8968,6 +8968,7 @@ Triangulation (const MeshSmoothing smooth_grid,
   signals.create.connect (signals.any_change);
   signals.post_refinement.connect (signals.any_change);
   signals.clear.connect (signals.any_change);
+  signals.mesh_movement.connect (signals.any_change);
 }
 
 

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.