]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Use abstract names for the subdomains.
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Sat, 23 Apr 2011 03:31:58 +0000 (03:31 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Sat, 23 Apr 2011 03:31:58 +0000 (03:31 +0000)
git-svn-id: https://svn.dealii.org/trunk@23636 0785d39b-7218-0410-832d-ea1e28bc413d

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

index 718455050c1cb8ee37dcabe257ed1282c7c5314e..d0bbdc304e76b19ab6eb5390f5350c5f52c3fbed 100644 (file)
@@ -92,6 +92,12 @@ class FluidStructureProblem
     void run ();
 
   private:
+    enum
+    {
+         fluid_domain_id,
+         solid_domain_id
+    };
+    
     static bool
     cell_is_in_fluid_domain (const typename hp::DoFHandler<dim>::cell_iterator &cell);
 
@@ -189,7 +195,7 @@ StokesBoundaryValues<dim>::value (const Point<dim>  &p,
 template <int dim>
 void
 StokesBoundaryValues<dim>::vector_value (const Point<dim> &p,
-                                  Vector<double>   &values) const
+                                        Vector<double>   &values) const
 {
   for (unsigned int c=0; c<this->n_components; ++c)
     values(c) = StokesBoundaryValues<dim>::value (p, c);
@@ -270,7 +276,7 @@ bool
 FluidStructureProblem<dim>::
 cell_is_in_fluid_domain (const typename hp::DoFHandler<dim>::cell_iterator &cell)
 {
-  return (cell->material_id() == 0);
+  return (cell->material_id() == fluid_domain_id);
 }
 
 
@@ -279,7 +285,7 @@ bool
 FluidStructureProblem<dim>::
 cell_is_in_solid_domain (const typename hp::DoFHandler<dim>::cell_iterator &cell)
 {
-  return (cell->material_id() == 1);
+  return (cell->material_id() == solid_domain_id);
 }
 
 
@@ -312,9 +318,9 @@ FluidStructureProblem<dim>::make_grid ()
        ((std::fabs(cell->center()[0]) >= 0.25)
         &&
         (cell->center()[dim-1] > -0.5)))
-      cell->set_material_id (0);
+      cell->set_material_id (fluid_domain_id);
     else
-      cell->set_material_id (1);
+      cell->set_material_id (solid_domain_id);
 }
 
 

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.