]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Deprecate one function, introduce alternative interface.
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 14 Jan 2013 13:36:38 +0000 (13:36 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 14 Jan 2013 13:36:38 +0000 (13:36 +0000)
git-svn-id: https://svn.dealii.org/trunk@28045 0785d39b-7218-0410-832d-ea1e28bc413d

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

index 90372b03625288b387d8bcc5e947cdaedb4c049f..d70b55b5cb6b7dead4cf71491129ff50a8c593e9 100644 (file)
@@ -1,7 +1,7 @@
 //---------------------------------------------------------------------------
 //    $Id$
 //
-//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 by the deal.II authors
+//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 by the deal.II authors
 //
 //    This file is subject to QPL and may not be  distributed
 //    without copyright and license information. Please refer
@@ -284,32 +284,33 @@ public:
                               const bool                               colorize=false);
 
   /**
-   * A parallelogram. The first
-   * corner point is the
-   * origin. The <tt>dim</tt>
-   * adjacent points are the
-   * one-dimensional subtensors of
-   * the tensor provided and
-   * additional points will be sums
-   * of these two vectors.
-   * Colorizing is done according
-   * to hyper_rectangle().
-   *
-   * @note This function is
-   * implemented in 2d only.
+   * A parallelogram. The first corner point is the origin. The <tt>dim</tt>
+   * adjacent points are the ones given in the second argument and the fourth
+   * point will be the sum of these two vectors.  Colorizing is done in the
+   * same way as in hyper_rectangle().
    *
-   * @note The triangulation needs to be
-   * void upon calling this
-   * function.
+   * @note This function is implemented in 2d only.
+   *
+   * @note The triangulation needs to be void upon calling this function.
    */
   template <int dim>
-  static 
-    void
-    parallelogram(Triangulation<dim> &tria,
-                 const Tensor<2,dim> &corners,
-                 const bool           colorize=false);
+  static
+  void
+  parallelogram(Triangulation<dim> &tria,
+               const Point<dim> (&corners)[dim],
+               const bool           colorize=false);
 
 
+  /**
+   * @deprecated Use the other function of same name.
+   */
+  template <int dim>
+  static
+  void
+  parallelogram(Triangulation<dim> &tria,
+               const Tensor<2,dim> &corners,
+               const bool           colorize=false) DEAL_II_DEPRECATED;
+
   /**
    * A parallelepiped. The first corner point is the origin. The
    * <tt>dim</tt> adjacent points are vectors describing the edges of
@@ -328,7 +329,7 @@ public:
    * function.
    */
   template <int dim>
-    static 
+    static
     void
     parallelepiped (Triangulation<dim>  &tria,
                   const Point<dim>   (&corners) [dim],
index 50f5e6eb8d39378489438dfea9b116532e23871c..072852f5870169c32f1b14a6f00c7cbbf89d2e84 100644 (file)
@@ -2,7 +2,7 @@
 //    $Id$
 //    Version: $Name$
 //
-//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 by the deal.II authors
+//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 by the deal.II authors
 //
 //    This file is subject to QPL and may not be  distributed
 //    without copyright and license information. Please refer
@@ -370,10 +370,9 @@ GridGenerator::torus (Triangulation<2,3> &tria,
 // Implementation for 2D only
 template<>
 void
-GridGenerator::parallelogram (
-  Triangulation<2>  &tria,
-  const Tensor<2,2> &corners,
-  const bool         colorize)
+GridGenerator::parallelogram (Triangulation<2>  &tria,
+                             const Point<2> (&corners)[2],
+                             const bool         colorize)
 {
   std::vector<Point<2> > vertices (GeometryInfo<2>::vertices_per_cell);
 
@@ -394,6 +393,18 @@ GridGenerator::parallelogram (
 }
 
 
+template<>
+void
+GridGenerator::parallelogram (Triangulation<2>  &tria,
+                             const Tensor<2,2> &corners,
+                             const bool         colorize)
+{
+  // simply pass everything to the other function of same name
+  const Point<2> x[2] = { corners[0], corners[1] };
+  parallelogram (tria, x, colorize);
+}
+
+
 
 // Parallelepiped implementation in 1d, 2d, and 3d. @note The
 // implementation in 1d is similar to hyper_rectangle(), and in 2d is
@@ -441,7 +452,7 @@ GridGenerator::parallelepiped (Triangulation<dim>  &tria,
       vertices[1] = corners[0];
       vertices[2] = corners[1];
       vertices[4] = corners[2];
-      
+
       // compose the remaining vertices:
       vertices[3] = vertices[1] + vertices[2];
       vertices[5] = vertices[1] + vertices[4];
@@ -458,7 +469,7 @@ GridGenerator::parallelepiped (Triangulation<dim>  &tria,
   for (unsigned int i=0; i<GeometryInfo<dim>::vertices_per_cell; ++i)
     cells[0].vertices[i] = i;
   cells[0].material_id = 0;
-  
+
   // Check ordering of vertices and create triangulation
   GridReordering<dim>::reorder_cells (cells);
   tria.create_triangulation (vertices, cells, SubCellData());

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.