From: wolf Date: Thu, 11 May 2006 16:04:21 +0000 (+0000) Subject: Make GeometryInfo::project_to_unit_cell return the projected point, rather than... X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d9eb58a2f765cbb9daaeb5943f45a7f933212d23;p=dealii-svn.git Make GeometryInfo::project_to_unit_cell return the projected point, rather than modify its argument git-svn-id: https://svn.dealii.org/trunk@13102 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/base/include/base/geometry_info.h b/deal.II/base/include/base/geometry_info.h index dce7843557..e166a10e03 100644 --- a/deal.II/base/include/base/geometry_info.h +++ b/deal.II/base/include/base/geometry_info.h @@ -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 &p); + static Point project_to_unit_cell (const Point &p); /** * Returns the infinity norm of diff --git a/deal.II/base/source/geometry_info.cc b/deal.II/base/source/geometry_info.cc index a636d2236e..fdf4629407 100644 --- a/deal.II/base/source/geometry_info.cc +++ b/deal.II/base/source/geometry_info.cc @@ -426,15 +426,22 @@ GeometryInfo::face_to_cell_vertices (const unsigned int face, return child_cell_on_face(face, vertex, face_orientation); } + + template -void -GeometryInfo::project_to_unit_cell (Point &p) +Point +GeometryInfo::project_to_unit_cell (const Point &q) { - for(unsigned i=0; i 1.) p[i] = 1.; + Point p = q; + for(unsigned i=0; i 1.) p[i] = 1.; + + return p; } + + template double GeometryInfo::distance_to_unit_cell (const Point &p)