]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Deprecate Triangulation::distort_random. Revive it as GridTools::distort_random.
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 26 Feb 2013 04:57:49 +0000 (04:57 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 26 Feb 2013 04:57:49 +0000 (04:57 +0000)
git-svn-id: https://svn.dealii.org/trunk@28564 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/include/deal.II/grid/grid_tools.h
deal.II/include/deal.II/grid/tria.h
deal.II/source/grid/grid_tools.cc
deal.II/source/grid/grid_tools.inst.in

index f9face699a5037d5e80fd75487735d5e38ca9279..6b270a8bd2867550051906ce91b7f172b53428ab 100644 (file)
@@ -249,6 +249,29 @@ namespace GridTools
   void scale (const double        scaling_factor,
               Triangulation<dim, spacedim> &triangulation);
 
+  /**
+   * Distort the given triangulation by randomly
+   * moving around all the vertices
+   * of the grid.  The direction of
+   * movement of each vertex is random, while the
+   * length of the shift vector has
+   * a value of @p factor times
+   * the minimal length of the
+   * active edges adjacent to this
+   * vertex. Note that @p factor
+   * should obviously be well below
+   * <tt>0.5</tt>.
+   *
+   * If @p keep_boundary is set to
+   * @p true (which is the
+   * default), then boundary
+   * vertices are not moved.
+   */
+  template <int dim, int spacedim>
+  void distort_random (const double factor,
+                       Triangulation<dim, spacedim> &triangulation,
+                       const bool   keep_boundary=true);
+
   /**
    * Find and return the number of
    * the used vertex in a given
index 1560b4af2726bcff077f3f8451f7c152921a6fff..835c0914146ed3cc2b60ecb4e1cabac6d9cf15fa 100644 (file)
@@ -2023,9 +2023,11 @@ public:
    * @p true (which is the
    * default), then boundary
    * vertices are not moved.
+   *
+   * @deprecated Use GridTools::distort_random instead.
    */
   void distort_random (const double factor,
-                       const bool   keep_boundary=true);
+                       const bool   keep_boundary=true) DEAL_II_DEPRECATED;
 
 
   /**
index 77c916ae7ddbe831ce5c203194a3dd060e8f205f..a32ac8b8dafc4f917dbe7c47cb0e8e5de8602d53 100644 (file)
@@ -602,6 +602,17 @@ namespace GridTools
   }
 
 
+  template <int dim, int spacedim>
+  void
+  distort_random (const double        factor,
+                  Triangulation<dim, spacedim> &triangulation,
+                  const bool          keep_boundary)
+  {
+    //TODO: Move implementation of this function into the current
+    // namespace
+    triangulation.distort_random (factor, keep_boundary);
+  }
+
 
   template <int dim, template <int, int> class Container, int spacedim>
   unsigned int
index 132dc8ec489f13d8c3c638ca6e69e399e61e30bd..1d2470bf6cf6264d89542a8dd74937deaa1d9b54 100644 (file)
@@ -101,6 +101,11 @@ for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension :  SPACE_DIMENSIONS
       void scale<deal_II_dimension> (const double,
                                     Triangulation<deal_II_dimension, deal_II_space_dimension> &);
 
+    template
+      void distort_random<deal_II_dimension> (const double,
+                                    Triangulation<deal_II_dimension, deal_II_space_dimension> &,
+                                    const bool);
+
     template
       void get_face_connectivity_of_cells
       (const Triangulation<deal_II_dimension, deal_II_space_dimension> &triangulation,

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.