From: Guido Kanschat Date: Fri, 10 Mar 2006 14:52:37 +0000 (+0000) Subject: renumbering by block X-Git-Tag: v8.0.0~12119 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=55ff53f2b559e6bb408f1ed04b5210cf0ff98738;p=dealii.git renumbering by block git-svn-id: https://svn.dealii.org/trunk@12576 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 39967576bc..a97f56d041 100644 --- a/deal.II/deal.II/include/fe/fe_tools.h +++ b/deal.II/deal.II/include/fe/fe_tools.h @@ -58,6 +58,10 @@ class FETools { public: /** + * @warning In most cases, you + * will probably want to use + * compute_base_renumbering(). + * * Compute the vector required to * renumber the dofs of a cell by * component. Furthermore, @@ -84,6 +88,23 @@ class FETools std::vector& renumbering, std::vector >& start_indices); + /** + * 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. + * + * @todo Which way does this + * vector map the numbers? + */ + template + static void compute_block_renumbering ( + const FiniteElement& fe, + std::vector& renumbering, + std::vector& start_indices); + /** * @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 b1d88164f0..ab5a8f8086 100644 --- a/deal.II/deal.II/source/fe/fe_tools.cc +++ b/deal.II/deal.II/source/fe/fe_tools.cc @@ -198,6 +198,40 @@ void FETools::compute_component_wise( +template +void FETools::compute_block_renumbering ( + const FiniteElement& element, + std::vector& renumbering, + std::vector& 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(), + element.n_blocks())); + + unsigned int k=0; + unsigned int i=0; + for (unsigned int b=0;b + indices = element.system_to_block_index(i); + renumbering[i] = start_indices[indices.first] + +indices.second; + } +} + + + template void FETools::get_interpolation_matrix (const FiniteElement &fe1, const FiniteElement &fe2,