]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Relax and clarify rules for repeated boundary objects.
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 24 Sep 2003 13:48:59 +0000 (13:48 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 24 Sep 2003 13:48:59 +0000 (13:48 +0000)
git-svn-id: https://svn.dealii.org/trunk@8013 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/source/grid/tria.cc

index 726ebfeef773ec72dae35492ad2b3a8e50d52b63..bc021f8daf4770f1b62e865b5a6b1520917e1c93 100644 (file)
@@ -1504,10 +1504,20 @@ void Triangulation<3>::create_triangulation (const std::vector<Point<3> >    &v,
                                       // Assert that only exterior
                                       // lines are given a boundary
                                       // indicator
-      AssertThrow (line->boundary_indicator() == 0,
+      AssertThrow (line->at_boundary(),
                   ExcInteriorLineCantBeBoundary());
-                   
-      line -> set_boundary_indicator (boundary_line->material_id);
+
+                                       // and make sure that we don't
+                                       // attempt to reset the
+                                       // boundary indicator to a
+                                       // different than the
+                                       // previously set value
+      if (line->boundary_indicator() != 0)
+        AssertThrow (line->boundary_indicator() ==
+                     boundary_line->material_id,
+                     ExcMessage ("Duplicate boundary lines are only allowed "
+                                 "if they carry the same boundary indicator."));
+      line->set_boundary_indicator (boundary_line->material_id);
     };       
 
 
@@ -1618,8 +1628,19 @@ void Triangulation<3>::create_triangulation (const std::vector<Point<3> >    &v,
 
                                       // check whether this face is
                                       // really an exterior one
-      AssertThrow(quad->boundary_indicator()==0,
+      AssertThrow(quad->at_boundary(),
                  ExcInteriorQuadCantBeBoundary());
+
+                                       // and make sure that we don't
+                                       // attempt to reset the
+                                       // boundary indicator to a
+                                       // different than the
+                                       // previously set value
+      if (quad->boundary_indicator() != 0)
+        AssertThrow (quad->boundary_indicator() ==
+                     boundary_quad->material_id,
+                     ExcMessage ("Duplicate boundary quads are only allowed "
+                                 "if they carry the same boundary indicator."));
       quad->set_boundary_indicator (boundary_quad->material_id); 
     };
                                                                                       

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.