From: Guido Kanschat Date: Wed, 26 Aug 2009 18:08:58 +0000 (+0000) Subject: add functionality to FETools::compute_block_renumbering X-Git-Tag: v8.0.0~7222 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=15504358f7476732bb91802f2dbbea825119df4a;p=dealii.git add functionality to FETools::compute_block_renumbering git-svn-id: https://svn.dealii.org/trunk@19346 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/deal.II/include/fe/fe_tools.h b/deal.II/deal.II/include/fe/fe_tools.h index 6fae20c4f4..dccdc7c1dc 100644 --- a/deal.II/deal.II/include/fe/fe_tools.h +++ b/deal.II/deal.II/include/fe/fe_tools.h @@ -163,10 +163,17 @@ class FETools /** * Compute the vector required to * renumber the dofs of a cell by - * block. Furthermore, - * compute the vector storing the - * start indices of each local block - * vector. + * block. Furthermore, compute + * the vector storing either the + * start indices or the size of + * each local block vector. + * + * If the @p bool parameter is + * true, @p block_data is filled + * with the start indices of each + * local block. If it is false, + * then the block sizes are + * returned. * * @todo Which way does this * vector map the numbers? @@ -175,7 +182,8 @@ class FETools static void compute_block_renumbering ( const FiniteElement& fe, std::vector& renumbering, - std::vector& start_indices); + std::vector& block_data, + bool return_start_indices = true); /** * @name Generation of local matrices diff --git a/deal.II/deal.II/source/fe/fe_tools.cc b/deal.II/deal.II/source/fe/fe_tools.cc index dd34c061ca..d9ecc24fa8 100644 --- a/deal.II/deal.II/source/fe/fe_tools.cc +++ b/deal.II/deal.II/source/fe/fe_tools.cc @@ -289,13 +289,14 @@ template void FETools::compute_block_renumbering ( const FiniteElement& element, std::vector& renumbering, - std::vector& start_indices) + std::vector& block_data, + bool return_start_indices) { Assert(renumbering.size() == element.dofs_per_cell, ExcDimensionMismatch(renumbering.size(), element.dofs_per_cell)); - Assert(start_indices.size() == element.n_blocks(), - ExcDimensionMismatch(start_indices.size(), + Assert(block_data.size() == element.n_blocks(), + ExcDimensionMismatch(block_data.size(), element.n_blocks())); unsigned int k=0; @@ -303,10 +304,24 @@ void FETools::compute_block_renumbering ( for (unsigned int b=0;b start_indices(block_data.size()); + k = 0; + for (unsigned int i=0;i& element, - std::vector&, std::vector&_indices); + std::vector&, std::vector&_indices, bool); template void FETools::get_interpolation_matrix (const FiniteElement &,