From 2390a94b2a7d9202748839ab833b0821be8f12f4 Mon Sep 17 00:00:00 2001 From: bangerth Date: Wed, 17 Dec 2008 01:24:36 +0000 Subject: [PATCH] Minor cleanup: Make a couple of variables const and move initialization appropriately. git-svn-id: https://svn.dealii.org/trunk@17961 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/deal.II/include/fe/mapping_q.h | 4 +-- deal.II/deal.II/source/fe/mapping_q.cc | 40 +++++++++++++------------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/deal.II/deal.II/include/fe/mapping_q.h b/deal.II/deal.II/include/fe/mapping_q.h index c9caead157..0ae4531ef9 100644 --- a/deal.II/deal.II/include/fe/mapping_q.h +++ b/deal.II/deal.II/include/fe/mapping_q.h @@ -522,7 +522,7 @@ class MappingQ : public MappingQ1 * mapping of cells at the * boundary. */ - TensorProductPolynomials *tensor_pols; + const TensorProductPolynomials *tensor_pols; /** * Number of the Qp tensor @@ -536,7 +536,7 @@ class MappingQ : public MappingQ1 * numbering. Its size is * @p dofs_per_cell. */ - std::vector renumber; + const std::vector renumber; /** * If this flag is set @p true diff --git a/deal.II/deal.II/source/fe/mapping_q.cc b/deal.II/deal.II/source/fe/mapping_q.cc index cb54d08cd3..880139da6a 100644 --- a/deal.II/deal.II/source/fe/mapping_q.cc +++ b/deal.II/deal.II/source/fe/mapping_q.cc @@ -97,6 +97,22 @@ MappingQ<1>::~MappingQ () +namespace +{ + template + std::vector + get_dpo_vector (const unsigned int degree) + { + std::vector dpo(dim+1, 1U); + for (unsigned int i=1; i MappingQ::MappingQ (const unsigned int p, const bool use_mapping_q_on_all_cells) @@ -107,7 +123,10 @@ MappingQ::MappingQ (const unsigned int p, :8+12*(degree-1)+6*(degree-1)*(degree-1)), tensor_pols(0), n_shape_functions(Utilities::fixed_power(degree+1)), - renumber(0), + renumber(FETools:: + lexicographic_to_hierarchic_numbering ( + FiniteElementData (get_dpo_vector(degree), 1, + degree))), use_mapping_q_on_all_cells (use_mapping_q_on_all_cells), feq(degree) { @@ -124,25 +143,6 @@ MappingQ::MappingQ (const unsigned int p, ExcInternalError()); Assert(n_inner+n_outer==n_shape_functions, ExcInternalError()); - // build the renumbering of the - // shape functions of the Qp - // mapping. - renumber.resize(n_shape_functions,0); - // instead of creating a full FE_Q - // object to be passed to the - // lexicographic_to_hierarchic_numbering - // function we only create the - // underlying FiniteElementData - // object. We can't access - // FE_Q::get_dpo_vector as MappingQ - // is not friend of FE_Q. Create - // the dpo vector ourselve. - std::vector dpo(dim+1, 1U); - for (unsigned int i=1; i (dpo, 1, degree), renumber); - // build laplace_on_quad_vector if (degree>1) { -- 2.39.5