From: Wolfgang Bangerth Date: Thu, 27 Apr 2006 02:01:34 +0000 (+0000) Subject: Rewrite a few algorithms to only use get_fe() on cells, not faces, where it X-Git-Tag: v8.0.0~11856 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d1ac76358c9a79b1cd5cd48cd9b7d5562a6da162;p=dealii.git Rewrite a few algorithms to only use get_fe() on cells, not faces, where it doesn't make much sense. git-svn-id: https://svn.dealii.org/trunk@12916 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/deal.II/source/dofs/dof_tools.cc b/deal.II/deal.II/source/dofs/dof_tools.cc index 994da67285..8130067b0a 100644 --- a/deal.II/deal.II/source/dofs/dof_tools.cc +++ b/deal.II/deal.II/source/dofs/dof_tools.cc @@ -1137,21 +1137,22 @@ DoFTools::make_boundary_sparsity_pattern ( // boundaries of dimension dim-2, // and so every boundary line is // also part of a boundary face. - typename DH::active_face_iterator face = dof.begin_active_face(), - endf = dof.end_face(); - for (; face!=endf; ++face) - if (face->at_boundary()) - { - const unsigned int dofs_per_face = face->get_fe().dofs_per_face; - dofs_on_this_face.resize (dofs_per_face); - face->get_dof_indices (dofs_on_this_face); - - // make sparsity pattern for this cell - for (unsigned int i=0; i::faces_per_cell; ++f) + if (cell->at_boundary(f)) + { + const unsigned int dofs_per_face = cell->get_fe().dofs_per_face; + dofs_on_this_face.resize (dofs_per_face); + cell->face(f)->get_dof_indices (dofs_on_this_face); + + // make sparsity pattern for this cell + for (unsigned int i=0; i dofs_on_this_face; dofs_on_this_face.reserve (max_dofs_per_face(dof)); - typename DH::active_face_iterator face = dof.begin_active_face(), - endf = dof.end_face(); - for (; face!=endf; ++face) - if (boundary_indicators.find(face->boundary_indicator()) != - boundary_indicators.end()) - { - const unsigned int dofs_per_face = face->get_fe().dofs_per_face; - dofs_on_this_face.resize (dofs_per_face); - face->get_dof_indices (dofs_on_this_face); - - // make sparsity pattern for this cell - for (unsigned int i=0; i::faces_per_cell; ++f) + if (boundary_indicators.find(cell->face(f)->boundary_indicator()) != + boundary_indicators.end()) + { + const unsigned int dofs_per_face = cell->get_fe().dofs_per_face; + dofs_on_this_face.resize (dofs_per_face); + cell->face(f)->get_dof_indices (dofs_on_this_face); + + // make sparsity pattern for this cell + for (unsigned int i=0; iat_boundary()) - { - const unsigned int dofs_per_face = face->get_fe().dofs_per_face; - dofs_on_face.resize (dofs_per_face); - face->get_dof_indices (dofs_on_face); - for (unsigned int i=0; i::faces_per_cell; ++f) + if (cell->at_boundary(f)) + { + const unsigned int dofs_per_face = cell->get_fe().dofs_per_face; + dofs_on_face.resize (dofs_per_face); + cell->face(f)->get_dof_indices (dofs_on_face); + for (unsigned int i=0; iboundary_indicator()) != - boundary_indicators.end()) + typename DH::active_cell_iterator cell = dof_handler.begin_active(), + endc = dof_handler.end(); + for (; cell!=endc; ++cell) + for (unsigned int f=0; f::faces_per_cell; ++f) + if (boundary_indicators.find (cell->face(f)->boundary_indicator()) != + boundary_indicators.end()) { - const unsigned int dofs_per_face = face->get_fe().dofs_per_face; + const unsigned int dofs_per_face = cell->get_fe().dofs_per_face; dofs_on_face.resize (dofs_per_face); - face->get_dof_indices (dofs_on_face); + cell->face(f)->get_dof_indices (dofs_on_face); for (unsigned int i=0; i