// ---------------------------------------------------------------------
//
-// Copyright (C) 1999 - 2014 by the deal.II authors
+// Copyright (C) 1999 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
const ConstraintLine *position =
lines_cache.size() <= line_index ? 0 : &lines[lines_cache[line_index]];
- // Gauss elimination of the matrix columns
- // with the inhomogeneity. Go through them one
- // by one and again check whether they are
+ // Gauss elimination of the matrix columns with the inhomogeneity.
+ // Go through them one by one and again check whether they are
// constrained. If so, distribute the constraint
const double val = position->inhomogeneity;
if (val != 0)
for (size_type j=0; j<n_local_dofs; ++j)
- if (is_constrained(local_dof_indices[j]) == false)
- global_vector(local_dof_indices[j]) -= val * local_matrix(j,i);
- else
- {
- const double matrix_entry = local_matrix(j,i);
- if (matrix_entry == 0)
+ {
+ if (is_constrained(local_dof_indices[j]) == false)
+ {
+ global_vector(local_dof_indices[j]) -= val * local_matrix(j,i);
continue;
+ }
- const ConstraintLine &position_j =
- lines[lines_cache[calculate_line_index(local_dof_indices[j])]];
- for (size_type q=0; q<position_j.entries.size(); ++q)
- {
- Assert (!(!local_lines.size()
- || local_lines.is_element(position_j.entries[q].first))
- || is_constrained(position_j.entries[q].first) == false,
- ExcMessage ("Tried to distribute to a fixed dof."));
- global_vector(position_j.entries[q].first)
- -= val * position_j.entries[q].second * matrix_entry;
- }
- }
+ const double matrix_entry = local_matrix(j,i);
+
+ if (matrix_entry == 0)
+ continue;
+
+ const ConstraintLine &position_j =
+ lines[lines_cache[calculate_line_index(local_dof_indices[j])]];
+
+ for (size_type q=0; q<position_j.entries.size(); ++q)
+ {
+ Assert (!(!local_lines.size()
+ || local_lines.is_element(position_j.entries[q].first))
+ || is_constrained(position_j.entries[q].first) == false,
+ ExcMessage ("Tried to distribute to a fixed dof."));
+ global_vector(position_j.entries[q].first)
+ -= val * position_j.entries[q].second * matrix_entry;
+ }
+ }
// now distribute the constraint,
// but make sure we don't touch
typename DH::active_cell_iterator cell = dof_handler.begin_active(),
endc = dof_handler.end();
for (; cell!=endc; ++cell)
- // artificial cells can at best neighbor ghost cells, but we're not
- // interested in these interfaces
- if (!cell->is_artificial ())
+ {
+ // artificial cells can at best neighbor ghost cells, but we're not
+ // interested in these interfaces
+ if (cell->is_artificial ())
+ continue;
+
for (unsigned int face=0; face<GeometryInfo<dim>::faces_per_cell; ++face)
if (cell->face(face)->has_children())
{
ExcInternalError());
}
}
+ }
}
typename DH::active_cell_iterator cell = dof_handler.begin_active(),
endc = dof_handler.end();
for (; cell!=endc; ++cell)
- // artificial cells can at best neighbor ghost cells, but we're not
- // interested in these interfaces
- if (!cell->is_artificial ())
+ {
+ // artificial cells can at best neighbor ghost cells, but we're not
+ // interested in these interfaces
+ if (cell->is_artificial ())
+ continue;
+
for (unsigned int face=0; face<GeometryInfo<dim>::faces_per_cell; ++face)
if (cell->face(face)->has_children())
{
ExcInternalError());
}
}
+ }
}
typename DH::active_cell_iterator cell = dof_handler.begin_active(),
endc = dof_handler.end();
for (; cell!=endc; ++cell)
- // artificial cells can at best neighbor ghost cells, but we're not
- // interested in these interfaces
- if (!cell->is_artificial ())
+ {
+ // artificial cells can at best neighbor ghost cells, but we're not
+ // interested in these interfaces
+ if (cell->is_artificial ())
+ continue;
+
for (unsigned int face=0; face<GeometryInfo<dim>::faces_per_cell; ++face)
if (cell->face(face)->has_children())
{
}
}
}
+ }
}
}
- // if the guess was false, then
- // we need to loop over all faces
- // and subfaces and find the
- // number the hard way
+ // if the guess was false, then we need to loop over all faces and
+ // subfaces and find the number the hard way
for (unsigned int face_no=0; face_no<GeometryInfo<3>::faces_per_cell; ++face_no)
{
- if (face_no!=face_no_guess)
+ if (face_no==face_no_guess)
+ continue;
+
+ const TriaIterator<TriaAccessor<3-1, 3, spacedim> > face
+ =neighbor_cell->face(face_no);
+
+ if (!face->has_children())
+ continue;
+
+ for (unsigned int subface_no=0; subface_no<face->n_children(); ++subface_no)
{
- const TriaIterator<TriaAccessor<3-1, 3, spacedim> > face
- =neighbor_cell->face(face_no);
- if (face->has_children())
- for (unsigned int subface_no=0; subface_no<face->n_children(); ++subface_no)
- if (face->child_index(subface_no)==this_face_index)
- // call a helper function, that
- // translates the current subface
- // number to a subface number for
- // the current FaceRefineCase
- return std::make_pair (face_no, translate_subface_no(face, subface_no));
- else if (face->child(subface_no)->has_children())
- for (unsigned int subsub_no=0; subsub_no<face->child(subface_no)->n_children(); ++subsub_no)
- if (face->child(subface_no)->child_index(subsub_no)==this_face_index)
- // call a helper function, that
- // translates the current subface
- // number and subsubface number to
- // a subface number for the current
- // FaceRefineCase
- return std::make_pair (face_no, translate_subface_no(face, subface_no, subsub_no));
+ if (face->child_index(subface_no)==this_face_index)
+ // call a helper function, that translates the current
+ // subface number to a subface number for the current
+ // FaceRefineCase
+ return std::make_pair (face_no, translate_subface_no(face, subface_no));
+
+ if (face->child(subface_no)->has_children())
+ for (unsigned int subsub_no=0; subsub_no<face->child(subface_no)->n_children(); ++subsub_no)
+ if (face->child(subface_no)->child_index(subsub_no)==this_face_index)
+ // call a helper function, that translates the current
+ // subface number and subsubface number to a subface
+ // number for the current FaceRefineCase
+ return std::make_pair (face_no, translate_subface_no(face, subface_no, subsub_no));
}
}
- // we should never get here,
- // since then we did not find
- // our way back...
+ // we should never get here, since then we did not find our way
+ // back...
Assert (false, ExcInternalError());
return std::make_pair (numbers::invalid_unsigned_int,
numbers::invalid_unsigned_int);