]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Minor code cleanups. 2741/head
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Thu, 30 Jun 2016 17:49:12 +0000 (12:49 -0500)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Thu, 30 Jun 2016 17:49:12 +0000 (12:49 -0500)
source/grid/manifold_lib.cc

index 4031bd58f193a2c8924896035972e80653a8d9a4..1a8e0a4e361be7d9fade1b565d1f55f1b2ec6030 100644 (file)
@@ -116,10 +116,13 @@ SphericalManifold<dim,spacedim>::pull_back(const Point<spacedim> &space_point) c
   switch (spacedim)
     {
     case 2:
+    {
       p[1] = atan2(R[1],R[0]);
       if (p[1] < 0)
         p[1] += 2*numbers::PI;
       break;
+    }
+
     case 3:
     {
       const double z = R[2];
@@ -127,10 +130,11 @@ SphericalManifold<dim,spacedim>::pull_back(const Point<spacedim> &space_point) c
       if (p[2] < 0)
         p[2] += 2*numbers::PI; // phi is periodic
       p[1] = atan2(sqrt(R[0]*R[0]+R[1]*R[1]),z);  // theta
+      break;
     }
-    break;
+
     default:
-      Assert(false, ExcInternalError());
+      Assert(false, ExcNotImplemented());
     }
   return p;
 }
@@ -140,7 +144,7 @@ template <int dim, int spacedim>
 DerivativeForm<1,spacedim,spacedim>
 SphericalManifold<dim,spacedim>::push_forward_gradient(const Point<spacedim> &spherical_point) const
 {
-  Assert(spherical_point[0] >=0.0,
+  Assert(spherical_point[0] >= 0.0,
          ExcMessage("Negative radius for given point."));
   const double rho = spherical_point[0];
   const double theta = spherical_point[1];
@@ -150,11 +154,14 @@ SphericalManifold<dim,spacedim>::push_forward_gradient(const Point<spacedim> &sp
     switch (spacedim)
       {
       case 2:
+      {
         DX[0][0] = cos(theta);
         DX[0][1] = -rho*sin(theta);
         DX[1][0] = sin(theta);
         DX[1][1] = rho*cos(theta);
         break;
+      }
+
       case 3:
       {
         const double phi= spherical_point[2];
@@ -171,8 +178,9 @@ SphericalManifold<dim,spacedim>::push_forward_gradient(const Point<spacedim> &sp
         DX[2][2] = 0;
         break;
       }
+
       default:
-        Assert(false, ExcInternalError());
+        Assert(false, ExcNotImplemented());
       }
   return DX;
 }

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.