]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
By using GeometryInfo<2>::face_to_cell_vertices the implementation of the CellAccesso...
authorhartmann <hartmann@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 30 Jun 2005 09:34:55 +0000 (09:34 +0000)
committerhartmann <hartmann@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 30 Jun 2005 09:34:55 +0000 (09:34 +0000)
git-svn-id: https://svn.dealii.org/trunk@10981 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/source/grid/tria_accessor.cc

index 48df4c7b74d7bd66e2198f7ff3417520d07fd714..0de508a87309a24b9594411fcdc0f3d4df292cad 100644 (file)
@@ -1805,13 +1805,19 @@ bool CellAccessor<2>::point_inside (const Point<2> &p) const
                                   // the point is on the `cell-side'
                                   // for all four faces, it must be
                                   // inside the cell.
+
+                                  // we want the faces in counter
+                                  // clockwise orientation
+  static const int direction[4]={1,1,-1,-1};
   for (unsigned int f=0; f<4; ++f)
     {
                                       // vector from the first vertex
                                       // of the line to the point
       const Point<2> to_p = p-this->vertex(f);
                                       // vector describing the line
-      const Point<2> face = this->vertex((f+1)%4)-this->vertex(f);
+      const Point<2> face = direction[f]*(
+       this->vertex(GeometryInfo<2>::face_to_cell_vertices(f,1)) -
+       this->vertex(GeometryInfo<2>::face_to_cell_vertices(f,0)));
 
                                       // if we rotate the face vector
                                       // by 90 degrees to the left

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.