renumber[i] = new_number++;
Assert(new_number == n_vertices, ExcInternalError());
- typename Triangulation<dim, spacedim>::active_cell_iterator cell;
- const typename Triangulation<dim, spacedim>::active_cell_iterator endc =
- tria.end();
-
-
// write the vertices
out << "object \"vertices\" class array type float rank 1 shape " << dim
<< " items " << n_vertices << " data follows" << '\n';
<< n_vertices_per_cell << " items " << n_cells << " data follows"
<< '\n';
- for (cell = tria.begin_active(); cell != endc; ++cell)
+ for (const auto &cell : tria.active_cell_iterators())
{
for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell;
++v)
out << "object \"material\" class array type int rank 0 items " << n_cells
<< " data follows" << '\n';
- for (cell = tria.begin_active(); cell != endc; ++cell)
+ for (const auto &cell : tria.active_cell_iterators())
out << ' ' << cell->material_id();
out << '\n' << "attribute \"dep\" string \"connections\"" << '\n' << '\n';
out << "object \"level\" class array type int rank 0 items " << n_cells
<< " data follows" << '\n';
- for (cell = tria.begin_active(); cell != endc; ++cell)
+ for (const auto &cell : tria.active_cell_iterators())
out << ' ' << cell->level();
out << '\n' << "attribute \"dep\" string \"connections\"" << '\n' << '\n';
{
out << "object \"measure\" class array type float rank 0 items "
<< n_cells << " data follows" << '\n';
- for (cell = tria.begin_active(); cell != endc; ++cell)
+ for (const auto &cell : tria.active_cell_iterators())
out << '\t' << cell->measure();
out << '\n'
<< "attribute \"dep\" string \"connections\"" << '\n'
{
out << "object \"diameter\" class array type float rank 0 items "
<< n_cells << " data follows" << '\n';
- for (cell = tria.begin_active(); cell != endc; ++cell)
+ for (const auto &cell : tria.active_cell_iterators())
out << '\t' << cell->diameter();
out << '\n'
<< "attribute \"dep\" string \"connections\"" << '\n'
<< n_vertices_per_face << " items " << n_faces << " data follows"
<< '\n';
- for (cell = tria.begin_active(); cell != endc; ++cell)
+ for (const auto &cell : tria.active_cell_iterators())
{
for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
{
out << "object \"boundary\" class array type int rank 0 items " << n_faces
<< " data follows" << '\n';
- for (cell = tria.begin_active(); cell != endc; ++cell)
+ for (const auto &cell : tria.active_cell_iterators())
{
// Little trick to get -1 for the interior
for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
{
out << "object \"face measure\" class array type float rank 0 items "
<< n_faces << " data follows" << '\n';
- for (cell = tria.begin_active(); cell != endc; ++cell)
+ for (const auto &cell : tria.active_cell_iterators())
{
for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell;
++f)
{
out << "object \"face diameter\" class array type float rank 0 items "
<< n_faces << " data follows" << '\n';
- for (cell = tria.begin_active(); cell != endc; ++cell)
+ for (const auto &cell : tria.active_cell_iterators())
{
for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell;
++f)
const unsigned int n_vertices = tria.n_used_vertices();
- typename Triangulation<dim, spacedim>::active_cell_iterator cell =
- tria.begin_active();
- const typename Triangulation<dim, spacedim>::active_cell_iterator endc =
- tria.end();
-
// Write Header
// The file format is:
/*
// write cells. Enumerate cells
// consecutively, starting with 1
- for (cell = tria.begin_active(); cell != endc; ++cell)
+ for (const auto &cell : tria.active_cell_iterators())
{
out << cell->active_cell_index() + 1 << ' ' << elm_type << ' '
<< static_cast<unsigned int>(cell->material_id()) << ' '
const unsigned int n_vertices = tria.n_used_vertices();
- typename Triangulation<dim, spacedim>::active_cell_iterator cell =
- tria.begin_active();
- const typename Triangulation<dim, spacedim>::active_cell_iterator endc =
- tria.end();
-
// write preamble
if (ucd_flags.write_preamble)
{
// write cells. Enumerate cells
// consecutively, starting with 1
- for (cell = tria.begin_active(); cell != endc; ++cell)
+ for (const auto &cell : tria.active_cell_iterators())
{
out << cell->active_cell_index() + 1 << ' '
<< static_cast<unsigned int>(cell->material_id()) << ' ';
// on finer levels. Level 0
// corresponds to a depth of 900,
// each level subtracting 1
- Triangulation<dim, spacedim>::cell_iterator cell = tria.begin();
- const Triangulation<dim, spacedim>::cell_iterator end = tria.end();
-
- for (; cell != end; ++cell)
+ for (const auto &cell : tria.cell_iterators())
{
// If depth is not encoded, write finest level only
if (!xfig_flags.level_depth && !cell->active())
y_max_perspective = projection_decomposition[1];
y_min_perspective = projection_decomposition[1];
- for (Triangulation<2, 2>::cell_iterator cell = tria.begin();
- cell != tria.end();
- ++cell)
+ for (const auto &cell : tria.cell_iterators())
{
point[0] = cell->vertex(0)[0];
point[1] = cell->vertex(0)[1];
for (unsigned int level_index = min_level; level_index <= max_level;
level_index++)
{
- Triangulation<2, 2>::cell_iterator cell = tria.begin(level_index),
- endc = tria.end(level_index);
-
- for (; cell != endc; ++cell)
+ for (const auto &cell : tria.cell_iterators_on_level(level_index))
{
if (!svg_flags.convert_level_number_to_height && !cell->active())
continue;
// run over all active cells and write out a list of
// xyz-coordinates that correspond to vertices
- typename dealii::Triangulation<dim, spacedim>::active_cell_iterator
- cell = tria.begin_active(),
- endc = tria.end();
-
// No global indices in deal.II, so we make one up here.
- for (; cell != endc; ++cell)
+ for (const auto &cell : tria.active_cell_iterators())
{
for (unsigned int i = 0; i < dim; ++i)
{
const unsigned int n_q_points = GeometryInfo<dim>::vertices_per_cell;
- typename Triangulation<dim, spacedim>::cell_iterator cell, endc;
- for (cell = tria.begin(), endc = tria.end(); cell != endc; ++cell)
+ for (const auto &cell : tria.cell_iterators())
{
if (!view_levels)
{
typename Triangulation<dim, spacedim>::active_face_iterator face, endf;
unsigned int n_faces = 0;
- for (face = tria.begin_active_face(), endf = tria.end_face(); face != endf;
- ++face)
+ for (const auto &face : tria.active_face_iterators())
if ((face->at_boundary()) && (face->boundary_id() != 0))
n_faces++;
unsigned int n_lines = 0;
- typename Triangulation<dim, spacedim>::active_cell_iterator cell, endc;
-
- for (cell = tria.begin_active(), endc = tria.end(); cell != endc; ++cell)
+ for (const auto &cell : tria.active_cell_iterators())
for (unsigned int l = 0; l < GeometryInfo<dim>::lines_per_cell; ++l)
if (cell->line(l)->at_boundary() && (cell->line(l)->boundary_id() != 0) &&
(cell->line(l)->user_flag_set() == false))
std::ostream & out) const
{
unsigned int current_element_index = next_element_index;
- typename Triangulation<dim, spacedim>::active_face_iterator face, endf;
- for (face = tria.begin_active_face(), endf = tria.end_face(); face != endf;
- ++face)
+ for (const auto &face : tria.active_face_iterators())
if (face->at_boundary() && (face->boundary_id() != 0))
{
out << current_element_index << ' ';
const_cast<dealii::Triangulation<dim, spacedim> &>(tria)
.clear_user_flags_line();
- typename Triangulation<dim, spacedim>::active_cell_iterator cell, endc;
-
- for (cell = tria.begin_active(), endc = tria.end(); cell != endc; ++cell)
+ for (const auto &cell : tria.active_cell_iterators())
for (unsigned int l = 0; l < GeometryInfo<dim>::lines_per_cell; ++l)
if (cell->line(l)->at_boundary() && (cell->line(l)->boundary_id() != 0) &&
(cell->line(l)->user_flag_set() == false))
unsigned int current_element_index = next_element_index;
typename Triangulation<dim, spacedim>::active_face_iterator face, endf;
- for (face = tria.begin_active_face(), endf = tria.end_face(); face != endf;
- ++face)
+ for (const auto &face : tria.active_face_iterators())
if (face->at_boundary() && (face->boundary_id() != 0))
{
out << current_element_index << " "
const_cast<dealii::Triangulation<dim, spacedim> &>(tria)
.clear_user_flags_line();
- typename Triangulation<dim, spacedim>::active_cell_iterator cell, endc;
-
- for (cell = tria.begin_active(), endc = tria.end(); cell != endc; ++cell)
+ for (const auto &cell : tria.active_cell_iterators())
for (unsigned int l = 0; l < GeometryInfo<dim>::lines_per_cell; ++l)
if (cell->line(l)->at_boundary() && (cell->line(l)->boundary_id() != 0) &&
(cell->line(l)->user_flag_set() == false))
{
AssertThrow(out, ExcIO());
- const int dim = 1;
-
- typename dealii::Triangulation<dim, spacedim>::active_cell_iterator cell =
- tria.begin_active();
- const typename dealii::Triangulation<dim, spacedim>::active_cell_iterator
- endc = tria.end();
- for (; cell != endc; ++cell)
+ for (const auto &cell : tria.active_cell_iterators())
{
if (gnuplot_flags.write_cell_numbers)
out << "# cell " << cell << '\n';
gnuplot_flags.n_boundary_face_points;
const unsigned int n_points = 2 + n_additional_points;
- typename dealii::Triangulation<dim, spacedim>::active_cell_iterator cell =
- tria.begin_active();
- const typename dealii::Triangulation<dim, spacedim>::active_cell_iterator
- endc = tria.end();
-
// If we need to plot curved lines then generate a quadrature formula to
// place points via the mapping
Quadrature<dim> * q_projector = nullptr;
QProjector<dim>::project_to_all_faces(quadrature));
}
- for (; cell != endc; ++cell)
+ for (const auto &cell : tria.active_cell_iterators())
{
if (gnuplot_flags.write_cell_numbers)
out << "# cell " << cell << '\n';
gnuplot_flags.n_boundary_face_points;
const unsigned int n_points = 2 + n_additional_points;
- typename dealii::Triangulation<dim, spacedim>::active_cell_iterator cell =
- tria.begin_active();
- const typename dealii::Triangulation<dim, spacedim>::active_cell_iterator
- endc = tria.end();
-
// If we need to plot curved lines then generate a quadrature formula to
// place points via the mapping
Quadrature<dim> * q_projector = nullptr;
QProjector<dim>::project_to_all_faces(quadrature));
}
- for (; cell != endc; ++cell)
+ for (const auto &cell : tria.active_cell_iterators())
{
if (gnuplot_flags.write_cell_numbers)
out << "# cell " << cell << '\n';
case 2:
{
- for (typename dealii::Triangulation<dim, spacedim>::
- active_cell_iterator cell = tria.begin_active();
- cell != tria.end();
- ++cell)
+ for (const auto &cell : tria.active_cell_iterators())
for (unsigned int line_no = 0;
line_no < GeometryInfo<dim>::lines_per_cell;
++line_no)
// boundary faces and
// generate the info from
// them
- for (typename dealii::Triangulation<dim, spacedim>::
- active_cell_iterator cell = tria.begin_active();
- cell != tria.end();
- ++cell)
+ for (const auto &cell : tria.active_cell_iterators())
for (unsigned int face_no = 0;
face_no < GeometryInfo<dim>::faces_per_cell;
++face_no)
// presently not supported
Assert(mapping == nullptr, ExcNotImplemented());
- typename dealii::Triangulation<dim,
- spacedim>::active_cell_iterator
- cell = tria.begin_active(),
- endc = tria.end();
-
// loop over all lines and compute their
// projection on the plane perpendicular
// to the direction of sight
const Tensor<1, dim> unit_vector2 = vector2 / vector2.norm();
- for (; cell != endc; ++cell)
+ for (const auto &cell : tria.active_cell_iterators())
for (unsigned int line_no = 0;
line_no < GeometryInfo<dim>::lines_per_cell;
++line_no)
{
out << "(Helvetica) findfont 140 scalefont setfont" << '\n';
- typename dealii::Triangulation<dim, spacedim>::active_cell_iterator
- cell = tria.begin_active(),
- endc = tria.end();
- for (; cell != endc; ++cell)
+ for (const auto &cell : tria.active_cell_iterators())
{
out << (cell->center()(0) - offset(0)) * scale << ' '
<< (cell->center()(1) - offset(1)) * scale << " m" << '\n'
// already tracked, to avoid
// doing this multiply
std::set<unsigned int> treated_vertices;
- typename dealii::Triangulation<dim, spacedim>::active_cell_iterator
- cell = tria.begin_active(),
- endc = tria.end();
- for (; cell != endc; ++cell)
+ for (const auto &cell : tria.active_cell_iterators())
for (unsigned int vertex = 0;
vertex < GeometryInfo<dim>::vertices_per_cell;
++vertex)