From: hartmann Date: Wed, 12 Sep 2001 12:23:48 +0000 (+0000) Subject: output of grids on 2 refinement levels. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dfdcea5ca83294b6ef875af9104faa5a07f260b8;p=dealii-svn.git output of grids on 2 refinement levels. git-svn-id: https://svn.dealii.org/trunk@4968 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/examples/step-10/step-10.cc b/deal.II/examples/step-10/step-10.cc index 12f35c6f52..f31f41b4d6 100644 --- a/deal.II/examples/step-10/step-10.cc +++ b/deal.II/examples/step-10/step-10.cc @@ -144,11 +144,8 @@ template void gnuplot_output() { cout << "Output of grids as gnuplot file:" << std::endl; - Triangulation triangulation; - GridGenerator::hyper_ball (triangulation); static const HyperBallBoundary 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 triangulation; + GridGenerator::hyper_ball (triangulation); + triangulation.set_boundary (0, boundary); const MappingQ 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);