]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Simplify fixed_power.
authorkronbichler <kronbichler@0785d39b-7218-0410-832d-ea1e28bc413d>
Sat, 24 Nov 2012 14:58:27 +0000 (14:58 +0000)
committerkronbichler <kronbichler@0785d39b-7218-0410-832d-ea1e28bc413d>
Sat, 24 Nov 2012 14:58:27 +0000 (14:58 +0000)
git-svn-id: https://svn.dealii.org/trunk@27678 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/source/fe/fe_q.cc

index 658c50314611c5f582e98b79692820fccb5289c7..93b8de41dc9570513f0479f8201313c88f9c3cd5 100644 (file)
@@ -1368,13 +1368,7 @@ template <int dim, int spacedim>
 void FE_Q<dim,spacedim>::initialize_unit_face_support_points ()
 {
   const unsigned int codim = dim-1;
-
-  // number of points: (degree+1)^codim
-  unsigned int n = this->degree+1;
-  for (unsigned int i=1; i<codim; ++i)
-    n *= this->degree+1;
-
-  this->unit_face_support_points.resize(n);
+  this->unit_face_support_points.resize(Utilities::fixed_power<codim>(this->degree+1));
 
   const std::vector<unsigned int> &face_index_map_inverse=
     FE_Q_Helper::invert_numbering(face_index_map);
@@ -1403,15 +1397,9 @@ template <int dim, int spacedim>
 void FE_Q<dim,spacedim>::initialize_unit_face_support_points (const Quadrature<1> &points)
 {
   const unsigned int codim = dim-1;
+  this->unit_face_support_points.resize(Utilities::fixed_power<codim>(this->degree+1));
 
-  // number of points: (degree+1)^codim
-  unsigned int n = this->degree+1;
-  for (unsigned int i=1; i<codim; ++i)
-    n *= this->degree+1;
-
-  this->unit_face_support_points.resize(n);
-
-  const std::vector< Point<1> > edge = points.get_points();
+  const std::vector< Point<1> > &edge = points.get_points();
 
   const std::vector<unsigned int> &face_index_map_inverse=
     FE_Q_Helper::invert_numbering(face_index_map);

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.