From 8765e99d027c49f79631dded5e5360177ce163de Mon Sep 17 00:00:00 2001 From: wolf Date: Mon, 16 Aug 1999 11:26:39 +0000 Subject: [PATCH] Add some doc. git-svn-id: https://svn.dealii.org/trunk@1698 0785d39b-7218-0410-832d-ea1e28bc413d --- .../deal.II/include/grid/persistent_tria.h | 72 ++++++++++++++++++- 1 file changed, 71 insertions(+), 1 deletion(-) diff --git a/deal.II/deal.II/include/grid/persistent_tria.h b/deal.II/deal.II/include/grid/persistent_tria.h index 4904a63d6c..c8c35a7e4c 100644 --- a/deal.II/deal.II/include/grid/persistent_tria.h +++ b/deal.II/deal.II/include/grid/persistent_tria.h @@ -10,6 +10,76 @@ #include +/** + * This class handles the history of a triangulation and can rebuild it after + * it was deleted some time before. Its main purpose is support for + * time-dependent problems where one frequently deletes a triangulation due + * to memory pressure and later wants to rebuild it; this class has all the + * information to rebuild it exactly as it was beforem including the mapping + * of cell numbers to the geometrical cells. + * + * Basically, this is a drop-in replacement for the triangulation. Since it + * is derived from the #Triangulation# class, it shares all the + * functionality, but it overrides some virtual functions and adds some + * functions, too. The main change to the base class is that it overrides + * the #execute_coarsening_and_refinement# function, where the new version + * first stores all refinement and coarsening flags and only then calls the + * respective function of the base class. The stored flags may later be + * used to restore the grid just as it was before. Some other functions + * have been extended slightly as well, see their documentation for more + * information. + * + * \subsection{Usage} + * You can use objects of this class almost in the same way as objects of the + * #Triangulation# class. One of the few differences is that you can only + * construct such an object by giving a coarse grid to the constructor. The + * coarse grid will be used to base the triangulation on, and therefore the + * lifetime of the coarse grid has to be longer than the lifetime of the + * object of this class. + * + * Basically, usage looks like this: + * \begin{verbatim} + * Triangulation coarse_grid; + * ... // initialize coarse grid + * + * PersistentTriangulation grid (coarse_grid); + * + * for (...) + * { + * // restore grid from coarse grid + * // and stored refinement flags + * grid.restore (); + * ... // do something with the grid + * + * ... // flag some cells for refinement + * // or coarsening + * grid.execute_coarsening_and_refinement (); + * // actually refine grid and store + * // the flags + * + * ... // so something more with the grid + * + * grid.clear (); // delete the grid, but keep the + * // refinement flags for later use + * // in grid.restore() above + * + * ... // do something where the grid + * // is not needed anymore, e.g. + * // working with another grid + * }; + * \end{verbatim} + * + * Note that initially, the #PersistentTriangulation# object does not + * constitute a triangulation; it only becomes one after #restore# is first + * called. Note also that the #execute_coarsening_and_refinement# stores + * all necessary flags for later reconstruction using the #restore# function. + * #Triangulation::clear ()# resets the underlying triangulation to a + * virgin state, but does not affect the stored refinement flags needed for + * later reconstruction and does also not touch the coarse grid which is + * used withing #restore()#. + * + * @author Wolfgang Bangerth, 1999 + */ template class PersistentTriangulation : public Triangulation { @@ -52,7 +122,7 @@ class PersistentTriangulation : public Triangulation * copied and the grid is stepwise * rebuilt using the saved flags. */ - void restore_grid (); + void restore (); /** * Overload this function to use -- 2.39.5