]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Simplify some code.
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Wed, 19 Oct 2005 15:19:44 +0000 (15:19 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Wed, 19 Oct 2005 15:19:44 +0000 (15:19 +0000)
git-svn-id: https://svn.dealii.org/trunk@11627 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/source/fe/fe_raviart_thomas_nodal.cc

index a64af0bf83f615d3a59aa33c6ced880ec631c006..dccd6ec23d258ed6a7bc067d5dad7148ca9a6adf 100644 (file)
@@ -377,16 +377,21 @@ FE_RaviartThomasNodal<dim>::initialize_support_points (const unsigned int deg)
 
   for (unsigned int d=0;d<dim;++d)
     {
-      QAnisotropic<dim>* quadrature;
-      if (dim == 1) quadrature = new QAnisotropic<dim>(high);
-      if (dim == 2) quadrature = new QAnisotropic<dim>(((d==0) ? low : high),
-                                                      ((d==1) ? low : high));
-      if (dim == 3) quadrature = new QAnisotropic<dim>(((d==0) ? low : high),
-                                                      ((d==1) ? low : high),
-                                                      ((d==2) ? low : high));
-      for (unsigned int k=0;k<quadrature->n_quadrature_points;++k)
-       this->generalized_support_points[current++] = quadrature->point(k);
-      delete quadrature;
+      const QAnisotropic<dim>
+        quadrature (dim == 1 ?
+                    QAnisotropic<dim>(high) :
+                    (dim == 2 ?
+                     QAnisotropic<dim>(((d==0) ? low : high),
+                                       ((d==1) ? low : high)) :
+                     (dim == 3 ?
+                      QAnisotropic<dim>(((d==0) ? low : high),
+                                        ((d==1) ? low : high),
+                                        ((d==2) ? low : high))
+                      :
+                      throw ExcNotImplemented())));
+      
+      for (unsigned int k=0;k<quadrature.n_quadrature_points;++k)
+       this->generalized_support_points[current++] = quadrature.point(k);
     }
   Assert (current == this->dofs_per_cell, ExcInternalError());
 }

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.