* Projects a given point onto the
* unit cell, i.e. each coordinate
* outside [0..1] is modified
- * to lie within that interval
+ * to lie within that interval.
*/
- static void project_to_unit_cell (Point<dim> &p);
+ static Point<dim> project_to_unit_cell (const Point<dim> &p);
/**
* Returns the infinity norm of
return child_cell_on_face(face, vertex, face_orientation);
}
+
+
template <int dim>
-void
-GeometryInfo<dim>::project_to_unit_cell (Point<dim> &p)
+Point<dim>
+GeometryInfo<dim>::project_to_unit_cell (const Point<dim> &q)
{
- for(unsigned i=0; i<dim; i++)
- if (p[i] < 0.) p[i] = 0.;
- else if (p[i] > 1.) p[i] = 1.;
+ Point<dim> p = q;
+ for(unsigned i=0; i<dim; i++)
+ if (p[i] < 0.) p[i] = 0.;
+ else if (p[i] > 1.) p[i] = 1.;
+
+ return p;
}
+
+
template <int dim>
double
GeometryInfo<dim>::distance_to_unit_cell (const Point<dim> &p)
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