From: Denis Davydov Date: Fri, 30 Oct 2015 22:47:29 +0000 (+0100) Subject: fixed a bug in shared::Tria where... X-Git-Tag: v8.4.0-rc2~261^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0c9c6e118723e29c2cd3cd3ad6c954dbdb3aac02;p=dealii.git fixed a bug in shared::Tria where... true_subdomain_ids_of_cells was not set up for the case without artificial cells. --- diff --git a/source/distributed/shared_tria.cc b/source/distributed/shared_tria.cc index 218cff2ff1..b37368918a 100644 --- a/source/distributed/shared_tria.cc +++ b/source/distributed/shared_tria.cc @@ -58,10 +58,15 @@ namespace parallel { dealii::GridTools::partition_triangulation (this->n_subdomains, *this); + true_subdomain_ids_of_cells.resize(this->n_active_cells()); + + // loop over all cells and mark artificial: + typename parallel::shared::Triangulation::active_cell_iterator + cell = this->begin_active(), + endc = this->end(); + if (allow_artificial_cells) { - true_subdomain_ids_of_cells.resize(this->n_active_cells()); - // get halo layer of (ghost) cells // parallel::shared::Triangulation:: std_cxx11::function::active_cell_iterator &)> predicate @@ -72,10 +77,6 @@ namespace parallel std::set::active_cell_iterator> active_halo_layer(active_halo_layer_vector.begin(), active_halo_layer_vector.end()); - // loop over all cells and mark artificial: - typename parallel::shared::Triangulation::active_cell_iterator - cell = this->begin_active(), - endc = this->end(); for (unsigned int index=0; cell != endc; cell++, index++) { // store original/true subdomain ids: @@ -86,6 +87,13 @@ namespace parallel cell->set_subdomain_id(numbers::artificial_subdomain_id); } } + else + { + // just store true subdomain ids + for (unsigned int index=0; cell != endc; cell++, index++) + true_subdomain_ids_of_cells[index] = cell->subdomain_id(); + + } } template diff --git a/source/dofs/dof_tools.cc b/source/dofs/dof_tools.cc index 9e95066706..205cd6baa4 100644 --- a/source/dofs/dof_tools.cc +++ b/source/dofs/dof_tools.cc @@ -1252,7 +1252,7 @@ namespace DoFTools "This could happen when the function is called before NumberCache is written.")); // In case this function is executed with parallel::shared::Triangulation - // with artifical cells, we need to take "true" subdomain IDs (i.e. without + // with possibly artifical cells, we need to take "true" subdomain IDs (i.e. without // artificial cells). Otherwise we are good to use subdomain_id as stored // in cell->subdomain_id(). std::vector cell_owners (dof_handler.get_tria().n_active_cells()); @@ -1260,6 +1260,8 @@ namespace DoFTools (dynamic_cast*> (&dof_handler.get_tria ()))) { cell_owners = tr->get_true_subdomain_ids_of_cells(); + Assert (tr->get_true_subdomain_ids_of_cells().size() == tr->n_active_cells(), + ExcInternalError()); } else {