]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Change parallelepiped interface to something sensible: Point<dim>()[dim] not Tensor...
authoryoung <young@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 14 Jan 2013 10:44:14 +0000 (10:44 +0000)
committeryoung <young@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 14 Jan 2013 10:44:14 +0000 (10:44 +0000)
git-svn-id: https://svn.dealii.org/trunk@28043 0785d39b-7218-0410-832d-ea1e28bc413d

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

index 9f7b344ed25e3809251467a7832c5644930ea2bb..90372b03625288b387d8bcc5e947cdaedb4c049f 100644 (file)
@@ -309,17 +309,20 @@ public:
                  const Tensor<2,dim> &corners,
                  const bool           colorize=false);
 
+
   /**
    * A parallelepiped. The first corner point is the origin. The
-   * <tt>dim</tt> adjacent points are the rank one subtensors of the
-   * tensor provided and additional points will be sums of those
-   * <tt>dim</tt> vectors. Thus in 1d this is a line, in 2d this is a
-   * parallelogram, and in 3d a parallelepiped. Colorizing is done
-   * according to hyper_rectangle().
+   * <tt>dim</tt> adjacent points are vectors describing the edges of
+   * the parallelepiped with respect to the origin. Additional points
+   * are sums of these dim vectors. Colorizing is done according to
+   * hyper_rectangle().
    *
    * @note This function silently reorders the vertices on the cells
-   * to lexiographic ordering if they are not already ordered that way
-   * (see GridReordering::reorder_grid()).
+   * to lexiographic ordering (see
+   * <code>GridReordering::reorder_grid</code>). In other words, if
+   * reodering of the vertices does occur, the ordering of vertices in
+   * the array of <code>corners</code> will no longer refer to the
+   * same triangulation.
    *
    * @note The triangulation needs to be void upon calling this
    * function.
@@ -327,9 +330,10 @@ public:
   template <int dim>
     static 
     void
-    parallelepiped (Triangulation<dim>   &tria,
-                   const Tensor<2, dim> &corners,
-                   const bool            colorize = false);
+    parallelepiped (Triangulation<dim>  &tria,
+                  const Point<dim>   (&corners) [dim],
+                  const bool           colorize = false);
+   
 
   /**
    * Hypercube with a layer of
index 2d3e21fab292c20f61a6a4faca150bd6b8bc125b..50f5e6eb8d39378489438dfea9b116532e23871c 100644 (file)
@@ -367,8 +367,6 @@ GridGenerator::torus (Triangulation<2,3> &tria,
 }
 
 
-
-
 // Implementation for 2D only
 template<>
 void
@@ -398,22 +396,25 @@ GridGenerator::parallelogram (
 
 
 // Parallelepiped implementation in 1d, 2d, and 3d. @note The
-// implementation in 1d is equivalent to hyper_rectangle, and in 2d is
-// equivalent to parallelogram. Reordering of vertices to lexiographic
-// occurs if needed. For this reason the triangulation is explicitly
-// constructed for each dim here.
+// implementation in 1d is similar to hyper_rectangle(), and in 2d is
+// similar to parallelogram().
+//
+// The GridReordering::reorder_grid is made use of towards the end of
+// this function. Thus the triangulation is explicitly constructed for
+// all dim here since it is slightly different in that respect
+// (cf. hyper_rectangle(), parallelogram()).
 template<int dim>
 void
-GridGenerator::parallelepiped (Triangulation<dim>   &tria,
-                              const Tensor<2, dim> &corners,
-                              const bool            colorize)
+GridGenerator::parallelepiped (Triangulation<dim>  &tria,
+                             const Point<dim>   (&corners) [dim],
+                             const bool           colorize)
 {
   // Check that none of the user defined vertices overlap
   for (unsigned int i=0; i<dim; ++i)
     for (unsigned int j=i+1; j<dim; ++j)
       Assert ((corners[i]!=corners[j]),
               ExcMessage ("Invalid distance between corner points of parallelepiped."));
-  
+
   // Note: vertex[0] is the origin and is initialised as so here:
   std::vector<Point<dim> > vertices (GeometryInfo<dim>::vertices_per_cell);
 
@@ -428,7 +429,7 @@ GridGenerator::parallelepiped (Triangulation<dim>   &tria,
     case 2:
       // assign corners to vertices:
       vertices[1] = corners[0];
-      vertices[2] = corners[1];
+      vertices[2] = corners[0];
 
       // compose the remaining vertex:
       vertices[3] = vertices[1] + vertices[2];
index 0561f0a4a410939d75140e4b9c211b1799785033..68f836e18a7aba4b44591cd4c5050f54e046ee1f 100644 (file)
@@ -67,8 +67,8 @@ for (deal_II_dimension : DIMENSIONS)
 
     template void
       GridGenerator::parallelepiped<deal_II_dimension> (
-       Triangulation<deal_II_dimension>               &,
-       const Tensor<2, deal_II_dimension>             &
+       Triangulation<deal_II_dimension>                   &,
+       const Point<deal_II_dimension> (&) [deal_II_dimension]
        const bool);  
   
   

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.