From: Timo Heister Date: Sat, 27 Jun 2015 12:19:55 +0000 (-0400) Subject: replace get_boundary_indices X-Git-Tag: v8.4.0-rc2~277^2~35 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4c443f06d8f3f12fdc829b872632d1a7162995cc;p=dealii.git replace get_boundary_indices use IndexSet instead --- diff --git a/include/deal.II/multigrid/mg_constrained_dofs.h b/include/deal.II/multigrid/mg_constrained_dofs.h index b9ef4e0701..0ee24682b7 100644 --- a/include/deal.II/multigrid/mg_constrained_dofs.h +++ b/include/deal.II/multigrid/mg_constrained_dofs.h @@ -89,7 +89,13 @@ public: * constraints. */ const std::vector > & - get_boundary_indices () const; + get_boundary_indices () const DEAL_II_DEPRECATED; + + /** + * Return the indices of dofs for each level that are subject to boundary constraints. + */ + const IndexSet & + get_boundary_indices (const unsigned int level) const; /** * @deprecated Use at_refinement_edge() if possible, else @@ -133,7 +139,12 @@ public: /** * The indices of boundary dofs for each level. */ - std::vector > boundary_indices; + std::vector boundary_indices; + + /** + * old data structure only filled on demand + */ + mutable std::vector > boundary_indices_old; /** * The degrees of freedom on the refinement edge between a level and coarser @@ -216,7 +227,7 @@ MGConstrainedDoFs::is_boundary_index (const unsigned int level, return false; AssertIndexRange(level, boundary_indices.size()); - return (boundary_indices[level].find(index) != boundary_indices[level].end()); + return boundary_indices[level].is_element(index); } inline @@ -234,9 +245,29 @@ inline const std::vector > & MGConstrainedDoFs::get_boundary_indices () const { - return boundary_indices; + if (boundary_indices_old.size()!=boundary_indices.size()) + { + boundary_indices_old.resize(boundary_indices.size()); + for (unsigned int l=0;l tmp; + boundary_indices[l].fill_index_vector(tmp); + boundary_indices_old[l].insert(tmp.begin(), tmp.end()); + } + } + return boundary_indices_old; } + +inline +const IndexSet & +MGConstrainedDoFs::get_boundary_indices (const unsigned int level) const +{ + AssertIndexRange(level, boundary_indices.size()); + return boundary_indices[level]; +} + + inline const std::vector > & MGConstrainedDoFs::get_refinement_edge_indices () const