From: Timo Heister Date: Fri, 3 Jan 2014 13:30:18 +0000 (+0000) Subject: handle artificial cells in DofInfoBox X-Git-Tag: v8.2.0-rc1~1084 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2e21db4f36220f17cae3e4c239b53ccb50d32262;p=dealii.git handle artificial cells in DofInfoBox git-svn-id: https://svn.dealii.org/trunk@32148 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/include/deal.II/meshworker/dof_info.h b/deal.II/include/deal.II/meshworker/dof_info.h index 402f7822ea..633da8c711 100644 --- a/deal.II/include/deal.II/meshworker/dof_info.h +++ b/deal.II/include/deal.II/meshworker/dof_info.h @@ -280,6 +280,12 @@ namespace MeshWorker * face is available. */ bool exterior_face_available[GeometryInfo::faces_per_cell]; + + /** + * A flag to specify if the current object has been set to a valid + * cell. + */ + bool cell_valid; }; //----------------------------------------------------------------------// @@ -417,7 +423,7 @@ namespace MeshWorker inline DoFInfoBox::DoFInfoBox(const DOFINFO &seed) : - cell(seed) + cell(seed), cell_valid(true) { for (unsigned int i=0; i::faces_per_cell; ++i) { @@ -433,7 +439,7 @@ namespace MeshWorker inline DoFInfoBox::DoFInfoBox(const DoFInfoBox &other) : - cell(other.cell) + cell(other.cell), cell_valid(other.cell_valid) { for (unsigned int i=0; i::faces_per_cell; ++i) { @@ -449,6 +455,7 @@ namespace MeshWorker inline void DoFInfoBox::reset () { + cell_valid = false; for (unsigned int i=0; i::faces_per_cell; ++i) { interior_face_available[i] = false; @@ -462,6 +469,9 @@ namespace MeshWorker inline void DoFInfoBox::assemble (ASSEMBLER &assembler) const { + if (!cell_valid) + return; + assembler.assemble(cell); for (unsigned int i=0; i::faces_per_cell; ++i) { diff --git a/deal.II/include/deal.II/meshworker/loop.h b/deal.II/include/deal.II/meshworker/loop.h index 255298ab36..a8d63b9a50 100644 --- a/deal.II/include/deal.II/meshworker/loop.h +++ b/deal.II/include/deal.II/meshworker/loop.h @@ -251,21 +251,20 @@ namespace MeshWorker ? cell->level_subdomain_id() : cell->subdomain_id(); - if ((!ignore_subdomain) && (csid == numbers::artificial_subdomain_id)) - return; - const bool own_cell = ignore_subdomain || (csid == cell->get_triangulation().locally_owned_subdomain()); dof_info.reset(); + + if ((!ignore_subdomain) && (csid == numbers::artificial_subdomain_id)) + return; + dof_info.cell.reinit(cell); + dof_info.cell_valid = true; const bool integrate_cell = (cell_worker != 0); const bool integrate_boundary = (boundary_worker != 0); const bool integrate_interior_face = (face_worker != 0); - dof_info.reset(); - - dof_info.cell.reinit(cell); if (integrate_cell) info.cell.reinit(dof_info.cell); // Execute this, if cells