]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Make run in 3d as well.
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Wed, 20 Apr 2011 15:19:52 +0000 (15:19 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Wed, 20 Apr 2011 15:19:52 +0000 (15:19 +0000)
git-svn-id: https://svn.dealii.org/trunk@23617 0785d39b-7218-0410-832d-ea1e28bc413d

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

index 6edf976d59e57ab6225a5e2c0dbc1e20a494869c..1d45c73204eb63f40aea6c8b3f6f931b4563be42 100644 (file)
@@ -130,8 +130,16 @@ BoundaryValues<dim>::value (const Point<dim>  &p,
   Assert (component < this->n_components,
          ExcIndexRange (component, 0, this->n_components));
 
-  if (component == 1)
-    return std::sin(numbers::PI*p[0]);
+  if (component == dim-1)
+    switch (dim)
+      {
+       case 2:
+             return std::sin(numbers::PI*p[0]);
+       case 3:
+             return std::sin(numbers::PI*p[0]) * std::sin(numbers::PI*p[1]);
+       default:
+             Assert (false, ExcNotImplemented());
+      }
 
   return 0;
 }
@@ -340,11 +348,11 @@ FluidStructureProblem<dim>::setup_subdomains ()
        cell != dof_handler.end(); ++cell)
     if (((std::fabs(cell->center()[0]) < 0.25)
          &&
-         (cell->center()[1] > 0.5))
+         (cell->center()[dim-1] > 0.5))
        ||
        ((std::fabs(cell->center()[0]) >= 0.25)
         &&
-        (cell->center()[1] > -0.5)))
+        (cell->center()[dim-1] > -0.5)))
       cell->set_active_fe_index (0);
     else
       cell->set_active_fe_index (1);
@@ -786,9 +794,9 @@ void FluidStructureProblem<dim>::run ()
          &&
          (cell->face(f)->center()[dim-1] == 1))
        cell->face(f)->set_all_boundary_indicators(1);
-  triangulation.refine_global (3);
+  triangulation.refine_global (5-dim);
 
-  for (unsigned int refinement_cycle = 0; refinement_cycle<6;
+  for (unsigned int refinement_cycle = 0; refinement_cycle<10-2*dim;
        ++refinement_cycle)
     {
       std::cout << "Refinement cycle " << refinement_cycle << std::endl;

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.