]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Trivial change: (i) added assert to enclosed_hyper_cube function to check that inner...
authoryoung <young@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 29 Apr 2010 16:38:23 +0000 (16:38 +0000)
committeryoung <young@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 29 Apr 2010 16:38:23 +0000 (16:38 +0000)
git-svn-id: https://svn.dealii.org/trunk@21052 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/source/grid/grid_generator.cc

index 4c908edcb75d5cba416f8b0b40312b139c4eef0b..528cd82e12377e9fdd9635e01e307b3a276548fb 100644 (file)
@@ -169,11 +169,11 @@ GridGenerator::colorize_hyper_rectangle (Triangulation<dim,spacedim> &tria)
 
 template <int dim, int spacedim>
 void GridGenerator::hyper_cube (Triangulation<dim,spacedim> &tria,
-                               const double        left,
-                               const double        right)
+                               const double                 left,
+                               const double                 right)
 {
   Assert (left < right,
-         ExcMessage ("Invalid left and right bounds of hypercube"));
+         ExcMessage ("Invalid left-to-right bounds of hypercube"));
 
   Point<spacedim> p1;
   Point<spacedim> p2;
@@ -287,7 +287,7 @@ GridGenerator::subdivided_hyper_cube (Triangulation<dim> &tria,
 {
   Assert (repetitions >= 1, ExcInvalidRepetitions(repetitions));
   Assert (left < right,
-         ExcMessage ("Invalid left and right bounds of hypercube"));
+         ExcMessage ("Invalid left-to-right bounds of hypercube"));
 
                                    // first generate the necessary
                                    // points
@@ -1267,17 +1267,20 @@ GridGenerator::half_hyper_shell (Triangulation<dim>&,
 // Implementation for 2D only
 template <int dim>
 void GridGenerator::enclosed_hyper_cube (Triangulation<dim> &tria,
-                                        const double      l,
-                                        const double      r,
-                                        const double      d,
-                                        const bool        colorize)
+                                        const double        left,
+                                        const double        right,
+                                        const double        thickness,
+                                        const bool          colorize)
 {
+  Assert(left<right,
+        ExcMessage ("Invalid left-to-right bounds of enclosed hypercube"));
+
   std::vector<Point<dim> > vertices(16);
   double coords[4];
-  coords[0] = l-d;
-  coords[1] = l;
-  coords[2] = r;
-  coords[3] = r+d;
+  coords[0] = left-thickness;
+  coords[1] = left;
+  coords[2] = right;
+  coords[3] = right+thickness;
 
   unsigned int k=0;
   for (unsigned int i0=0;i0<4;++i0)
@@ -1806,17 +1809,20 @@ void GridGenerator::hyper_cube_slit (Triangulation<dim>& tria,
 // Implementation for 3D only
 template <int dim>
 void GridGenerator::enclosed_hyper_cube (Triangulation<dim> &tria,
-                                        const double      l,
-                                        const double      r,
-                                        const double      d,
-                                        const bool        colorize)
+                                        const double        left,
+                                        const double        right,
+                                        const double        thickness,
+                                        const bool          colorize)
 {
+  Assert(left<right,
+        ExcMessage ("Invalid left-to-right bounds of enclosed hypercube"));
+
   std::vector<Point<dim> > vertices(64);
   double coords[4];
-  coords[0] = l-d;
-  coords[1] = l;
-  coords[2] = r;
-  coords[3] = r+d;
+  coords[0] = left-thickness;
+  coords[1] = left;
+  coords[2] = right;
+  coords[3] = right+thickness;
 
   unsigned int k=0;
   for (unsigned int z=0;z<4;++z)

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.