From 471b9f87f8bf1a2dd27f1b9b2dd67f2a66fb3c06 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Fri, 13 Jan 2017 22:06:02 -0700 Subject: [PATCH] Simplify FE_BDM::get_dpo_vector() somewhat. In particular, make it a bit easier to read. --- source/fe/fe_bdm.cc | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/source/fe/fe_bdm.cc b/source/fe/fe_bdm.cc index 6a72ac67a7..0312a36583 100644 --- a/source/fe/fe_bdm.cc +++ b/source/fe/fe_bdm.cc @@ -231,21 +231,21 @@ template std::vector FE_BDM::get_dpo_vector (const unsigned int deg) { + // compute the number of unknowns per cell interior/face/edge + // + // for the number of interior dofs, this is the number of + // polynomials up to degree deg-2 in dim dimensions. + // // the element is face-based and we have as many degrees of freedom // on the faces as there are polynomials of degree up to // deg. Observe the odd convention of // PolynomialSpace::compute_n_pols()! - unsigned int dofs_per_face = PolynomialSpace::compute_n_pols(deg+1); - - // and then there are interior dofs, namely the number of - // polynomials up to degree deg-2 in dim dimensions. - unsigned int interior_dofs = 0; - if (deg>1) - interior_dofs = dim * PolynomialSpace::compute_n_pols(deg-1); - std::vector dpo(dim+1); - dpo[dim-1] = dofs_per_face; - dpo[dim] = interior_dofs; + std::vector dpo(dim+1, 0u); + dpo[dim] = (deg > 1 ? + dim * PolynomialSpace::compute_n_pols(deg-1) : + 0u); + dpo[dim-1] = PolynomialSpace::compute_n_pols(deg+1); return dpo; } -- 2.39.5