From: David Wells Date: Tue, 7 Jul 2015 11:40:41 +0000 (-0400) Subject: Remove 'if (true)' statements. X-Git-Tag: v8.3.0-rc1~50^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0f82bcc06aaf3148751724685ddcb429c28176cb;p=dealii.git Remove 'if (true)' statements. These are redundant and the related comment is no longer correct (there are, as of the previous commit, no new variables declared in that scope). --- diff --git a/source/base/data_out_base.cc b/source/base/data_out_base.cc index adc1b3b2f5..20586cf810 100644 --- a/source/base/data_out_base.cc +++ b/source/base/data_out_base.cc @@ -2840,13 +2840,12 @@ namespace DataOutBase if (flags.write_neighbors) out << "component \"neighbors\" value \"neighbors\"" << '\n'; - if (true) - { - out << "attribute \"created\" string \"" - << Utilities::System::get_date() - << ' ' - << Utilities::System::get_time() << '"' << '\n'; - } + { + out << "attribute \"created\" string \"" + << Utilities::System::get_date() + << ' ' + << Utilities::System::get_time() << '"' << '\n'; + } out << "end" << '\n'; // Write all binary data now @@ -2899,40 +2898,36 @@ namespace DataOutBase const unsigned int n_data_sets = data_names.size(); // write preamble - if (true) - { - // block this to have local - // variables destroyed after - // use - out << "# This file was generated by the deal.II library." << '\n' - << "# Date = " << Utilities::System::get_date() << '\n' - << "# Time = " << Utilities::System::get_time() << '\n' - << "#" << '\n' - << "# For a description of the GNUPLOT format see the GNUPLOT manual." - << '\n' - << "#" << '\n' - << "# "; + { + out << "# This file was generated by the deal.II library." << '\n' + << "# Date = " << Utilities::System::get_date() << '\n' + << "# Time = " << Utilities::System::get_time() << '\n' + << "#" << '\n' + << "# For a description of the GNUPLOT format see the GNUPLOT manual." + << '\n' + << "#" << '\n' + << "# "; - switch (spacedim) - { - case 1: - out << " "; - break; - case 2: - out << " "; - break; - case 3: - out << " "; - break; + switch (spacedim) + { + case 1: + out << " "; + break; + case 2: + out << " "; + break; + case 3: + out << " "; + break; - default: - Assert (false, ExcNotImplemented()); - } + default: + Assert (false, ExcNotImplemented()); + } - for (unsigned int i=0; i "; - out << '\n'; - } + for (unsigned int i=0; i "; + out << '\n'; + } // loop over all patches @@ -3129,50 +3124,47 @@ namespace DataOutBase (void)n_data_sets; // write preamble - if (true) - { - // block this to have local - // variables destroyed after use - out << "/* This file was generated by the deal.II library." << '\n' - << " Date = " << Utilities::System::get_date() << '\n' - << " Time = " << Utilities::System::get_time() << '\n' - << '\n' - << " For a description of the POVRAY format see the POVRAY manual." - << '\n' - << "*/ " << '\n'; + { + out << "/* This file was generated by the deal.II library." << '\n' + << " Date = " << Utilities::System::get_date() << '\n' + << " Time = " << Utilities::System::get_time() << '\n' + << '\n' + << " For a description of the POVRAY format see the POVRAY manual." + << '\n' + << "*/ " << '\n'; - // include files - out << "#include \"colors.inc\" " << '\n' - << "#include \"textures.inc\" " << '\n'; + // include files + out << "#include \"colors.inc\" " << '\n' + << "#include \"textures.inc\" " << '\n'; - // use external include file for textures, - // camera and light - if (flags.external_data) - out << "#include \"data.inc\" " << '\n'; - else // all definitions in data file - { - // camera - out << '\n' << '\n' - << "camera {" << '\n' - << " location <1,4,-7>" << '\n' - << " look_at <0,0,0>" << '\n' - << " angle 30" << '\n' - << "}" << '\n'; - - // light - out << '\n' - << "light_source {" << '\n' - << " <1,4,-7>" << '\n' - << " color Grey" << '\n' - << "}" << '\n'; - out << '\n' - << "light_source {" << '\n' - << " <0,20,0>" << '\n' - << " color White" << '\n' - << "}" << '\n'; - } - } + // use external include file for textures, + // camera and light + if (flags.external_data) + out << "#include \"data.inc\" " << '\n'; + else // all definitions in data file + { + // camera + out << '\n' << '\n' + << "camera {" << '\n' + << " location <1,4,-7>" << '\n' + << " look_at <0,0,0>" << '\n' + << " angle 30" << '\n' + << "}" << '\n'; + + // light + out << '\n' + << "light_source {" << '\n' + << " <1,4,-7>" << '\n' + << " color Grey" << '\n' + << "}" << '\n'; + out << '\n' + << "light_source {" << '\n' + << " <0,20,0>" << '\n' + << " color White" << '\n' + << "}" << '\n'; + } + } // max. and min. heigth of solution Assert(patches.size()>0, ExcInternalError()); @@ -3719,53 +3711,49 @@ namespace DataOutBase // now write preamble - if (true) - { - // block this to have local - // variables destroyed after - // use - out << "%!PS-Adobe-2.0 EPSF-1.2" << '\n' - << "%%Title: deal.II Output" << '\n' - << "%%Creator: the deal.II library" << '\n' - << "%%Creation Date: " - << Utilities::System::get_date() - << " - " - << Utilities::System::get_time() << '\n' - << "%%BoundingBox: " - // lower left corner - << "0 0 " - // upper right corner - << static_cast( (x_max-x_min) * scale + 0.5) - << ' ' - << static_cast( (y_max-y_min) * scale + 0.5) - << '\n'; + { + out << "%!PS-Adobe-2.0 EPSF-1.2" << '\n' + << "%%Title: deal.II Output" << '\n' + << "%%Creator: the deal.II library" << '\n' + << "%%Creation Date: " + << Utilities::System::get_date() + << " - " + << Utilities::System::get_time() << '\n' + << "%%BoundingBox: " + // lower left corner + << "0 0 " + // upper right corner + << static_cast( (x_max-x_min) * scale + 0.5) + << ' ' + << static_cast( (y_max-y_min) * scale + 0.5) + << '\n'; - // define some abbreviations to keep - // the output small: - // m=move turtle to - // l=define a line - // s=set rgb color - // sg=set gray value - // lx=close the line and plot the line - // lf=close the line and fill the interior - out << "/m {moveto} bind def" << '\n' - << "/l {lineto} bind def" << '\n' - << "/s {setrgbcolor} bind def" << '\n' - << "/sg {setgray} bind def" << '\n' - << "/lx {lineto closepath stroke} bind def" << '\n' - << "/lf {lineto closepath fill} bind def" << '\n'; - - out << "%%EndProlog" << '\n' - << '\n'; - // set fine lines - out << flags.line_width << " setlinewidth" << '\n'; - // allow only five digits - // for output (instead of the - // default six); this should suffice - // even for fine grids, but reduces - // the file size significantly - out << std::setprecision (5); - } + // define some abbreviations to keep + // the output small: + // m=move turtle to + // l=define a line + // s=set rgb color + // sg=set gray value + // lx=close the line and plot the line + // lf=close the line and fill the interior + out << "/m {moveto} bind def" << '\n' + << "/l {lineto} bind def" << '\n' + << "/s {setrgbcolor} bind def" << '\n' + << "/sg {setgray} bind def" << '\n' + << "/lx {lineto closepath stroke} bind def" << '\n' + << "/lf {lineto closepath fill} bind def" << '\n'; + + out << "%%EndProlog" << '\n' + << '\n'; + // set fine lines + out << flags.line_width << " setlinewidth" << '\n'; + // allow only five digits + // for output (instead of the + // default six); this should suffice + // even for fine grids, but reduces + // the file size significantly + out << std::setprecision (5); + } // check if min and max // values for the color are