]> https://gitweb.dealii.org/ - dealii.git/commitdiff
output of grids on 2 refinement levels.
authorRalf Hartmann <Ralf.Hartmann@dlr.de>
Wed, 12 Sep 2001 12:23:48 +0000 (12:23 +0000)
committerRalf Hartmann <Ralf.Hartmann@dlr.de>
Wed, 12 Sep 2001 12:23:48 +0000 (12:23 +0000)
git-svn-id: https://svn.dealii.org/trunk@4968 0785d39b-7218-0410-832d-ea1e28bc413d

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

index 12f35c6f5273a91b7d9eeeb0eaf6ab4e5b31f4a5..f31f41b4d6f99182895a1a59da1266df6a0b57df 100644 (file)
@@ -144,11 +144,8 @@ template <int dim>
 void gnuplot_output()
 {
   cout << "Output of grids as gnuplot file:" << std::endl;
-  Triangulation<dim> triangulation;
-  GridGenerator::hyper_ball (triangulation);
   
   static const HyperBallBoundary<dim> boundary;
-  triangulation.set_boundary (0, boundary);
   
   GridOut grid_out;
                                   // on boundary faces plot 30
@@ -156,22 +153,35 @@ void gnuplot_output()
   GridOutFlags::Gnuplot gnuplot_flags(false, 30);
   grid_out.set_flags(gnuplot_flags);
   
-  
+
   for (unsigned int order=1; order<4; ++order)
     {
       cout << "Order = " << order << std::endl;
+
+      Triangulation<dim> triangulation;
+      GridGenerator::hyper_ball (triangulation);
+      triangulation.set_boundary (0, boundary);
       
       const MappingQ<dim> mapping (order);
-      string filename="ball_mapping_q";
-      filename += ('0'+order);
-      filename += ".dat";
-      ofstream gnuplot_file(filename.c_str());
+      string filename_base="ball_mapping_q";
+      filename_base += ('0'+order);
+
       
-      grid_out.write_gnuplot(triangulation, gnuplot_file, &mapping);  
+      for (unsigned int refinement=0; refinement<2;
+          ++refinement, triangulation.refine_global(1))
+       {         
+         string filename=filename_base+"_ref";
+         filename += ('0'+refinement);
+         filename += ".dat";
+         ofstream gnuplot_file(filename.c_str());
+
+         grid_out.write_gnuplot(triangulation, gnuplot_file, &mapping);
+       }
     }
 }
 
 
+
 int main () 
 {
   cout.precision (16);

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.