// level, as those lines logically belong to the same
// level as the cell, at least for for isotropic
// refinement
- level_cell_iterator cell = begin(level),
- endcell = end(level);
- for ( ; cell != endcell; ++cell)
+ for (level_cell_iterator cell = begin(level); cell != end(level); ++cell)
for (unsigned int line=0; line < GeometryInfo<2>::faces_per_cell; ++line)
cell->face(line)->set_user_flag();
// shape value on the cell.
std::vector<unsigned int> face_c_dofs(n);
std::vector<unsigned int> face_f_dofs(n);
- unsigned int k=0;
- for (unsigned int i=0; i<GeometryInfo<dim>::vertices_per_face; ++i)
- {
- const unsigned int offset_c = GeometryInfo<dim>::face_to_cell_vertices(face_coarse, i)
- *fe.dofs_per_vertex;
- const unsigned int offset_f = GeometryInfo<dim>::face_to_cell_vertices(face_fine, i)
- *fe.dofs_per_vertex;
- for (unsigned int j=0; j<fe.dofs_per_vertex; ++j)
- {
- face_c_dofs[k] = offset_c + j;
- face_f_dofs[k] = offset_f + j;
- ++k;
- }
- }
- for (unsigned int i=1; i<=GeometryInfo<dim>::lines_per_face; ++i)
- {
- const unsigned int offset_c = fe.first_line_index
- + GeometryInfo<dim>::face_to_cell_lines(face_coarse, i-1)
- *fe.dofs_per_line;
- const unsigned int offset_f = fe.first_line_index
- + GeometryInfo<dim>::face_to_cell_lines(face_fine, i-1)
- *fe.dofs_per_line;
- for (unsigned int j=0; j<fe.dofs_per_line; ++j)
- {
- face_c_dofs[k] = offset_c + j;
- face_f_dofs[k] = offset_f + j;
- ++k;
- }
- }
- for (unsigned int i=1; i<=GeometryInfo<dim>::quads_per_face; ++i)
- {
- const unsigned int offset_c = fe.first_quad_index
- + face_coarse
- *fe.dofs_per_quad;
- const unsigned int offset_f = fe.first_quad_index
- + face_fine
- *fe.dofs_per_quad;
- for (unsigned int j=0; j<fe.dofs_per_quad; ++j)
- {
- face_c_dofs[k] = offset_c + j;
- face_f_dofs[k] = offset_f + j;
- ++k;
- }
- }
- Assert (k == fe.dofs_per_face, ExcInternalError());
+ {
+ unsigned int face_dof=0;
+ for (unsigned int i=0; i<GeometryInfo<dim>::vertices_per_face; ++i)
+ {
+ const unsigned int offset_c = GeometryInfo<dim>::face_to_cell_vertices(face_coarse, i)
+ *fe.dofs_per_vertex;
+ const unsigned int offset_f = GeometryInfo<dim>::face_to_cell_vertices(face_fine, i)
+ *fe.dofs_per_vertex;
+ for (unsigned int j=0; j<fe.dofs_per_vertex; ++j)
+ {
+ face_c_dofs[face_dof] = offset_c + j;
+ face_f_dofs[face_dof] = offset_f + j;
+ ++face_dof;
+ }
+ }
+ for (unsigned int i=1; i<=GeometryInfo<dim>::lines_per_face; ++i)
+ {
+ const unsigned int offset_c = fe.first_line_index
+ + GeometryInfo<dim>::face_to_cell_lines(face_coarse, i-1)
+ *fe.dofs_per_line;
+ const unsigned int offset_f = fe.first_line_index
+ + GeometryInfo<dim>::face_to_cell_lines(face_fine, i-1)
+ *fe.dofs_per_line;
+ for (unsigned int j=0; j<fe.dofs_per_line; ++j)
+ {
+ face_c_dofs[face_dof] = offset_c + j;
+ face_f_dofs[face_dof] = offset_f + j;
+ ++face_dof;
+ }
+ }
+ for (unsigned int i=1; i<=GeometryInfo<dim>::quads_per_face; ++i)
+ {
+ const unsigned int offset_c = fe.first_quad_index
+ + face_coarse
+ *fe.dofs_per_quad;
+ const unsigned int offset_f = fe.first_quad_index
+ + face_fine
+ *fe.dofs_per_quad;
+ for (unsigned int j=0; j<fe.dofs_per_quad; ++j)
+ {
+ face_c_dofs[face_dof] = offset_c + j;
+ face_f_dofs[face_dof] = offset_f + j;
+ ++face_dof;
+ }
+ }
+ Assert (face_dof == fe.dofs_per_face, ExcInternalError());
+ }
// Set up meshes, one with a single
// reference cell and refine it once
cell->face(i)->set_boundary_indicator(1);
for (unsigned int j=0; j<GeometryInfo<3>::lines_per_face; ++j)
{
- const Point<3> vertices[2]
+ const Point<3> line_vertices[2]
= { cell->face(i)->line(j)->vertex(0),
cell->face(i)->line(j)->vertex(1)
};
- if ((std::fabs(vertices[0].distance(center)-radius) >
+ if ((std::fabs(line_vertices[0].distance(center)-radius) >
1e-5*radius)
||
- (std::fabs(vertices[1].distance(center)-radius) >
+ (std::fabs(line_vertices[1].distance(center)-radius) >
1e-5*radius))
cell->face(i)->line(j)->set_boundary_indicator(1);
}
AssertThrow(n_vars>=dim,
ExcMessage("Tecplot file must contain at least one variable for each dimension"));
- for (unsigned int i=1; i<dim; ++i)
- AssertThrow(tecplot2deal[i]>0,
+ for (unsigned int d=1; d<dim; ++d)
+ AssertThrow(tecplot2deal[d]>0,
ExcMessage("Tecplot file must contain at least one variable for each dimension."));
}
else if (Utilities::match_at_string_start(entries[i],"ZONETYPE=ORDERED"))
case 2:
{
- typename dealii::Triangulation<dim>::active_cell_iterator
- cell=tria.begin_active(),
- endc=tria.end();
-
- for (; cell!=endc; ++cell)
+ for (typename dealii::Triangulation<dim>::active_cell_iterator
+ cell=tria.begin_active();
+ cell!=tria.end(); ++cell)
for (unsigned int line_no=0;
line_no<GeometryInfo<dim>::lines_per_cell; ++line_no)
{
// boundary faces and
// generate the info from
// them
- typename dealii::Triangulation<dim>::active_cell_iterator
- cell=tria.begin_active ();
- const typename dealii::Triangulation<dim>::active_cell_iterator
- end=tria.end ();
- for (; cell!=end; ++cell)
+ for (typename dealii::Triangulation<dim>::active_cell_iterator
+ cell=tria.begin_active();
+ cell!=tria.end(); ++cell)
for (unsigned int face_no=0; face_no<GeometryInfo<dim>::faces_per_cell; ++face_no)
{
const typename dealii::Triangulation<dim>::face_iterator
// rotation to get the new
// cube
unsigned int temp[8];
- for (unsigned int i=0; i<8; ++i)
- temp[i] = the_cell.nodes[CubePermutations[perm_num][i]];
- for (unsigned int i=0; i<8; ++i)
- the_cell.nodes[i] = temp[i];
+ for (unsigned int v=0; v<8; ++v)
+ temp[v] = the_cell.nodes[CubePermutations[perm_num][v]];
+ for (unsigned int v=0; v<8; ++v)
+ the_cell.nodes[v] = temp[v];
}
}
} // namespace GridReordering3d
do
{
bool changed = false;
- typename Container<dim-1,spacedim>::active_cell_iterator
- cell = surface_mesh.begin_active(),
- endc = surface_mesh.end();
- for (; cell!=endc; ++cell)
+ for (typename Container<dim-1,spacedim>::active_cell_iterator
+ cell = surface_mesh.begin_active(); cell!=surface_mesh.end(); ++cell)
if (surface_to_volume_mapping[cell]->has_children() == true )
{
cell->set_refine_flag ();
const_cast<Triangulation<dim-1,spacedim>&>(get_tria(surface_mesh))
.execute_coarsening_and_refinement();
- typename Container<dim-1,spacedim>::cell_iterator
- cell = surface_mesh.begin(),
- endc = surface_mesh.end();
- for (; cell!=endc; ++cell)
- for (unsigned int c=0; c<cell->n_children(); c++)
- if (surface_to_volume_mapping.find(cell->child(c)) == surface_to_volume_mapping.end())
- surface_to_volume_mapping[cell->child(c)]
- = surface_to_volume_mapping[cell]->child(c);
+ for (typename Container<dim-1,spacedim>::cell_iterator
+ surface_cell = surface_mesh.begin(); surface_cell!=surface_mesh.end(); ++surface_cell)
+ for (unsigned int c=0; c<surface_cell->n_children(); c++)
+ if (surface_to_volume_mapping.find(surface_cell->child(c)) == surface_to_volume_mapping.end())
+ surface_to_volume_mapping[surface_cell->child(c)]
+ = surface_to_volume_mapping[surface_cell]->child(c);
}
else
break;
for (unsigned int h=0; h<triangulation.levels[l]->cells.cells.size(); ++h)
for (unsigned int q=0; q<GeometryInfo<dim>::faces_per_cell; ++q)
{
- const int index=triangulation.levels[l]->cells.cells[h].face(q);
- if (index==switch_1_index)
+ const int face_index=triangulation.levels[l]->cells.cells[h].face(q);
+ if (face_index==switch_1_index)
triangulation.levels[l]->cells.cells[h].set_face(q,switch_2_index);
- else if (index==switch_2_index)
+ else if (face_index==switch_2_index)
triangulation.levels[l]->cells.cells[h].set_face(q,switch_1_index);
}
// now we have to copy
// at the outset of the
// next iteration) for
// refinement
- for (unsigned int line=0;
- line<GeometryInfo<dim>::lines_per_cell; ++line)
- if (!cell->line(line)->has_children() &&
+ for (unsigned int l=0;
+ l<GeometryInfo<dim>::lines_per_cell; ++l)
+ if (!cell->line(l)->has_children() &&
(GeometryInfo<dim>::line_refinement_case(cell->refine_flag_set(),
- line)
+ l)
!=RefinementCase<1>::no_refinement))
- cell->line(line)->set_user_flag();
+ cell->line(l)->set_user_flag();
break;
}
// here.
if (flux_coupling != DoFTools::none)
{
- unsigned int increment = nfe.dofs_per_cell - nfe.dofs_per_face;
+ const unsigned int dof_increment = nfe.dofs_per_cell - nfe.dofs_per_face;
for (unsigned int local_dof=0; local_dof<fe.dofs_per_cell; ++local_dof)
- row_lengths[cell_indices[local_dof]] += increment;
+ row_lengths[cell_indices[local_dof]] += dof_increment;
}
// Do this only once per