From: guido Date: Thu, 23 Mar 2000 20:41:00 +0000 (+0000) Subject: make_flux_sparsity_pattern on locally refined grids X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=82c3f83c2dfce2a53a23a6af1dcbae6030ace978;p=dealii-svn.git make_flux_sparsity_pattern on locally refined grids git-svn-id: https://svn.dealii.org/trunk@2627 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 94444a7b83..27d6282af7 100644 --- a/deal.II/deal.II/source/dofs/dof_tools.cc +++ b/deal.II/deal.II/source/dofs/dof_tools.cc @@ -242,6 +242,9 @@ DoFTools::make_flux_sparsity_pattern (const DoFHandler &dof, vector dofs_on_other_cell(total_dofs); DoFHandler::active_cell_iterator cell = dof.begin_active(), endc = dof.end(); + + (const_cast& > (dof.get_tria())).clear_user_flags(); + for (; cell!=endc; ++cell) { cell->get_dof_indices (dofs_on_this_cell); @@ -256,23 +259,59 @@ DoFTools::make_flux_sparsity_pattern (const DoFHandler &dof, face < GeometryInfo::faces_per_cell; ++face) { - if (! cell->at_boundary(face) ) + DoFHandler::face_iterator cell_face = cell->face(face); + if (cell_face->user_flag_set ()) + continue; + + if (! cell->at_boundary (face) ) { - DoFHandler::active_cell_iterator neighbor = cell->neighbor(face); - neighbor->get_dof_indices (dofs_on_other_cell); - // only add one direction - // The other is taken care of - // by neighbor. - for (unsigned int i=0; i::cell_iterator neighbor = cell->neighbor(face); + // Refinement edges are taken care of + // by coarser cells + if (neighbor->level() < cell->level()) + continue; + + unsigned int neighbor_face = cell->neighbor_of_neighbor(face); + + if (neighbor->has_children()) { - for (unsigned int j=0; j::subfaces_per_face; + ++sub_nr) + { + DoFHandler::cell_iterator sub_neighbor + = neighbor-> + child(GeometryInfo::child_cell_on_face(neighbor_face, sub_nr)); + + sub_neighbor->get_dof_indices (dofs_on_other_cell); + for (unsigned int i=0; iface(neighbor_face)->set_user_flag (); + } + } else { + neighbor->get_dof_indices (dofs_on_other_cell); + for (unsigned int i=0; iface(neighbor_face)->set_user_flag (); } - } - } + } + } } }