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.
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
}
-
-
// Implementation for 2D only
template<>
void
// 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);
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];
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);