From 8bfa01d509b0f5f0d7c6658df43347589eb98720 Mon Sep 17 00:00:00 2001 From: young Date: Thu, 29 Apr 2010 16:38:23 +0000 Subject: [PATCH] Trivial change: (i) added assert to enclosed_hyper_cube function to check that inner boundaries are ok, (ii) corrected some bad wording and make header file consistent with source file git-svn-id: https://svn.dealii.org/trunk@21052 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/deal.II/source/grid/grid_generator.cc | 46 +++++++++++-------- 1 file changed, 26 insertions(+), 20 deletions(-) diff --git a/deal.II/deal.II/source/grid/grid_generator.cc b/deal.II/deal.II/source/grid/grid_generator.cc index 4c908edcb7..528cd82e12 100644 --- a/deal.II/deal.II/source/grid/grid_generator.cc +++ b/deal.II/deal.II/source/grid/grid_generator.cc @@ -169,11 +169,11 @@ GridGenerator::colorize_hyper_rectangle (Triangulation &tria) template void GridGenerator::hyper_cube (Triangulation &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 p1; Point p2; @@ -287,7 +287,7 @@ GridGenerator::subdivided_hyper_cube (Triangulation &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&, // Implementation for 2D only template void GridGenerator::enclosed_hyper_cube (Triangulation &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 > 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& tria, // Implementation for 3D only template void GridGenerator::enclosed_hyper_cube (Triangulation &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 > 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) -- 2.39.5