From 77c6b62678e054dbc01b0421d44ab088cc35a74a Mon Sep 17 00:00:00 2001 From: kanschat Date: Tue, 10 Apr 2007 23:14:29 +0000 Subject: [PATCH] add a function to count MGDoFs per block git-svn-id: https://svn.dealii.org/trunk@14623 0785d39b-7218-0410-832d-ea1e28bc413d --- .../deal.II/source/multigrid/mg_dof_tools.cc | 72 +++++++++++++++++++ 1 file changed, 72 insertions(+) diff --git a/deal.II/deal.II/source/multigrid/mg_dof_tools.cc b/deal.II/deal.II/source/multigrid/mg_dof_tools.cc index ff6badc4ab..ec589b7efb 100644 --- a/deal.II/deal.II/source/multigrid/mg_dof_tools.cc +++ b/deal.II/deal.II/source/multigrid/mg_dof_tools.cc @@ -1008,6 +1008,78 @@ MGTools::count_dofs_per_component ( +template +void +MGTools::count_dofs_per_block ( + const MGDoFHandler &dof_handler, + std::vector > &result, + std::vector target_block) +{ + const FiniteElement& fe = dof_handler.get_fe(); + const unsigned int n_blocks = fe.n_blocks(); + const unsigned int nlevels = dof_handler.get_tria().n_levels(); + + Assert (result.size() == nlevels, + ExcDimensionMismatch(result.size(), nlevels)); + + if (target_block.size() == 0) + { + target_block.resize(n_blocks); + for (unsigned int i=0;i > + dofs_in_block (n_blocks, + std::vector(dof_handler.n_dofs(l), false)); + std::vector > + block_select (n_blocks, std::vector(n_blocks, false)); + Threads::ThreadGroup<> threads; + for (unsigned int i=0; i &, + const std::vector &, + std::vector &, + bool) + = &DoFTools::template extract_level_dofs; + block_select[i][i] = true; + threads += Threads::spawn (fun_ptr)(l, dof_handler, block_select[i], + dofs_in_block[i], true); + } + threads.join_all(); + + // next count what we got + for (unsigned int block=0;block void MGTools::count_dofs_per_component ( -- 2.39.5