From: Guido Kanschat Date: Fri, 28 Oct 2011 21:05:42 +0000 (+0000) Subject: change BlockList to SparsityPattern X-Git-Tag: v8.0.0~3177 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b3493e0cd167bbfc9c68aa04131cd80c60c61bea;p=dealii.git change BlockList to SparsityPattern git-svn-id: https://svn.dealii.org/trunk@24684 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/tests/deal.II/block_list_01.cc b/tests/deal.II/block_list_01.cc index ebd9e8a88f..36269e8125 100644 --- a/tests/deal.II/block_list_01.cc +++ b/tests/deal.II/block_list_01.cc @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -38,17 +39,18 @@ test_block_list(const Triangulation& tr, const FiniteElement& fe) MGDoFHandler dof; dof.initialize(tr, fe); - BlockList bl; - + const unsigned int level = tr.n_levels()-1; - bl.initialize_mg(tr.n_cells(level), dof.begin(level), dof.end(level)); - - for (unsigned int i=0;i entries; - for (BlockList::const_iterator b = bl.begin(i);b != bl.end(i);++b) + for (SparsityPattern::row_iterator b = bl.row_begin(i);b != bl.row_end(i);++b) entries.push_back(*b); std::sort(entries.begin(), entries.end()); diff --git a/tests/deal.II/block_list_02.cc b/tests/deal.II/block_list_02.cc index 736cfcb4ab..c925707d94 100644 --- a/tests/deal.II/block_list_02.cc +++ b/tests/deal.II/block_list_02.cc @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -29,30 +30,18 @@ using namespace dealii; -template void -test_block_list(const Triangulation& tr, const FiniteElement& fe) +print_patches (const SparsityPattern& bl) { - deallog << fe.get_name() << std::endl; - - MGDoFHandler dof; - dof.initialize(tr, fe); - - BlockList bl; - - const unsigned int level = tr.n_levels()-1; - const unsigned int n = bl.count_vertex_patches<2>(dof.begin(level), dof.end(level), true); - bl.initialize_vertex_patches_mg(n, dof.begin(level), dof.end(level)); - - for (unsigned int i=0;i entries; - for (BlockList::const_iterator b = bl.begin(i);b != bl.end(i);++b) + for (SparsityPattern::row_iterator b = bl.row_begin(i);b != bl.row_end(i);++b) entries.push_back(*b); - + std::sort(entries.begin(), entries.end()); - + for (unsigned int i=0;i& tr, const FiniteElement& fe) } +template +void +test_block_list(const Triangulation& tr, const FiniteElement& fe) +{ + deallog << fe.get_name() << std::endl; + + MGDoFHandler dof; + dof.initialize(tr, fe); + + const unsigned int level = tr.n_levels()-1; + + { + deallog.push("ttt"); + SparsityPattern bl; + DoFTools::make_vertex_patches(bl, dof, level, true, true, true); + bl.compress(); + print_patches(bl); + deallog.pop(); + deallog << std::endl; + } + { + deallog.push("ttf"); + SparsityPattern bl; + DoFTools::make_vertex_patches(bl, dof, level, true, true, false); + bl.compress(); + print_patches(bl); + deallog.pop(); + deallog << std::endl; + } + { + deallog.push("tff"); + SparsityPattern bl; + DoFTools::make_vertex_patches(bl, dof, level, true, false, false); + bl.compress(); + print_patches(bl); + deallog.pop(); + deallog << std::endl; + } + { + deallog.push("ftt"); + SparsityPattern bl; + DoFTools::make_vertex_patches(bl, dof, level, false, true, true); + bl.compress(); + print_patches(bl); + deallog.pop(); + deallog << std::endl; + } + { + deallog.push("fff"); + SparsityPattern bl; + DoFTools::make_vertex_patches(bl, dof, level, false, false, false); + bl.compress(); + print_patches(bl); + deallog.pop(); + deallog << std::endl; + } +} + + int main() { std::string logname = JobIdentifier::base_name(__FILE__) + std::string("/output");