]> https://gitweb.dealii.org/ - dealii.git/commitdiff
fixed typo, made h array, renamed variable
authorMae Markowski <mm115@rice.edu>
Tue, 13 Aug 2019 16:18:09 +0000 (11:18 -0500)
committerMae Markowski <mm115@rice.edu>
Tue, 13 Aug 2019 16:18:09 +0000 (11:18 -0500)
include/deal.II/grid/grid_generator.h
source/grid/grid_generator.cc

index 1015ce464d77f15e291f31b65f17d411c313c5f2..83710b859cc5d222ca05aa963234cefce5b6082a 100644 (file)
@@ -875,13 +875,13 @@ namespace GridGenerator
 
   /**
    * Initialize the given triangulation in 2D or 3D with a generalized
-   * subdivided_hyper_L.
+   * subdivided hyper-L.
    *
-   * This function produces a subdivided_hyper_rectangle with dimensions given
+   * This function produces a subdivided hyper rectangle with dimensions given
    * by @p bottom_left and @p top_right, with the given number of
    * subdivisions in each direction given in the vector @p repetitions,
-   * and with a number of cells removed, given in the vector @p num_cells_to_cut.
-   * Note that @p num_cells_to_cut contains integers, meaning that its entries
+   * and with a number of cells removed, given in the vector @p n_cells_to_remove.
+   * Note that @p n_cells_to_remove contains integers, meaning that its entries
    * can be both positive and negative. A positive number denotes
    * cutting away cells in the 'positive' orientation, for example
    * left to right in the x-direction, bottom to top in
@@ -910,7 +910,7 @@ namespace GridGenerator
                      const std::vector<unsigned int> &repetitions,
                      const Point<dim> &               bottom_left,
                      const Point<dim> &               top_right,
-                     const std::vector<int> &         num_cells_to_cut);
+                     const std::vector<int> &         n_cells_to_remove);
 
   /**
    * Initialize the given Triangulation with a hypercube with a slit. In each
index 74b01ddb9826672d155604304eb5b85dd46baeb6..f46a92766b5392e3d1eb028ee1f9d3b0cfc82f75 100644 (file)
@@ -2897,15 +2897,15 @@ namespace GridGenerator
                      const std::vector<unsigned int> &repetitions,
                      const Point<dim> &               bottom_left,
                      const Point<dim> &               top_right,
-                     const std::vector<int> &         num_cells_to_cut)
+                     const std::vector<int> &         n_cells_to_remove)
   {
     Assert(dim > 1, ExcNotImplemented());
     // Check the consistency of the dimensions provided.
     AssertDimension(repetitions.size(), dim);
-    AssertDimension(num_cells_to_cut.size(), dim);
+    AssertDimension(n_cells_to_remove.size(), dim);
     for (unsigned int d = 0; d < dim; ++d)
       {
-        Assert(std::fabs(num_cells_to_cut[d]) <= repetitions[d],
+        Assert(std::fabs(n_cells_to_remove[d]) <= repetitions[d],
                ExcMessage("Attempting to cut away too many cells."));
       }
     // Create the domain to be cut
@@ -2916,23 +2916,23 @@ namespace GridGenerator
                                               top_right);
     // compute the vertex of the cut step, we will cut according to the
     // location of the cartesian coordinates of the cell centers
-    std::vector<double> h;
+    std::array<double,dim> h;
     Point<dim>          cut_step;
     for (unsigned int d = 0; d < dim; ++d)
       {
         // mesh spacing in each direction in cartesian coordinates
-        h.push_back((top_right[d] - bottom_left[d]) / repetitions[d]);
+        h[d] = (top_right[d] - bottom_left[d]) / repetitions[d];
         // left to right, bottom to top, front to back
-        if (num_cells_to_cut[d] >= 0)
+        if (n_cells_to_remove[d] >= 0)
           {
             // cartesian coordinates of vertex location
             cut_step[d] =
-              h[d] * std::fabs(num_cells_to_cut[d]) + bottom_left[d];
+              h[d] * std::fabs(n_cells_to_remove[d]) + bottom_left[d];
           }
         // right to left, top to bottom, back to front
         else
           {
-            cut_step[d] = top_right[d] - h[d] * std::fabs(num_cells_to_cut[d]);
+            cut_step[d] = top_right[d] - h[d] * std::fabs(n_cells_to_remove[d]);
           }
       }
 
@@ -2948,8 +2948,8 @@ namespace GridGenerator
         const typename Triangulation<dim, spacedim>::active_cell_iterator &cell)
         -> bool {
         for (unsigned int d = 0; d < dim; ++d)
-          if ((num_cells_to_cut[d] > 0 && cell->center()[d] >= cut_step[d]) ||
-              (num_cells_to_cut[d] < 0 && cell->center()[d] <= cut_step[d]))
+          if ((n_cells_to_remove[d] > 0 && cell->center()[d] >= cut_step[d]) ||
+              (n_cells_to_remove[d] < 0 && cell->center()[d] <= cut_step[d]))
             return false;
 
         return true;

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.