/**
* A signal connection we use to ensure we get informed whenever the
- * triangulation changes. We need to know about that because it invalidates
- * all cell iterators and, as part of that, the 'present_cell' iterator we
- * keep around between subsequent calls to reinit() in order to compute the
- * cell similarity.
+ * triangulation changes by refinement. We need to know about that because
+ * it invalidates all cell iterators and, as part of that, the
+ * 'present_cell' iterator we keep around between subsequent calls to
+ * reinit() in order to compute the cell similarity.
*/
- boost::signals2::connection tria_listener;
+ boost::signals2::connection tria_listener_refinement;
+
+ /**
+ * A signal connection we use to ensure we get informed whenever the
+ * triangulation changes by mesh transformations. We need to know about that
+ * because it invalidates all cell iterators and, as part of that, the
+ * 'present_cell' iterator we keep around between subsequent calls to
+ * reinit() in order to compute the cell similarity.
+ */
+ boost::signals2::connection tria_listener_mesh_transform;
/**
* A function that is connected to the triangulation in order to reset the
template <int dim, int spacedim>
FEValuesBase<dim,spacedim>::~FEValuesBase ()
{
- tria_listener.disconnect ();
+ tria_listener_refinement.disconnect ();
+ tria_listener_mesh_transform.disconnect ();
}
// so delete the present cell and
// disconnect from the signal we have with
// it
- tria_listener.disconnect ();
+ tria_listener_refinement.disconnect ();
+ tria_listener_mesh_transform.disconnect ();
present_cell.reset ();
}
// connect to the current one; also invalidate the previous
// cell because we shouldn't be comparing cells from different
// triangulations
- tria_listener.disconnect ();
invalidate_present_cell();
- tria_listener =
+ tria_listener_refinement =
cell->get_triangulation().signals.any_change.connect
(std_cxx11::bind (&FEValuesBase<dim,spacedim>::invalidate_present_cell,
std_cxx11::ref(static_cast<FEValuesBase<dim,spacedim>&>(*this))));
+ tria_listener_mesh_transform =
+ 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))));
}
}
else
// 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
+ tria_listener_refinement =
+ cell->get_triangulation().signals.post_refinement.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
+ tria_listener_mesh_transform =
+ 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))));
}