]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Simplify FE_BDM::get_dpo_vector() somewhat. 3793/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Sat, 14 Jan 2017 05:06:02 +0000 (22:06 -0700)
committerWolfgang Bangerth <bangerth@colostate.edu>
Sat, 14 Jan 2017 16:51:56 +0000 (09:51 -0700)
In particular, make it a bit easier to read.

source/fe/fe_bdm.cc

index 6a72ac67a78014ccf732678904c6a1d1e3e54abc..0312a36583f1f6120a8e590f0f2e18f6053fbe7c 100644 (file)
@@ -231,21 +231,21 @@ template <int dim>
 std::vector<unsigned int>
 FE_BDM<dim>::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<dim-1>::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<dim>::compute_n_pols(deg-1);
 
-  std::vector<unsigned int> dpo(dim+1);
-  dpo[dim-1] = dofs_per_face;
-  dpo[dim]   = interior_dofs;
+  std::vector<unsigned int> dpo(dim+1, 0u);
+  dpo[dim]   = (deg > 1 ?
+                dim * PolynomialSpace<dim>::compute_n_pols(deg-1) :
+                0u);
+  dpo[dim-1] = PolynomialSpace<dim-1>::compute_n_pols(deg+1);
 
   return dpo;
 }

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.