]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Allow for a copy constructor of persistent triangulations, as long as the underlying...
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 18 Aug 1999 09:53:13 +0000 (09:53 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 18 Aug 1999 09:53:13 +0000 (09:53 +0000)
git-svn-id: https://svn.dealii.org/trunk@1709 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/include/grid/persistent_tria.h
deal.II/deal.II/source/grid/persistent_tria.cc

index 91320c7b368e428e03f1853e0c8f5edd004b9441..cfc7700e9f86731f479096140cca3e6eccd4ff15 100644 (file)
@@ -108,6 +108,16 @@ class PersistentTriangulation : public Triangulation<dim>
                                      */
     PersistentTriangulation (const Triangulation<dim> &coarse_grid);
 
+                                    /**
+                                     * Copy constructor. This operation
+                                     * is only allowed, if the triangulation
+                                     * underlying the object to be copied
+                                     * is presently empty. Refinement flags
+                                     * as well as the pointer to the
+                                     * coarse grid are copied, however.
+                                     */
+    PersistentTriangulation (const PersistentTriangulation<dim> &old_tria);
+    
                                     /**
                                      * Destructor.
                                      */
@@ -183,6 +193,10 @@ class PersistentTriangulation : public Triangulation<dim>
                                      * Exception.
                                      */
     DeclException0 (ExcFunctionNotUseful);
+                                    /**
+                                     * Exception.
+                                     */
+    DeclException0 (ExcTriaNotEmpty);
     
   private:
                                     /**
index 477e8db94115d9ac00d7882ff1590e157ac5d9ad..520325c2fcb9ac26ad4a7078192cb0ac47776849 100644 (file)
@@ -10,6 +10,21 @@ PersistentTriangulation (const Triangulation<dim> &coarse_grid) :
 {};
 
 
+template <int dim>
+PersistentTriangulation<dim>::
+PersistentTriangulation (const PersistentTriangulation<dim> &old_tria) :
+                                                // default initialize
+                                                // tria, i.e. it will be
+                                                // empty on first use
+               Triangulation<dim> (),
+               coarse_grid (old_tria.coarse_grid),
+               refine_flags (old_tria.refine_flags),
+               coarsen_flags (old_tria.coarsen_flags)
+{
+  Assert (old_tria.n_levels() == 0, ExcTriaNotEmpty ());
+};
+
+
 
 template <int dim>
 PersistentTriangulation<dim>::~PersistentTriangulation () 

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.