From 335bd0893069df60bafe2b19d29618bffd2c9d4e Mon Sep 17 00:00:00 2001 From: Guido Kanschat Date: Tue, 25 May 2004 12:19:30 +0000 Subject: [PATCH] new local renumbering git-svn-id: https://svn.dealii.org/trunk@9317 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/deal.II/include/fe/fe_tools.h | 29 ++++++++++++++++- deal.II/deal.II/source/fe/fe_tools.cc | 46 +++++++++++++++++++++++++++ 2 files changed, 74 insertions(+), 1 deletion(-) diff --git a/deal.II/deal.II/include/fe/fe_tools.h b/deal.II/deal.II/include/fe/fe_tools.h index 84c9a09058..f08a705684 100644 --- a/deal.II/deal.II/include/fe/fe_tools.h +++ b/deal.II/deal.II/include/fe/fe_tools.h @@ -41,11 +41,38 @@ class ConstraintMatrix; * $id-I_h$ that is needed for evaluating $(id-I_h)z$ for e.g. the * dual solution $z$. * - * @author Ralf Hartmann, 2000 + * @author Ralf Hartmann, Guido Kanschat, 2000, 2004 */ class FETools { public: + /** + * Compute the vector required to + * renumber the dofs of a cell by + * component. Furthermore, + * compute the vector storing the + * start indices of each + * component in the local block + * vector. + * + * The second vector is organized + * such that there is a vector + * for each base element + * containing the start index for + * each component served by this + * base element. + * + * While the first vector is + * checked to have the correct + * size, the second one is + * reinitialized for convenience. + */ + template + static void compute_component_wise( + const FiniteElement& fe, + std::vector& renumbering, + std::vector >& start_indices); + /** * Gives the interpolation matrix * that interpolates a @p fe1- diff --git a/deal.II/deal.II/source/fe/fe_tools.cc b/deal.II/deal.II/source/fe/fe_tools.cc index ff26769d58..28eeb32df8 100644 --- a/deal.II/deal.II/source/fe/fe_tools.cc +++ b/deal.II/deal.II/source/fe/fe_tools.cc @@ -196,6 +196,47 @@ namespace } } +template +void FETools::compute_component_wise( + const FiniteElement& element, + std::vector& renumbering, + std::vector >& comp_start) +{ + Assert(renumbering.size() == element.dofs_per_cell, + ExcDimensionMismatch(renumbering.size(), + element.dofs_per_cell)); + + comp_start.resize(element.n_base_elements()); + + unsigned int k=0; + for (unsigned int i=0;i, unsigned int> + indices = element.system_to_base_index(i); + renumbering[i] = comp_start[indices.first.first][indices.first.second] + +indices.second; + } +} + + template void FETools::get_interpolation_matrix (const FiniteElement &fe1, @@ -1539,6 +1580,11 @@ FETools::get_fe_from_name_aux (const std::string &name) /*-------------- Explicit Instantiations -------------------------------*/ + +template +void FETools::compute_component_wise( + const FiniteElement& element, + std::vector&, std::vector >&); template void FETools::get_interpolation_matrix (const FiniteElement &, -- 2.39.5