From: Mae Markowski Date: Tue, 13 Aug 2019 16:18:09 +0000 (-0500) Subject: fixed typo, made h array, renamed variable X-Git-Tag: v9.2.0-rc1~1223^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a46fe70769dff65d018b4556c0c2eb8dec36cbb6;p=dealii.git fixed typo, made h array, renamed variable --- diff --git a/include/deal.II/grid/grid_generator.h b/include/deal.II/grid/grid_generator.h index 1015ce464d..83710b859c 100644 --- a/include/deal.II/grid/grid_generator.h +++ b/include/deal.II/grid/grid_generator.h @@ -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 &repetitions, const Point & bottom_left, const Point & top_right, - const std::vector & num_cells_to_cut); + const std::vector & n_cells_to_remove); /** * Initialize the given Triangulation with a hypercube with a slit. In each diff --git a/source/grid/grid_generator.cc b/source/grid/grid_generator.cc index 74b01ddb98..f46a92766b 100644 --- a/source/grid/grid_generator.cc +++ b/source/grid/grid_generator.cc @@ -2897,15 +2897,15 @@ namespace GridGenerator const std::vector &repetitions, const Point & bottom_left, const Point & top_right, - const std::vector & num_cells_to_cut) + const std::vector & 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 h; + std::array h; Point 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::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;