/**
* 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
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
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
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]);
}
}
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;