]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Minor modifications to two functions.
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Sat, 11 Apr 2009 21:54:24 +0000 (21:54 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Sat, 11 Apr 2009 21:54:24 +0000 (21:54 +0000)
git-svn-id: https://svn.dealii.org/trunk@18587 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/examples/step-34/step-34.cc

index 8c448701941bc9283b5a7e8ca9ed366504ea6fb3..1494137770721dd7cb56c3292626b9a22ab8d716 100644 (file)
@@ -464,19 +464,20 @@ double LaplaceKernel<dim>::single_layer(const Point<dim> &R,
 template <int dim>
 Point<dim> LaplaceKernel<dim>::double_layer(const Point<dim> &R,
                                             bool factor_out_2d_singularity) {
-    Point<dim> D(R);
-    switch(dim) {
+  switch(dim) {
     case 2:
-        factor_out_2d_singularity ?  D *= 0  : D /=  -2*numbers::PI * R.square();
-        break;
+         if (factor_out_2d_singularity)
+           return Point<dim>();
+         else
+           return R / (-2*numbers::PI * R.square());
     case 3:
-        D /= ( -4*numbers::PI * R.square()*R.norm() );
-        break;
-    default:
+         return R / ( -4*numbers::PI * R.square()*R.norm() );
+
+      default:
         Assert(false, ExcInternalError());
         break;
     }
-    return D;
+  return Point<dim>();
 }
         
 template <int dim>
@@ -512,15 +513,24 @@ void BEMProblem<dim>::read_domain() {
     
     static HyperBallBoundary<dim-1, dim> boundary(Point<dim>(),1.);    
 
+    std::ifstream in;
+    switch (dim)
+      {
+       case 2:
+             in.open ("coarse_circle.inp");
+             break;
+             
+       case 3:
+             in.open ("coarse_sphere.inp");
+             break;
+
+       default:
+             Assert (false, ExcNotImplemented());
+      }
+
     GridIn<dim-1, dim> gi;
     gi.attach_triangulation (tria);
-    if(dim == 3) {
-        std::ifstream in ("coarse_sphere.inp");
-        gi.read_ucd (in);
-    } else if(dim == 2) {
-        std::ifstream in ("coarse_circle.inp");
-        gi.read_ucd (in);
-    }
+    gi.read_ucd (in);
     tria.set_boundary(1, boundary);
 }
 

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.