]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Revert to previous state whenever possible and add comment.
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 19 Oct 2004 16:16:57 +0000 (16:16 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 19 Oct 2004 16:16:57 +0000 (16:16 +0000)
git-svn-id: https://svn.dealii.org/trunk@9713 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/source/grid/tria_boundary.cc

index 9f49f182da250d7d05f348ebaa9715873d180c06..a0e35d5fb2660f5b4f38cd298e4b48f9d090aa3d 100644 (file)
@@ -109,12 +109,36 @@ Point<3>
 StraightBoundary<3>::
 get_new_point_on_quad (const Triangulation<3>::quad_iterator &quad) const 
 {
+                                   // generate a new point in the middle of
+                                   // the face based on the points on the
+                                   // edges and the vertices.
+                                   //
+                                   // there is a pathological situation when
+                                   // this face is on a straight boundary, but
+                                   // one of its edges and the face behind it
+                                   // are not; if that face is refined first,
+                                   // the new point in the middle of that edge
+                                   // may not be at the same position as
+                                   // quad->line(.)->center() would have been,
+                                   // but would have been moved to the
+                                   // non-straight boundary. We cater to that
+                                   // situation by using existing edge
+                                   // midpoints if available, or center() if
+                                   // not
   return (quad->vertex(0) + quad->vertex(1) +
          quad->vertex(2) + quad->vertex(3) +
-         quad->line(0)->center() +
-         quad->line(1)->center() +
-         quad->line(2)->center() +
-         quad->line(3)->center()) / 8;
+         (quad->line(0)->has_children() ?
+           quad->line(0)->child(0)->vertex(1) :
+           quad->line(0)->center()) +
+         (quad->line(1)->has_children() ?
+           quad->line(1)->child(0)->vertex(1) :
+           quad->line(1)->center()) +
+         (quad->line(2)->has_children() ?
+           quad->line(2)->child(0)->vertex(1) :
+           quad->line(2)->center()) +
+         (quad->line(3)->has_children() ?
+           quad->line(3)->child(0)->vertex(1) :
+           quad->line(3)->center())               ) / 8;
 }
 
 #endif

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.