From 1d5df0407c6c4b2c63588893b07063d17a121868 Mon Sep 17 00:00:00 2001
From: Wolfgang Bangerth <bangerth@math.tamu.edu>
Date: Mon, 28 Jan 2008 20:50:43 +0000
Subject: [PATCH] Make run in 3d as well.

git-svn-id: https://svn.dealii.org/trunk@15696 0785d39b-7218-0410-832d-ea1e28bc413d
---
 deal.II/examples/step-31/step-31.cc | 58 ++++++++++++-----------------
 1 file changed, 24 insertions(+), 34 deletions(-)

diff --git a/deal.II/examples/step-31/step-31.cc b/deal.II/examples/step-31/step-31.cc
index 1fea326201..095c1e9b24 100644
--- a/deal.II/examples/step-31/step-31.cc
+++ b/deal.II/examples/step-31/step-31.cc
@@ -553,7 +553,7 @@ void StokesProblem<dim>::assemble_system ()
     std::vector<bool> component_mask (dim+1, true);
     component_mask[dim] = false;
     VectorTools::interpolate_boundary_values (dof_handler,
-					      3,
+					      1,
 					      BoundaryValues<dim>(),
 					      boundary_values,
 					      component_mask);
@@ -694,41 +694,31 @@ StokesProblem<dim>::refine_mesh ()
 template <int dim>
 void StokesProblem<dim>::run () 
 {
-  switch (dim)
-    {
-      case 2:
-      {
-	std::vector<unsigned int> subdivisions (dim, 1);
-	subdivisions[0] = 4;
-	
-	GridGenerator::subdivided_hyper_rectangle (triangulation,
-						   subdivisions,
-						   Point<dim>(-2,-1),
-						   Point<dim>(2,0),
-						   true);
-	
-	triangulation.refine_global (2);
-
-	break;
-      }
-
-      case 3:
-      {
-	GridGenerator::hyper_shell (triangulation,
-				    Point<dim>(), 0.5, 1.0);
+  std::vector<unsigned int> subdivisions (dim, 1);
+  subdivisions[0] = 4;
 	
-	static HyperShellBoundary<dim> boundary;
-	triangulation.set_boundary (0, boundary);
-	
-	triangulation.refine_global (2);
-
-	break;
-      }
-
-      default:
-	    Assert (false, ExcNotImplemented());
-    }
+  GridGenerator::subdivided_hyper_rectangle (triangulation,
+					     subdivisions,
+					     (dim == 2 ?
+					      Point<dim>(-2,-1) :
+					      Point<dim>(-2,0,-1)),
+					     (dim == 2 ?
+					      Point<dim>(2,0) :
+					      Point<dim>(2,1,0)));
+  for (typename Triangulation<dim>::active_cell_iterator
+	 cell = triangulation.begin_active();
+       cell != triangulation.end(); ++cell)
+    for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
+      if (cell->face(f)->center()[dim-1] == 0)
+	{
+	  cell->face(f)->set_boundary_indicator(1);
+	  
+// 	  for (unsigned int e=0; e<GeometryInfo<dim>::lines_per_face; ++e)
+// 	    cell->face(f)->line(e)->set_boundary_indicator (1);
+	}
+  
   
+  triangulation.refine_global (4-dim);
 
   for (unsigned int refinement_cycle = 0; refinement_cycle<9;
        ++refinement_cycle)
-- 
2.39.5