From 72053f4fea9c729fdc2e5826da100baed850ebb6 Mon Sep 17 00:00:00 2001 From: hartmann Date: Thu, 30 Jun 2005 09:34:55 +0000 Subject: [PATCH] By using GeometryInfo<2>::face_to_cell_vertices the implementation of the CellAccessor<2>::point_inside function is now independent of the internal numbering of points and lines. git-svn-id: https://svn.dealii.org/trunk@10981 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/deal.II/source/grid/tria_accessor.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/deal.II/deal.II/source/grid/tria_accessor.cc b/deal.II/deal.II/source/grid/tria_accessor.cc index 48df4c7b74..0de508a873 100644 --- a/deal.II/deal.II/source/grid/tria_accessor.cc +++ b/deal.II/deal.II/source/grid/tria_accessor.cc @@ -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 -- 2.39.5