]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Make GeometryInfo<dim>::project_to_unit_cell return the projected point, rather than...
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 11 May 2006 16:04:21 +0000 (16:04 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 11 May 2006 16:04:21 +0000 (16:04 +0000)
git-svn-id: https://svn.dealii.org/trunk@13102 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/base/include/base/geometry_info.h
deal.II/base/source/geometry_info.cc

index dce7843557f0e105fba4a6849922a71e31684cab..e166a10e035cf3302de9b1c20059c5782c6f894c 100644 (file)
@@ -896,9 +896,9 @@ struct GeometryInfo
                                      * 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
index a636d2236e8680c1683e02c739ef530bdce55ee1..fdf4629407d6839627f1e2c77f3b6eb4099bc386 100644 (file)
@@ -426,15 +426,22 @@ GeometryInfo<dim>::face_to_cell_vertices (const unsigned int face,
   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


Typeset in Trocchi and Trocchi Bold Sans Serif.