//---------------------------------------------------------------------------
// $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
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
* function.
*/
template <int dim>
- static
+ static
void
parallelepiped (Triangulation<dim> &tria,
const Point<dim> (&corners) [dim],
// $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
// 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);
}
+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
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];
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());