]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Make run in 3d as well.
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Thu, 18 Oct 2007 23:23:47 +0000 (23:23 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Thu, 18 Oct 2007 23:23:47 +0000 (23:23 +0000)
git-svn-id: https://svn.dealii.org/trunk@15347 0785d39b-7218-0410-832d-ea1e28bc413d

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

index b65ec3f140ad18886a95e4606240a31df97dd92a..ba473827763880a7751e8fab69bb8cd221c6748e 100644 (file)
@@ -563,7 +563,6 @@ void BoussinesqFlowProblem<dim>::assemble_system ()
              const Point<dim> gravity = fe_values.quadrature_point(q) /
                                         fe_values.quadrature_point(q).norm();
              
-             Assert (dim == 2, ExcInternalError());
              local_rhs(i) += (Raleigh_number *
                               gravity * phi_i_u * old_temperature)*
                              fe_values.JxW(q);
@@ -930,12 +929,38 @@ BoussinesqFlowProblem<dim>::get_maximal_velocity () const
 template <int dim>
 void BoussinesqFlowProblem<dim>::run () 
 {
-  GridGenerator::half_hyper_shell (triangulation, Point<dim>(), 0.5, 1.0);
+  switch (dim)
+    {
+      case 2:
+      {
+       GridGenerator::half_hyper_shell (triangulation,
+                                        Point<dim>(), 0.5, 1.0);
+       
+       static HalfHyperShellBoundary<dim> boundary;
+       triangulation.set_boundary (0, boundary);
+       
+       triangulation.refine_global (5);
 
-  static HalfHyperShellBoundary<dim> boundary;
-  triangulation.set_boundary (0, boundary);
+       break;
+      }
+
+      case 3:
+      {
+       GridGenerator::hyper_shell (triangulation,
+                                   Point<dim>(), 0.5, 1.0);
+       
+       static HyperShellBoundary<dim> boundary;
+       triangulation.set_boundary (0, boundary);
+       
+       triangulation.refine_global (2);
+
+       break;
+      }
+
+      default:
+           Assert (false, ExcNotImplemented());
+    }
   
-  triangulation.refine_global (5);
 
   setup_dofs();
   

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.