]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Simplify code a bit.
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 14 Dec 2006 17:45:22 +0000 (17:45 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 14 Dec 2006 17:45:22 +0000 (17:45 +0000)
git-svn-id: https://svn.dealii.org/trunk@14245 0785d39b-7218-0410-832d-ea1e28bc413d

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

index ac0fa71ee8157d99da26212adb26ce3378c5b7be..89deda111f1da2dd816260892927219a38553a75 100644 (file)
@@ -65,6 +65,7 @@ class LaplaceProblem
     void setup_system ();
     void assemble_system ();
     void solve ();
+    void create_coarse_grid ();
     void refine_grid ();
     void output_results (const unsigned int cycle) const;
 
@@ -255,10 +256,11 @@ void LaplaceProblem<dim>::output_results (const unsigned int cycle) const
 }
 
 
-void
-create_coarse_grid (Triangulation<2> &coarse_grid)
+template <>
+void LaplaceProblem<2>::create_coarse_grid ()
 {
   const unsigned int dim = 2;
+  
   static const Point<2> vertices_1[]
     = {  Point<2> (-1.,   -1.),
          Point<2> (-1./2, -1.),
@@ -318,10 +320,10 @@ create_coarse_grid (Triangulation<2> &coarse_grid)
       cells[i].material_id = 0;
     }
 
-  coarse_grid.create_triangulation (vertices,
+  triangulation.create_triangulation (vertices,
                                     cells,
                                     SubCellData());
-  coarse_grid.refine_global (1);
+  triangulation.refine_global (1);
 }
 
 
@@ -334,7 +336,7 @@ void LaplaceProblem<dim>::run ()
       std::cout << "Cycle " << cycle << ':' << std::endl;
 
       if (cycle == 0)
-       create_coarse_grid (triangulation);
+       create_coarse_grid ();
       else
        refine_grid ();
       

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.