* cells. This issue is discussed extensively in
* @ref GlossDistorted "distorted cells".
*
- *
+ *
* <h3>Getting notice when a triangulation changes</h3>
- *
+ *
* There are cases where one object would like to know whenever a triangulation
* is being refined, copied, or modified in a number of other ways. This
* could of course be achieved if, in your user code, you tell every
* such object whenever you are about to refine the triangulation, but this
* will get tedious and is error prone. The Triangulation class implements
* a more elegant way to achieve this: signals.
- *
+ *
* In essence, a signal is an object (a member of the Triangulation class)
- * that another object can connect to. A connection is in essence that
+ * that another object can connect to. A connection is in essence that
* the connecting object passes a function object taking a certain number
* and kind of arguments. Whenever the owner of the signal wants to
* indicate a certain kind of event, it 'triggers' the signal, which in
* turn means that all connections of the signal are triggered: in other
* word, the function objects are executed and can take the action that
* is necessary.
- *
+ *
* As a simple example, the following code will print something to the
* output every time the triangulation has just been refined:
* @code
* void f() {
* std::cout << "Triangulation has been refined." << std::endl;
* }
- *
+ *
* void f() {
* Triangulation<dim> triangulation;
* // fill it somehow
* triangulation.refine_global (2);
* @endcode
* This code will produce output twice, once for each refinement cycle.
- *
+ *
* A more interesting application would be the following, akin to what
* the FEValues class does. This class stores a pointer to a triangulation
* and also an iterator to the cell last handled (so that it can compare
* there is no need to re-compute the Jacobian matrix if the new cell
* is a simple translation of the previous one). However, whenever the
* triangulation is modified, the iterator to the previously handled
- * cell needs to be invalidated since it now no longer points to any
+ * cell needs to be invalidated since it now no longer points to any
* useful cell (or, at the very least, points to something that may not
* necessarily resemble the cells previously handled). The code would
* look something like this (the real code has some more error checking
* void reinit (Triangulation<dim>::active_cell_iterator &cell);
* void invalidate_previous_cell ();
* };
- *
+ *
* template <int dim>
- * void
+ * void
* FEValues<dim>::reinit (Triangulation<dim>::active_cell_iterator &cell) {
* if (previous_cell.status() != valid)
* {
* }
* else
* previous_cell = current_cell;
- *
+ *
* current_cell = cell;
* ... do something with the cell...
* }
*
- *
+ *
* template <int dim>
- * void
+ * void
* FEValues<dim>::invalidate_previous_cell () {
* previous_cell = Triangulation<dim>::active_cell_iterator();
* }
* a member function that otherwise takes no arguments) to the <code>this</code>
* pointer of the FEValues object. Note how here there is no need for the code
* that owns the triangulation and the FEValues object to inform the latter if
- * the former is refined. (In practice, the function would want to connect to
+ * the former is refined. (In practice, the function would want to connect to
* some of the other signals that the triangulation offers as well, in particular
* to creation and deletion signals.)
*
* is called
* - pre-refinement: This signal is triggered at the beginning
* of execution of the Triangulation::execute_coarsening_and_refinement
- * function (which is itself called by other functions such as
+ * function (which is itself called by other functions such as
* Triangulation::refine_global). At the time this signal is triggered,
* the triangulation is still unchanged.
* - post-refinement: This signal is triggered at the end
* the signal is copied by another triangulation using
* Triangulation::copy_triangulation (i.e. it is triggered on the <i>old</i>
* triangulation, but the new one is passed as a argument).
- * - clear: This signal is triggered whenever the Trianagultion::clear
+ * - clear: This signal is triggered whenever the Triangulation::clear
* function is called.
* - any_change: This is a catch-all signal that is triggered whenever the
* create, post_refinement, or clear signals are triggered. In effect, it
* can be used to indicate to an object connected to the signal that the
* triangulation has been changed, whatever the exact cause of the change.
- *
- *
+ *
+ *
* <h3>Technical details</h3>
*
* <h4>Algorithms for mesh regularization and smoothing upon refinement</h4>
maximum_smoothing = 0xffff ^ allow_anisotropic_smoothing
};
-
+
typedef typename IteratorSelector::CellAccessor cell_accessor;
typedef typename IteratorSelector::FaceAccessor face_accessor;
* Triangulation,
* can be derived from
* RefinementListener.
- *
+ *
* @note The use of this class has been
* superceded by the signals mechanism.
* See the general documentation of the
* Triangulation class for more information.
- *
+ *
* @deprecated
*/
class RefinementListener
* Destructor. Does nothing, but is
* declared virtual because this
* class also has virtual functions.
- *
+ *
* @note The use of this class has been
* superceded by the signals mechanism.
* See the general documentation of the
* Triangulation class for more information.
- *
+ *
* @deprecated
*/
virtual ~RefinementListener ();
* calls this method on all objects
* derived from this class and
* registered with the triangulation.
- *
+ *
* @note The use of this class has been
* superceded by the signals mechanism.
* See the general documentation of the
* Triangulation class for more information.
- *
+ *
* @deprecated
*/
virtual
* calls this method on all objects
* derived from this class and
* registered with the triangulation.
- *
+ *
* @note The use of this class has been
* superceded by the signals mechanism.
* See the general documentation of the
* Triangulation class for more information.
- *
+ *
* @deprecated
*/
virtual
* method does nothing, a different
* behavior has to be implemented in
* derived classes.
- *
+ *
* @note The use of this class has been
* superceded by the signals mechanism.
* See the general documentation of the
* Triangulation class for more information.
- *
+ *
* @deprecated
*/
virtual
* default this method does nothing,
* a different behavior has to be
* implemented in derived classes.
- *
+ *
* @note The use of this class has been
* superceded by the signals mechanism.
* See the general documentation of the
* Triangulation class for more information.
- *
+ *
* @deprecated
*/
virtual
* functionality of this
* function.
*
- * @note Calling this function triggers
+ * @note Calling this function triggers
* the 'copy' signal on old_tria, i.e.
* the triangulation being copied <i>from</i>.
* It also triggers the 'create' signal of
* the current triangulation.
* See the section on signals in the
* general documentation for more information.
- *
+ *
* @note The list of connections to
- * signals is not copied from the old
+ * signals is not copied from the old
* to the new triangulation since
* these connections were established
* to monitor how the old triangulation
*
* @note This function is used in step-14 .
*
- * @note This function triggers the create
+ * @note This function triggers the create
* signal after doing its work. See the
* section on signals in the general
* documentation of this class.
* actual number of refinement steps in
* that case.
*
- * @note This function triggers the pre-
- * and post-refinement signals before
- * and after doing each individual refinement
+ * @note This function triggers the pre-
+ * and post-refinement signals before
+ * and after doing each individual refinement
* cycle (i.e. more than once if
* times > 1) . See the
* section on signals in the general
* See the general docs for more
* information.
*
- * @note This function triggers the pre-
- * and post-refinement signals before
+ * @note This function triggers the pre-
+ * and post-refinement signals before
* and after doing its work. See the
* section on signals in the general
* documentation of this class.
- *
+ *
* @note If the boundary description is
* sufficiently irregular, it can
* happen that some of the
*/
bool prepare_coarsening_and_refinement ();
/** @} */
-
+
/**
* @name Keeping up with what happens to a triangulation
*/
* Triangulation allows other
* classes to be informed when
* the Triangulation is refined.
- *
+ *
* @note The use of this function has been
* superceded by the signals mechanism.
* See the general documentation of the
* Triangulation class for more information.
- *
+ *
* @deprecated
*/
void add_refinement_listener (RefinementListener &listener) const;
-
+
/**
* Remove a
* RefinementListener. When some
* the listener should be
* removed from the
* Triangulation.
- *
+ *
* @note The use of this function has been
* superceded by the signals mechanism.
* See the general documentation of the
* Triangulation class for more information.
- *
+ *
* @deprecated
*/
void remove_refinement_listener (RefinementListener &listener) const;
/**
- * A structure that has boost::signal objects for a number of actions that a
+ * A structure that has boost::signal objects for a number of actions that a
* triangulation can do to itself. See the general documentation of the
* Triangulation class for more information and for documentation of
* the semantics of the member functions.
- *
+ *
* For documentation on signals, see http://www.boost.org/doc/libs/release/libs/signals2 .
**/
- struct Signals
+ struct Signals
{
boost::signals2::signal<void ()> create;
boost::signals2::signal<void ()> pre_refinement;
boost::signals2::signal<void ()> clear;
boost::signals2::signal<void ()> any_change;
};
-
+
/**
* Signals for the various actions that a triangulation can do to itself.
*/
- mutable Signals signals;
+ mutable Signals signals;
/*@}*/
* through the outdated RefinementListener interface via
* add_refinement_listener(), with the new-style boost::signal
* connections for each of the member function. We need to keep this
- * list around so that we can later terminate the connection again
+ * list around so that we can later terminate the connection again
* when someone calls remove_refinement_listener().
- *
- * The data type is a multimap since, although this would be weird,
+ *
+ * The data type is a multimap since, although this would be weird,
* the same object may add itself multiple times as a listener.
*/
mutable
- std::multimap<const RefinementListener*, std::vector<boost::signals2::connection> >
+ std::multimap<const RefinementListener*, std::vector<boost::signals2::connection> >
refinement_listener_map;
-
+
// make a couple of classes
// friends
template <int,int,int> friend class TriaAccessorBase;