From: Guido Kanschat Date: Wed, 24 Feb 2010 17:18:46 +0000 (+0000) Subject: prepare for more flexibility in loop X-Git-Tag: v8.0.0~6409 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5a5bd10dfa79ff05df53657998a90a94cec954a3;p=dealii.git prepare for more flexibility in loop git-svn-id: https://svn.dealii.org/trunk@20686 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/deal.II/include/numerics/mesh_worker_info.templates.h b/deal.II/deal.II/include/numerics/mesh_worker_info.templates.h index a5b1a956d2..55c3bff7e1 100644 --- a/deal.II/deal.II/include/numerics/mesh_worker_info.templates.h +++ b/deal.II/deal.II/include/numerics/mesh_worker_info.templates.h @@ -34,17 +34,22 @@ namespace MeshWorker void DoFInfo::get_indices(const typename DoFHandler::cell_iterator& c) { - indices.resize(c->get_fe().dofs_per_cell); - - if (block_info == 0 || block_info->local().size() == 0) - c->get_dof_indices(indices); - else + if (!c->has_children()) { - indices_org.resize(c->get_fe().dofs_per_cell); - c->get_dof_indices(indices_org); - for (unsigned int i=0;iblock_info->renumber(i)] = indices_org[i]; + indices.resize(c->get_fe().dofs_per_cell); + + if (block_info == 0 || block_info->local().size() == 0) + c->get_dof_indices(indices); + else + { + indices_org.resize(c->get_fe().dofs_per_cell); + c->get_dof_indices(indices_org); + for (unsigned int i=0;iblock_info->renumber(i)] = indices_org[i]; + } } + else + indices.resize(0); } diff --git a/deal.II/deal.II/include/numerics/mesh_worker_loop.h b/deal.II/deal.II/include/numerics/mesh_worker_loop.h index fe628ed255..0e63154685 100644 --- a/deal.II/deal.II/include/numerics/mesh_worker_loop.h +++ b/deal.II/deal.II/include/numerics/mesh_worker_loop.h @@ -78,6 +78,10 @@ namespace MeshWorker * @param face_worker defines the local action on interior faces. * @param cells_first determines, whether faces or cells are to be * dealt with first. + * @param unique_faces_only determines, that a face between two cells + * of the same level is processed only from the cell which is less + * than its neighbor. If this parameter is false these faces + * are processed from both cells. * * @author Guido Kanschat, 2010 */ @@ -91,7 +95,8 @@ namespace MeshWorker const std_cxx1x::function&, DoFInfo&, typename INFOBOX::FaceInfo &, typename INFOBOX::FaceInfo &)> &face_worker, - bool cells_first = true) + const bool cells_first, + const bool unique_faces_only) { const bool integrate_cell = (cell_worker != 0); const bool integrate_boundary = (boundary_worker != 0); @@ -166,7 +171,7 @@ namespace MeshWorker // level, but // only do this // from one side. - if (neighbor < cell) continue; + if (unique_faces_only && (neighbor < cell)) continue; // If iterator // is active @@ -250,7 +255,7 @@ namespace MeshWorker // Loop over all cells WorkStream::run(begin, end, std_cxx1x::bind(cell_action, _1, _3, _2, - cell_worker, boundary_worker, face_worker, cells_first), + cell_worker, boundary_worker, face_worker, cells_first, true), std_cxx1x::bind(internal::assemble, _1, assembler), info, dof_info);