]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Avoid using std::endl, since it calls flush() -- which we don't really need after...
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Tue, 20 Dec 2005 23:23:08 +0000 (23:23 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Tue, 20 Dec 2005 23:23:08 +0000 (23:23 +0000)
Instead of std::endl therefore use '\n' and explicitly call flush() at the end of output functions.

git-svn-id: https://svn.dealii.org/trunk@11902 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/base/source/data_out_base.cc
deal.II/deal.II/source/grid/grid_out.cc

index 0175547eb09ff4864ee323223f135098acffb33b..e8ddf277cec7335d851de2daea2041da032dc700 100644 (file)
@@ -737,19 +737,19 @@ void DataOutBase::write_ucd (const std::vector<Patch<dim,spacedim> > &patches,
     {
       std::time_t  time1= std::time (0);
       std::tm     *time = std::localtime(&time1); 
-      out << "# This file was generated by the deal.II library." << std::endl
+      out << "# This file was generated by the deal.II library." << '\n'
          << "# Date =  "
          << time->tm_year+1900 << "/"
          << time->tm_mon+1 << "/"
-         << time->tm_mday << std::endl
+         << time->tm_mday << '\n'
          << "# Time =  "
          << time->tm_hour << ":"
          << std::setw(2) << time->tm_min << ":"
-         << std::setw(2) << time->tm_sec << std::endl
-         << "#" << std::endl
+         << std::setw(2) << time->tm_sec << '\n'
+         << "#" << '\n'
          << "# For a description of the UCD format see the AVS Developer's guide."
-         << std::endl
-         << "#" << std::endl;
+         << '\n'
+         << "#" << '\n';
     }
 
                                   // start with ucd data
@@ -758,7 +758,7 @@ void DataOutBase::write_ucd (const std::vector<Patch<dim,spacedim> > &patches,
       << n_data_sets << ' '
       << 0 << ' '                  // no cell data at present
       << 0                         // no model data
-      << std::endl;
+      << '\n';
 
                                   ///////////////////////////////
                                   // first make up the list of used
@@ -798,7 +798,7 @@ void DataOutBase::write_ucd (const std::vector<Patch<dim,spacedim> > &patches,
                                                     // fill with zeroes
                    for (unsigned int i=spacedim; i<3; ++i)
                      out << "0 ";
-                   out << std::endl;
+                   out << '\n';
                  }
                
                break;
@@ -829,7 +829,7 @@ void DataOutBase::write_ucd (const std::vector<Patch<dim,spacedim> > &patches,
                                                       // fill with zeroes
                      for (unsigned int i=spacedim; i<3; ++i)
                        out << "0 ";
-                     out << std::endl;
+                     out << '\n';
 
                      ++present_node;
                    }
@@ -877,7 +877,7 @@ void DataOutBase::write_ucd (const std::vector<Patch<dim,spacedim> > &patches,
                                                         // fill with zeroes unnecessary here
                        for (unsigned int i=spacedim; i<3; ++i)
                          out << "0 ";
-                       out << std::endl;
+                       out << '\n';
                        
                        ++present_node;
                      }
@@ -918,7 +918,7 @@ void DataOutBase::write_ucd (const std::vector<Patch<dim,spacedim> > &patches,
                  out << present_cell
                      << " 0  line  "        // set material id to 0
                      << first_vertex_of_patch+i+1 << ' '
-                     << first_vertex_of_patch+i+1+1 << std::endl;
+                     << first_vertex_of_patch+i+1+1 << '\n';
                break;
              }
               
@@ -933,7 +933,7 @@ void DataOutBase::write_ucd (const std::vector<Patch<dim,spacedim> > &patches,
                          << first_vertex_of_patch+(i+1)*(n_subdivisions+1)+j+1 << ' '
                          << first_vertex_of_patch+(i+1)*(n_subdivisions+1)+j+1+1 << ' '
                          << first_vertex_of_patch+i*(n_subdivisions+1)+j+1+1
-                         << std::endl;
+                         << '\n';
                      ++present_cell;
                    }
                break;
@@ -956,7 +956,7 @@ void DataOutBase::write_ucd (const std::vector<Patch<dim,spacedim> > &patches,
                            << first_vertex_of_patch+((i+1)*(n_subdivisions+1)+j  )*(n_subdivisions+1)+k+1+1 << ' '
                            << first_vertex_of_patch+((i+1)*(n_subdivisions+1)+j+1)*(n_subdivisions+1)+k+1+1 << ' '
                            << first_vertex_of_patch+(i*(n_subdivisions+1)+j+1    )*(n_subdivisions+1)+k+1+1 << ' '
-                           << std::endl;
+                           << '\n';
                        ++present_cell;
                      }
                break;
@@ -987,7 +987,7 @@ void DataOutBase::write_ucd (const std::vector<Patch<dim,spacedim> > &patches,
                    Assert (false, ExcNotImplemented());
            }
        }
-      out << std::endl;
+      out << '\n';
 
                                       // note that we number starting with 1!
       Assert (present_cell == n_cells+1,
@@ -1003,12 +1003,12 @@ void DataOutBase::write_ucd (const std::vector<Patch<dim,spacedim> > &patches,
       for (unsigned int i=0; i<n_data_sets; ++i)
        out << 1 << ' ';               // number of components;
                                       // only 1 supported presently
-      out << std::endl;
+      out << '\n';
 
       for (unsigned int data_set=0; data_set<n_data_sets; ++data_set)
        out << data_names[data_set]
            << ",dimensionless"      // no units supported at present
-           << std::endl;
+           << '\n';
 
 
                                       // loop over all patches
@@ -1040,7 +1040,7 @@ void DataOutBase::write_ucd (const std::vector<Patch<dim,spacedim> > &patches,
                    for (unsigned int data_set=0; data_set<n_data_sets; ++data_set)
                      out << patch->data(data_set,i) << ' ';
 
-                   out << std::endl;
+                   out << '\n';
                  }
            
                break;
@@ -1056,7 +1056,7 @@ void DataOutBase::write_ucd (const std::vector<Patch<dim,spacedim> > &patches,
                      for (unsigned int data_set=0; data_set<n_data_sets; ++data_set)
                        out << patch->data(data_set,i*(n_subdivisions+1) + j) << ' ';
 
-                     out << std::endl;
+                     out << '\n';
 
                      ++present_node;
                    }
@@ -1077,7 +1077,7 @@ void DataOutBase::write_ucd (const std::vector<Patch<dim,spacedim> > &patches,
                                             (i*(n_subdivisions+1)+j)*(n_subdivisions+1)+k)
                              << ' ';
                        
-                       out << std::endl;
+                       out << '\n';
                        
                        ++present_node;
                      }
@@ -1093,6 +1093,10 @@ void DataOutBase::write_ucd (const std::vector<Patch<dim,spacedim> > &patches,
 
                                   // no model data
 
+                                  // make sure everything now gets to
+                                  // disk
+  out.flush ();
+  
                                   // assert the stream is still ok
   AssertThrow (out, ExcIO());
 }
@@ -1145,7 +1149,7 @@ void DataOutBase::write_dx (const std::vector<Patch<dim,spacedim> > &patches,
                                   // lexicographical, x varying
                                   // fastest
   out << "object \"vertices\" class array type float rank 1 shape " << spacedim
-      << " items " << n_nodes << " data follows" << std::endl;
+      << " items " << n_nodes << " data follows" << '\n';
 
                                   ///////////////////////////////
                                   // first write the coordinates of all vertices
@@ -1171,7 +1175,7 @@ void DataOutBase::write_dx (const std::vector<Patch<dim,spacedim> > &patches,
                                                     // write out coordinates
                    for (unsigned int i=0; i<spacedim; ++i)
                      out << node(i) << '\t';
-                   out << std::endl;
+                   out << '\n';
                  }
                
                break;
@@ -1196,7 +1200,7 @@ void DataOutBase::write_dx (const std::vector<Patch<dim,spacedim> > &patches,
                                                       // write out coordinates
                      for (unsigned int i=0; i<spacedim; ++i)
                        out << node(i) << '\t';
-                     out << std::endl;
+                     out << '\n';
                    }
              
                break;
@@ -1234,7 +1238,7 @@ void DataOutBase::write_dx (const std::vector<Patch<dim,spacedim> > &patches,
                                                         // write out coordinates
                        for (unsigned int i=0; i<spacedim; ++i)
                          out << node(i) << '\t';
-                       out << std::endl;
+                       out << '\n';
                      }
              
                break;
@@ -1250,7 +1254,7 @@ void DataOutBase::write_dx (const std::vector<Patch<dim,spacedim> > &patches,
                                   // write cells
   out << "object \"cells\" class array type int rank 1 shape " << GeometryInfo<dim>::vertices_per_cell
       << " items " << n_cells << " data follows"
-      << std::endl;
+      << '\n';
   
   if (true)
     {
@@ -1270,7 +1274,7 @@ void DataOutBase::write_dx (const std::vector<Patch<dim,spacedim> > &patches,
                  {
                    for (unsigned int i=0; i<n_subdivisions; ++i)
                      out << first_vertex_of_patch+i << '\t'
-                         << first_vertex_of_patch+i+1 << std::endl;
+                         << first_vertex_of_patch+i+1 << '\n';
                  }
                break;
              case 2:
@@ -1283,7 +1287,7 @@ void DataOutBase::write_dx (const std::vector<Patch<dim,spacedim> > &patches,
                              << first_vertex_of_patch+i*(n_subdivisions+1)+j+1 << '\t'
                              << first_vertex_of_patch+(i+1)*(n_subdivisions+1)+j << '\t'
                              << first_vertex_of_patch+(i+1)*(n_subdivisions+1)+j+1
-                             << std::endl;
+                             << '\n';
                        }
                  }
                break;
@@ -1305,7 +1309,7 @@ void DataOutBase::write_dx (const std::vector<Patch<dim,spacedim> > &patches,
                              << first_vertex_of_patch+((i+1)*nvt+j+1)*nvt+k   << '\t'
                              << first_vertex_of_patch+((i+1)*nvt+j+1)*nvt+k+1 << '\t'
                              ;
-                           out << std::endl;
+                           out << '\n';
                          }
                  }
                break;
@@ -1334,15 +1338,15 @@ void DataOutBase::write_dx (const std::vector<Patch<dim,spacedim> > &patches,
                    Assert (false, ExcNotImplemented());
            }
        }
-      out << std::endl;
+      out << '\n';
     }
 
   out << "attribute \"element type\" string \"";
   if (dim==1) out << "lines";
   if (dim==2) out << "quads";
   if (dim==3) out << "cubes";
-  out << "\"" << std::endl
-      << "attribute \"ref\" string \"positions\"" << std::endl;
+  out << "\"" << '\n'
+      << "attribute \"ref\" string \"positions\"" << '\n';
 
 //TODO:[GK] Patches must be of same size!
                                   /////////////////////////////
@@ -1386,7 +1390,7 @@ void DataOutBase::write_dx (const std::vector<Patch<dim,spacedim> > &patches,
                  const unsigned int ny = iy*dy;
                  const unsigned int nz = iz*dz;
 
-                 out << std::endl;
+                 out << '\n';
                                                   // Direction -x
                                                   // Last cell in row
                                                   // of other patch
@@ -1475,7 +1479,7 @@ void DataOutBase::write_dx (const std::vector<Patch<dim,spacedim> > &patches,
                          << patch_start+nx+ny+nz+dz;
                    }
                }
-         out << std::endl;       
+         out << '\n';    
        }
     }
                                   /////////////////////////////
@@ -1484,7 +1488,7 @@ void DataOutBase::write_dx (const std::vector<Patch<dim,spacedim> > &patches,
     {      
       out << "object \"data\" class array type float rank 1 shape "
          << n_data_sets
-         << " items " << n_nodes << " data follows" << std::endl;
+         << " items " << n_nodes << " data follows" << '\n';
 
                                       // loop over all patches
       for (typename std::vector<Patch<dim,spacedim> >::const_iterator patch=patches.begin();
@@ -1511,7 +1515,7 @@ void DataOutBase::write_dx (const std::vector<Patch<dim,spacedim> > &patches,
                  {
                    for (unsigned int data_set=0; data_set<n_data_sets; ++data_set)
                      out << patch->data(data_set,i) << '\t';
-                   out << std::endl;
+                   out << '\n';
                  }
            
                break;
@@ -1524,7 +1528,7 @@ void DataOutBase::write_dx (const std::vector<Patch<dim,spacedim> > &patches,
                    {
                      for (unsigned int data_set=0; data_set<n_data_sets; ++data_set)
                        out << patch->data(data_set,i*(n_subdivisions+1) + j) << '\t';
-                     out << std::endl;
+                     out << '\n';
                    }
 
                break;
@@ -1540,7 +1544,7 @@ void DataOutBase::write_dx (const std::vector<Patch<dim,spacedim> > &patches,
                          out << patch->data(data_set,
                                             (i*(n_subdivisions+1)+j)*(n_subdivisions+1)+k)
                              << '\t';
-                       out << std::endl;
+                       out << '\n';
                      }
 
                break;
@@ -1550,21 +1554,21 @@ void DataOutBase::write_dx (const std::vector<Patch<dim,spacedim> > &patches,
                    Assert (false, ExcNotImplemented());
            }
        }
-      out << "attribute \"dep\" string \"positions\"" << std::endl;
+      out << "attribute \"dep\" string \"positions\"" << '\n';
     } else {
       out << "object \"data\" class constantarray type float rank 0 items " << n_nodes << " data follows"
-         << std::endl << '0' << std::endl;
+         << '\n' << '0' << '\n';
     }
   
                                   // no model data
   
-  out << "object \"deal data\" class field" << std::endl
-      << "component \"positions\" value \"vertices\"" << std::endl
-      << "component \"connections\" value \"cells\"" << std::endl
-      << "component \"data\" value \"data\"" << std::endl;
+  out << "object \"deal data\" class field" << '\n'
+      << "component \"positions\" value \"vertices\"" << '\n'
+      << "component \"connections\" value \"cells\"" << '\n'
+      << "component \"data\" value \"data\"" << '\n';
 
   if (flags.write_neighbors)
-    out << "component \"neighbors\" value \"neighbors\"" << std::endl;
+    out << "component \"neighbors\" value \"neighbors\"" << '\n';
 
   if (true)
     {
@@ -1577,10 +1581,14 @@ void DataOutBase::write_dx (const std::vector<Patch<dim,spacedim> > &patches,
          << ' '
          << time->tm_hour << ":"
          << std::setw(2) << time->tm_min << ":"
-         << std::setw(2) << time->tm_sec << '"' << std::endl;
+         << std::setw(2) << time->tm_sec << '"' << '\n';
     }
 
-  out << "end" << std::endl;
+  out << "end" << '\n';
+                                  // make sure everything now gets to
+                                  // disk
+  out.flush ();
+
                                   // assert the stream is still ok
   AssertThrow (out, ExcIO());
 }
@@ -1607,19 +1615,19 @@ void DataOutBase::write_gnuplot (const std::vector<Patch<dim,spacedim> > &patche
                                       // use
       const std::time_t  time1= std::time (0);
       const std::tm     *time = std::localtime(&time1); 
-      out << "# This file was generated by the deal.II library." << std::endl
+      out << "# This file was generated by the deal.II library." << '\n'
          << "# Date =  "
          << time->tm_year+1900 << "/"
          << time->tm_mon+1 << "/"
-         << time->tm_mday << std::endl
+         << time->tm_mday << '\n'
          << "# Time =  "
          << time->tm_hour << ":"
          << std::setw(2) << time->tm_min << ":"
-         << std::setw(2) << time->tm_sec << std::endl
-         << "#" << std::endl
+         << std::setw(2) << time->tm_sec << '\n'
+         << "#" << '\n'
          << "# For a description of the GNUPLOT format see the GNUPLOT manual."
-         << std::endl
-         << "#" << std::endl
+         << '\n'
+         << "#" << '\n'
          << "# ";
       
       switch (spacedim)
@@ -1642,7 +1650,7 @@ void DataOutBase::write_gnuplot (const std::vector<Patch<dim,spacedim> > &patche
        out << '<'
            << data_names[i]
            << "> ";
-      out << std::endl;      
+      out << '\n';      
     }
 
 
@@ -1678,12 +1686,12 @@ void DataOutBase::write_gnuplot (const std::vector<Patch<dim,spacedim> > &patche
                for (unsigned int data_set=0; data_set<n_data_sets; ++data_set)
                  out << patch->data(data_set,i) << ' ';
 
-               out << std::endl;
+               out << '\n';
              }
 
                                             // end of patch
-           out << std::endl
-               << std::endl;
+           out << '\n'
+               << '\n';
            
            break;
          }
@@ -1708,15 +1716,15 @@ void DataOutBase::write_gnuplot (const std::vector<Patch<dim,spacedim> > &patche
                    for (unsigned int data_set=0; data_set<n_data_sets; ++data_set)
                      out << patch->data(data_set,i*(n_subdivisions+1) + j) << ' ';
 
-                   out << std::endl;
+                   out << '\n';
                  }
 
                                                 // end of row in patch
-               out << std::endl;
+               out << '\n';
              }
 
                                             // end of patch
-           out << std::endl;
+           out << '\n';
 
            break;
          }
@@ -1766,7 +1774,7 @@ void DataOutBase::write_gnuplot (const std::vector<Patch<dim,spacedim> > &patche
                          out  << ' '
                               << patch->data(data_set,
                                              (i*(n_subdivisions+1) + j)*(n_subdivisions+1)+k);
-                       out << std::endl;
+                       out << '\n';
                        
                                                         // write point there
                                                         // and its data
@@ -1783,11 +1791,11 @@ void DataOutBase::write_gnuplot (const std::vector<Patch<dim,spacedim> > &patche
                          out  << ' '
                               << patch->data(data_set,
                                              ((i+1)*(n_subdivisions+1) + j)*(n_subdivisions+1)+k);
-                       out << std::endl;
+                       out << '\n';
 
                                                         // end of line
-                       out << std::endl
-                           << std::endl;
+                       out << '\n'
+                           << '\n';
                      }
                    
                                                     // line into positive y-direction
@@ -1801,7 +1809,7 @@ void DataOutBase::write_gnuplot (const std::vector<Patch<dim,spacedim> > &patche
                          out  << ' '
                               << patch->data(data_set,
                                              (i*(n_subdivisions+1) + j)*(n_subdivisions+1)+k);
-                       out << std::endl;
+                       out << '\n';
                        
                                                         // write point there
                                                         // and its data
@@ -1818,11 +1826,11 @@ void DataOutBase::write_gnuplot (const std::vector<Patch<dim,spacedim> > &patche
                          out  << ' '
                               << patch->data(data_set,
                                              (i*(n_subdivisions+1) + (j+1))*(n_subdivisions+1)+k);
-                       out << std::endl;
+                       out << '\n';
 
                                                         // end of line
-                       out << std::endl
-                           << std::endl;
+                       out << '\n'
+                           << '\n';
                      }
 
                                                     // line into positive z-direction
@@ -1836,7 +1844,7 @@ void DataOutBase::write_gnuplot (const std::vector<Patch<dim,spacedim> > &patche
                          out  << ' '
                               << patch->data(data_set,
                                              (i*(n_subdivisions+1) + j)*(n_subdivisions+1)+k);
-                       out << std::endl;
+                       out << '\n';
                        
                                                         // write point there
                                                         // and its data
@@ -1853,11 +1861,11 @@ void DataOutBase::write_gnuplot (const std::vector<Patch<dim,spacedim> > &patche
                          out  << ' '
                               << patch->data(data_set,
                                              (i*(n_subdivisions+1) + j)*(n_subdivisions+1)+k+1);
-                       out << std::endl;
+                       out << '\n';
 
                                                         // end of line
-                       out << std::endl
-                           << std::endl;
+                       out << '\n'
+                           << '\n';
                      }             
                        
                  }
@@ -1870,6 +1878,10 @@ void DataOutBase::write_gnuplot (const std::vector<Patch<dim,spacedim> > &patche
        }
     }
 
+                                  // make sure everything now gets to
+                                  // disk
+  out.flush ();
+
   AssertThrow (out, ExcIO());
 }
 
@@ -1896,50 +1908,50 @@ void DataOutBase::write_povray (const std::vector<Patch<dim,spacedim> > &patches
                                       // variables destroyed after use
       const std::time_t  time1= std::time (0);
       const std::tm     *time = std::localtime(&time1); 
-      out << "/* This file was generated by the deal.II library." << std::endl
+      out << "/* This file was generated by the deal.II library." << '\n'
          << "   Date =  "
          << time->tm_year+1900 << "/"
          << time->tm_mon+1 << "/"
-         << time->tm_mday << std::endl
+         << time->tm_mday << '\n'
          << "   Time =  "
          << time->tm_hour << ":"
          << std::setw(2) << time->tm_min << ":"
-         << std::setw(2) << time->tm_sec << std::endl
-         << std::endl
+         << std::setw(2) << time->tm_sec << '\n'
+         << '\n'
          << "   For a description of the POVRAY format see the POVRAY manual."
-         << std::endl
-         << "*/ " << std::endl;
+         << '\n'
+         << "*/ " << '\n';
       
                                       // include files
-      out << "#include \"colors.inc\" " << std::endl
-         << "#include \"textures.inc\" " << std::endl;
+      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\" " << std::endl;
+       out << "#include \"data.inc\" " << '\n';
       else                          // all definitions in data file
        {  
                                           // camera
-         out << std::endl << std::endl
-             << "camera {"            << std::endl
-             << "  location <1,4,-7>" << std::endl
-             << "  look_at <0,0,0>"   << std::endl
-             << "  angle 30"          << std::endl
-             << "}"                   << std::endl;
+         out << '\n' << '\n'
+             << "camera {"            << '\n'
+             << "  location <1,4,-7>" << '\n'
+             << "  look_at <0,0,0>"   << '\n'
+             << "  angle 30"          << '\n'
+             << "}"                   << '\n';
          
                                           // light
-         out << std::endl 
-             << "light_source {"      << std::endl
-             << "  <1,4,-7>"      << std::endl
-             << "  color Grey"        << std::endl
-             << "}"                   << std::endl;
-         out << std::endl 
-             << "light_source {"      << std::endl
-             << "  <0,20,0>"      << std::endl
-             << "  color White"       << std::endl
-             << "}"                   << std::endl;
+         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';
        }
     }
   
@@ -1975,28 +1987,28 @@ void DataOutBase::write_povray (const std::vector<Patch<dim,spacedim> > &patches
          }
     }
 
-  out << "#declare HMIN=" << hmin << ";" << std::endl
-      << "#declare HMAX=" << hmax << ";" << std::endl << std::endl;
+  out << "#declare HMIN=" << hmin << ";" << '\n'
+      << "#declare HMAX=" << hmax << ";" << '\n' << '\n';
 
   if (!flags.external_data)
     {
                                       // texture with scaled niveau lines
                                       // 10 lines in the surface
-      out << "#declare Tex=texture{" << std::endl
-         << "  pigment {" << std::endl
-         << "    gradient y" << std::endl
-         << "    scale y*(HMAX-HMIN)*" << 0.1 << std::endl
-         << "    color_map {" << std::endl
-         << "      [0.00 color Light_Purple] " << std::endl
-         << "      [0.95 color Light_Purple] " << std::endl
-         << "      [1.00 color White]    " << std::endl
-         << "} } }" << std::endl << std::endl;
+      out << "#declare Tex=texture{" << '\n'
+         << "  pigment {" << '\n'
+         << "    gradient y" << '\n'
+         << "    scale y*(HMAX-HMIN)*" << 0.1 << '\n'
+         << "    color_map {" << '\n'
+         << "      [0.00 color Light_Purple] " << '\n'
+         << "      [0.95 color Light_Purple] " << '\n'
+         << "      [1.00 color White]    " << '\n'
+         << "} } }" << '\n' << '\n';
     }
 
   if (!flags.bicubic_patch)
     {                                  // start of mesh header
-      out << std::endl
-         << "mesh {" << std::endl;
+      out << '\n'
+         << "mesh {" << '\n';
     }
 
                                   // loop over all patches
@@ -2130,12 +2142,12 @@ void DataOutBase::write_povray (const std::vector<Patch<dim,spacedim> > &patches
                                                       // writing smooth_triangles
                      
                                                       // down/right triangle
-                     out << "smooth_triangle {" << std::endl << "\t<" 
+                     out << "smooth_triangle {" << '\n' << "\t<" 
                          << ver[dl](0) << ","   
                          << patch->data(0,dl) << ","
                          << ver[dl](1) << ">, <"
                          << nrml[dl](0) << ", " << nrml[dl](1) << ", " << nrml[dl](2)
-                         << ">," << std::endl;
+                         << ">," << '\n';
                      out << " \t<" 
                          << ver[dl+n_subdivisions+1](0) << "," 
                          << patch->data(0,dl+n_subdivisions+1)  << ","
@@ -2143,7 +2155,7 @@ void DataOutBase::write_povray (const std::vector<Patch<dim,spacedim> > &patches
                          << nrml[dl+n_subdivisions+1](0) << ", "
                          << nrml[dl+n_subdivisions+1](1) << ", "
                          << nrml[dl+n_subdivisions+1](2)
-                         << ">," << std::endl;
+                         << ">," << '\n';
                      out << "\t<" 
                          << ver[dl+n_subdivisions+2](0) << "," 
                          << patch->data(0,dl+n_subdivisions+2)  << ","
@@ -2151,15 +2163,15 @@ void DataOutBase::write_povray (const std::vector<Patch<dim,spacedim> > &patches
                          << nrml[dl+n_subdivisions+2](0) << ", "
                          << nrml[dl+n_subdivisions+2](1) << ", "
                          << nrml[dl+n_subdivisions+2](2) 
-                         << ">}" << std::endl
+                         << ">}" << '\n'
                      
                                                       // upper/left triangle
-                     out << "smooth_triangle {" << std::endl << "\t<" 
+                     out << "smooth_triangle {" << '\n' << "\t<" 
                          << ver[dl](0) << "," 
                          << patch->data(0,dl) << ","
                          << ver[dl](1) << ">, <"
                          << nrml[dl](0) << ", " << nrml[dl](1) << ", " << nrml[dl](2) 
-                         << ">," << std::endl;
+                         << ">," << '\n';
                      out << "\t<" 
                          << ver[dl+n_subdivisions+2](0) << "," 
                          << patch->data(0,dl+n_subdivisions+2)  << ","
@@ -2167,44 +2179,44 @@ void DataOutBase::write_povray (const std::vector<Patch<dim,spacedim> > &patches
                          << nrml[dl+n_subdivisions+2](0) << ", "
                          << nrml[dl+n_subdivisions+2](1) << ", "
                          << nrml[dl+n_subdivisions+2](2)
-                         << ">," << std::endl;
+                         << ">," << '\n';
                      out << "\t<" 
                          << ver[dl+1](0) << "," 
                          << patch->data(0,dl+1)  << ","
                          << ver[dl+1](1) << ">, <"
                          << nrml[dl+1](0) << ", " << nrml[dl+1](1) << ", " << nrml[dl+1](2)
-                         << ">}" << std::endl;
+                         << ">}" << '\n';
                    }
                  else
                    {           
                                                       // writing standard triangles
                                                       // down/right triangle
-                     out << "triangle {" << std::endl << "\t<" 
+                     out << "triangle {" << '\n' << "\t<" 
                          << ver[dl](0) << "," 
                          << patch->data(0,dl) << ","
-                         << ver[dl](1) << ">," << std::endl;
+                         << ver[dl](1) << ">," << '\n';
                      out << "\t<" 
                          << ver[dl+n_subdivisions+1](0) << "," 
                          << patch->data(0,dl+n_subdivisions+1)  << ","
-                         << ver[dl+n_subdivisions+1](1) << ">," << std::endl;
+                         << ver[dl+n_subdivisions+1](1) << ">," << '\n';
                      out << "\t<" 
                          << ver[dl+n_subdivisions+2](0) << "," 
                          << patch->data(0,dl+n_subdivisions+2)  << ","
-                         << ver[dl+n_subdivisions+2](1) << ">}" << std::endl
+                         << ver[dl+n_subdivisions+2](1) << ">}" << '\n'
                            
                                                       // upper/left triangle
-                     out << "triangle {" << std::endl << "\t<" 
+                     out << "triangle {" << '\n' << "\t<" 
                          << ver[dl](0) << "," 
                          << patch->data(0,dl) << ","
-                         << ver[dl](1) << ">," << std::endl;
+                         << ver[dl](1) << ">," << '\n';
                      out << "\t<"
                          << ver[dl+n_subdivisions+2](0) << "," 
                          << patch->data(0,dl+n_subdivisions+2)  << ","
-                         << ver[dl+n_subdivisions+2](1) << ">," << std::endl;
+                         << ver[dl+n_subdivisions+2](1) << ">," << '\n';
                      out << "\t<" 
                          << ver[dl+1](0) << ","
                          << patch->data(0,dl+1)  << ","
-                          << ver[dl+1](1) << ">}" << std::endl;
+                          << ver[dl+1](1) << ">}" << '\n';
                        }
                }
            }
@@ -2212,30 +2224,34 @@ void DataOutBase::write_povray (const std::vector<Patch<dim,spacedim> > &patches
       else
        {                                    // writing bicubic_patch
          Assert (n_subdivisions==3, ExcDimensionMismatch(n_subdivisions,3));
-         out << std::endl
-             << "bicubic_patch {" << std::endl
-             << "  type 0" << std::endl
-             << "  flatness 0" << std::endl
-             << "  u_steps 0" << std::endl
-             << "  v_steps 0" << std::endl;
+         out << '\n'
+             << "bicubic_patch {" << '\n'
+             << "  type 0" << '\n'
+             << "  flatness 0" << '\n'
+             << "  u_steps 0" << '\n'
+             << "  v_steps 0" << '\n';
          for (int i=0;i<16;++i)
            {
              out << "\t<" << ver[i](0) << "," << patch->data(0,i) << "," << ver[i](1) << ">";
              if (i!=15) out << ",";
-             out << std::endl;
+             out << '\n';
            }
-         out << "  texture {Tex}" <<  std::endl
-             << "}" << std::endl;
+         out << "  texture {Tex}" <<  '\n'
+             << "}" << '\n';
        }
     }
   
   if (!flags.bicubic_patch) 
     {                                   // the end of the mesh
-      out << "  texture {Tex}" << std::endl
-         << "}" << std::endl
-         << std::endl;
+      out << "  texture {Tex}" << '\n'
+         << "}" << '\n'
+         << '\n';
     }
   
+                                  // make sure everything now gets to
+                                  // disk
+  out.flush ();
+
   AssertThrow (out, ExcIO());
 }
 
@@ -2506,16 +2522,16 @@ void DataOutBase::write_eps (const std::vector<Patch<dim,spacedim> > &patches,
                                             // use
            std::time_t  time1= std::time (0);
            std::tm     *time = std::localtime(&time1); 
-           out << "%!PS-Adobe-2.0 EPSF-1.2" << std::endl
-               << "%%Title: deal.II Output" << std::endl
-               << "%%Creator: the deal.II library" << std::endl
+           out << "%!PS-Adobe-2.0 EPSF-1.2" << '\n'
+               << "%%Title: deal.II Output" << '\n'
+               << "%%Creator: the deal.II library" << '\n'
                << "%%Creation Date: " 
                << time->tm_year+1900 << "/"
                << time->tm_mon+1 << "/"
                << time->tm_mday << " - "
                << time->tm_hour << ":"
                << std::setw(2) << time->tm_min << ":"
-               << std::setw(2) << time->tm_sec << std::endl
+               << std::setw(2) << time->tm_sec << '\n'
                << "%%BoundingBox: "
                                               // lower left corner
                << "0 0 "
@@ -2523,7 +2539,7 @@ void DataOutBase::write_eps (const std::vector<Patch<dim,spacedim> > &patches,
                << static_cast<unsigned int>( rint((x_max-x_min) * scale ))
                << ' '
                << static_cast<unsigned int>( rint((y_max-y_min) * scale ))
-               << std::endl;
+               << '\n';
            
                                             // define some abbreviations to keep
                                             // the output small:
@@ -2533,17 +2549,17 @@ void DataOutBase::write_eps (const std::vector<Patch<dim,spacedim> > &patches,
                                             // 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"      << std::endl
-               << "/l {lineto} bind def"      << std::endl
-               << "/s {setrgbcolor} bind def" << std::endl
-               << "/sg {setgray} bind def"    << std::endl
-               << "/lx {lineto closepath stroke} bind def" << std::endl
-               << "/lf {lineto closepath fill} bind def"   << std::endl;
+           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" << std::endl
-               << std::endl;
+           out << "%%EndProlog" << '\n'
+               << '\n';
                                             // set fine lines
-           out << flags.line_width << " setlinewidth" << std::endl;
+           out << flags.line_width << " setlinewidth" << '\n';
                                             // allow only five digits
                                             // for output (instead of the
                                             // default six); this should suffice
@@ -2602,7 +2618,7 @@ void DataOutBase::write_eps (const std::vector<Patch<dim,spacedim> > &patches,
                    << (cell->vertices[1]-offset) * scale << " l "
                    << (cell->vertices[2]-offset) * scale << " l "
                    << (cell->vertices[3]-offset) * scale << " lf"
-                   << std::endl;
+                   << '\n';
              }
            
            if (flags.draw_mesh)
@@ -2611,9 +2627,9 @@ void DataOutBase::write_eps (const std::vector<Patch<dim,spacedim> > &patches,
                  << (cell->vertices[1]-offset) * scale << " l "
                  << (cell->vertices[2]-offset) * scale << " l "
                  << (cell->vertices[3]-offset) * scale << " lx"
-                 << std::endl;
+                 << '\n';
          }
-       out << "showpage" << std::endl;
+       out << "showpage" << '\n';
        
        break;
       }
@@ -2621,6 +2637,12 @@ void DataOutBase::write_eps (const std::vector<Patch<dim,spacedim> > &patches,
       default:
            Assert (false, ExcNotImplemented());
     }
+
+                                  // make sure everything now gets to
+                                  // disk
+  out.flush ();
+
+  AssertThrow (out, ExcIO());
 }
 
 
@@ -2647,8 +2669,8 @@ void DataOutBase::write_gmv (const std::vector<Patch<dim,spacedim> > &patches,
                                   ///////////////////////
                                   // preamble
   out << "gmvinput ascii"
-      << std::endl
-      << std::endl;
+      << '\n'
+      << '\n';
 
                                   // first count the number of cells
                                   // and cells for later use
@@ -2715,7 +2737,7 @@ void DataOutBase::write_gmv (const std::vector<Patch<dim,spacedim> > &patches,
                                   //
                                   // note that we have to print
                                   // d=1..3 dimensions
-  out << "nodes " << n_nodes << std::endl;
+  out << "nodes " << n_nodes << '\n';
   for (unsigned int d=1; d<=3; ++d)
     {
       for (typename std::vector<Patch<dim,spacedim> >::const_iterator patch=patches.begin();
@@ -2803,17 +2825,17 @@ void DataOutBase::write_gmv (const std::vector<Patch<dim,spacedim> > &patches,
                out << "0 ";
            }
        }
-      out << std::endl;
+      out << '\n';
     }
 
-  out << std::endl;
+  out << '\n';
 
                                   /////////////////////////////////
                                   // now for the cells. note that
                                   // vertices are counted from 1 onwards
   if (true)
     {
-      out << "cells " << n_cells << std::endl;
+      out << "cells " << n_cells << '\n';
 
 
       unsigned int first_vertex_of_patch = 0;
@@ -2832,7 +2854,7 @@ void DataOutBase::write_gmv (const std::vector<Patch<dim,spacedim> > &patches,
                for (unsigned int i=0; i<n_subdivisions; ++i)
                  out << "line 2\n  "
                      << first_vertex_of_patch+i+1 << ' '
-                     << first_vertex_of_patch+i+1+1 << std::endl;
+                     << first_vertex_of_patch+i+1+1 << '\n';
                break;
              }
               
@@ -2845,7 +2867,7 @@ void DataOutBase::write_gmv (const std::vector<Patch<dim,spacedim> > &patches,
                        << first_vertex_of_patch+(i+1)*(n_subdivisions+1)+j+1 << ' '
                        << first_vertex_of_patch+(i+1)*(n_subdivisions+1)+j+1+1 << ' '
                        << first_vertex_of_patch+i*(n_subdivisions+1)+j+1+1
-                       << std::endl;
+                       << '\n';
                break;
              }
               
@@ -2865,7 +2887,7 @@ void DataOutBase::write_gmv (const std::vector<Patch<dim,spacedim> > &patches,
                            << first_vertex_of_patch+((i+1)*(n_subdivisions+1)+j  )*(n_subdivisions+1)+k+1+1 << ' '
                            << first_vertex_of_patch+((i+1)*(n_subdivisions+1)+j+1)*(n_subdivisions+1)+k+1+1 << ' '
                            << first_vertex_of_patch+(i*(n_subdivisions+1)+j+1    )*(n_subdivisions+1)+k+1+1 << ' '
-                           << std::endl;
+                           << '\n';
                      }
                break;
              }
@@ -2895,12 +2917,12 @@ void DataOutBase::write_gmv (const std::vector<Patch<dim,spacedim> > &patches,
                    Assert (false, ExcNotImplemented());
            }
        }
-      out << std::endl;
+      out << '\n';
     }
 
                                   ///////////////////////////////////////
                                   // data output.
-  out << "variable" << std::endl;
+  out << "variable" << '\n';
 
                                   // now write the data vectors to
                                   // @p{out} first make sure that all
@@ -2913,23 +2935,27 @@ void DataOutBase::write_gmv (const std::vector<Patch<dim,spacedim> > &patches,
                                   // support explicitly here)
   for (unsigned int data_set=0; data_set<n_data_sets; ++data_set)
     {
-      out << data_names[data_set] << " 1" << std::endl;
+      out << data_names[data_set] << " 1" << '\n';
       std::copy (data_vectors[data_set].begin(),
                 data_vectors[data_set].end(),
                 std::ostream_iterator<double>(out, " "));
-      out << std::endl
-         << std::endl;
+      out << '\n'
+         << '\n';
     }
 
 
   
                                   // end of variable section
-  out << "endvars" << std::endl;
+  out << "endvars" << '\n';
   
                                   // end of output
   out << "endgmv"
-      << std::endl;
+      << '\n';
   
+                                  // make sure everything now gets to
+                                  // disk
+  out.flush ();
+
                                   // assert the stream is still ok
   AssertThrow (out, ExcIO());
 }
@@ -2994,19 +3020,19 @@ void DataOutBase::write_tecplot (const std::vector<Patch<dim,spacedim> > &patche
   {
     std::time_t  time1= std::time (0);
     std::tm     *time = std::localtime(&time1); 
-    out << "# This file was generated by the deal.II library." << std::endl
+    out << "# This file was generated by the deal.II library." << '\n'
        << "# Date =  "
        << time->tm_year+1900 << "/"
        << time->tm_mon+1 << "/"
-       << time->tm_mday << std::endl
+       << time->tm_mday << '\n'
        << "# Time =  "
        << time->tm_hour << ":"
        << std::setw(2) << time->tm_min << ":"
-       << std::setw(2) << time->tm_sec << std::endl
-       << "#" << std::endl
+       << std::setw(2) << time->tm_sec << '\n'
+       << "#" << '\n'
        << "# For a description of the Tecplot format see the Tecplot documentation."
-       << std::endl
-       << "#" << std::endl;
+       << '\n'
+       << "#" << '\n';
     
 
     out << "Variables=";
@@ -3029,7 +3055,7 @@ void DataOutBase::write_tecplot (const std::vector<Patch<dim,spacedim> > &patche
     for (unsigned int data_set=0; data_set<n_data_sets; ++data_set)
       out << ", \"" << data_names[data_set] << "\"";
     
-    out << std::endl;
+    out << '\n';
     
     if (dim > 1)
       {
@@ -3038,17 +3064,17 @@ void DataOutBase::write_tecplot (const std::vector<Patch<dim,spacedim> > &patche
        switch (dim)
          {
            case 2:
-                 out << "quadrilateral" << std::endl;
+                 out << "quadrilateral" << '\n';
                  break;
            case 3:
-                 out << "brick" << std::endl;
+                 out << "brick" << '\n';
                  break;
            default:
                  Assert (false, ExcNotImplemented());
          }
       }
     else
-      out << "zone f=block, n=" << n_nodes << std::endl;
+      out << "zone f=block, n=" << n_nodes << '\n';
   }
 
   
@@ -3163,7 +3189,7 @@ void DataOutBase::write_tecplot (const std::vector<Patch<dim,spacedim> > &patche
                     Assert (false, ExcNotImplemented());
             }
         }
-      out << std::endl;
+      out << '\n';
     }
 
 
@@ -3181,7 +3207,7 @@ void DataOutBase::write_tecplot (const std::vector<Patch<dim,spacedim> > &patche
       std::copy (data_vectors[data_set].begin(),
                 data_vectors[data_set].end(),
                 std::ostream_iterator<double>(out, "\n"));
-      out << std::endl;
+      out << '\n';
     }
 
   
@@ -3214,7 +3240,7 @@ void DataOutBase::write_tecplot (const std::vector<Patch<dim,spacedim> > &patche
                       << first_vertex_of_patch+(i+1)*(n_subdivisions+1)+j+1 << ' '
                       << first_vertex_of_patch+(i+1)*(n_subdivisions+1)+j+1+1 << ' '
                       << first_vertex_of_patch+i*(n_subdivisions+1)+j+1+1
-                      << std::endl;
+                      << '\n';
                 }
             break;
           }
@@ -3235,7 +3261,7 @@ void DataOutBase::write_tecplot (const std::vector<Patch<dim,spacedim> > &patche
                         << first_vertex_of_patch+((i+1)*(n_subdivisions+1)+j  )*(n_subdivisions+1)+k+1+1 << ' '
                         << first_vertex_of_patch+((i+1)*(n_subdivisions+1)+j+1)*(n_subdivisions+1)+k+1+1 << ' '
                         << first_vertex_of_patch+(i*(n_subdivisions+1)+j+1    )*(n_subdivisions+1)+k+1+1 << ' '
-                        << std::endl;
+                        << '\n';
                   }
             break;
           }
@@ -3267,6 +3293,9 @@ void DataOutBase::write_tecplot (const std::vector<Patch<dim,spacedim> > &patche
        
     }
 
+                                  // make sure everything now gets to
+                                  // disk
+  out.flush ();
   
                                    // assert the stream is still ok
   AssertThrow (out, ExcIO());
@@ -3762,7 +3791,7 @@ void DataOutBase::write_vtk (const std::vector<Patch<dim,spacedim> > &patches,
       std::time_t  time1= std::time (0);
       std::tm     *time = std::localtime(&time1);
       out << "# vtk DataFile Version 3.0"
-         << std::endl
+         << '\n'
          << "This file was generated by the deal.II library on "
          << time->tm_year+1900 << "/"
          << time->tm_mon+1 << "/"
@@ -3770,11 +3799,11 @@ void DataOutBase::write_vtk (const std::vector<Patch<dim,spacedim> > &patches,
          << time->tm_hour << ":"
          << std::setw(2) << time->tm_min << ":"
          << std::setw(2) << time->tm_sec
-         << std::endl
+         << '\n'
          << "ASCII"
-         << std::endl
+         << '\n'
          << "DATASET UNSTRUCTURED_GRID"
-         << std::endl;
+         << '\n';
     }
   
 
@@ -3844,7 +3873,7 @@ void DataOutBase::write_vtk (const std::vector<Patch<dim,spacedim> > &patches,
                                   //
                                   // note that we have to print
                                   // d=1..3 dimensions
-  out << "POINTS " << n_nodes << " double" << std::endl;
+  out << "POINTS " << n_nodes << " double" << '\n';
   for (typename std::vector<Patch<dim,spacedim> >::const_iterator patch=patches.begin();
        patch!=patches.end(); ++patch)
     {
@@ -3905,7 +3934,7 @@ void DataOutBase::write_vtk (const std::vector<Patch<dim,spacedim> > &patches,
                              (patch->vertices[4] * (1-x_frac))) * (1-y_frac) +
                             ((patch->vertices[6] * x_frac) +
                              (patch->vertices[7] * (1-x_frac))) * y_frac)   * z_frac)
-                       << std::endl;
+                       << '\n';
                  }
                
            break;
@@ -3922,7 +3951,7 @@ void DataOutBase::write_vtk (const std::vector<Patch<dim,spacedim> > &patches,
     {
       out << "CELLS " << n_cells << ' '
          << n_cells*(GeometryInfo<dim>::vertices_per_cell+1)
-         << std::endl;
+         << '\n';
 
 
       unsigned int first_vertex_of_patch = 0;
@@ -3941,7 +3970,7 @@ void DataOutBase::write_vtk (const std::vector<Patch<dim,spacedim> > &patches,
                for (unsigned int i=0; i<n_subdivisions; ++i)
                  out << "2 "
                      << first_vertex_of_patch+i << ' '
-                     << first_vertex_of_patch+i+1 << std::endl;
+                     << first_vertex_of_patch+i+1 << '\n';
                break;
              }
               
@@ -3954,7 +3983,7 @@ void DataOutBase::write_vtk (const std::vector<Patch<dim,spacedim> > &patches,
                        << first_vertex_of_patch+(i+1)*(n_subdivisions+1)+j << ' '
                        << first_vertex_of_patch+(i+1)*(n_subdivisions+1)+j+1 << ' '
                        << first_vertex_of_patch+i*(n_subdivisions+1)+j+1
-                       << std::endl;
+                       << '\n';
                break;
              }
               
@@ -3974,7 +4003,7 @@ void DataOutBase::write_vtk (const std::vector<Patch<dim,spacedim> > &patches,
                            << first_vertex_of_patch+((i+1)*(n_subdivisions+1)+j  )*(n_subdivisions+1)+k+1 << ' '
                            << first_vertex_of_patch+((i+1)*(n_subdivisions+1)+j+1)*(n_subdivisions+1)+k+1 << ' '
                            << first_vertex_of_patch+(i*(n_subdivisions+1)+j+1    )*(n_subdivisions+1)+k+1 << ' '
-                           << std::endl;
+                           << '\n';
                      }
                break;
              }
@@ -4008,7 +4037,7 @@ void DataOutBase::write_vtk (const std::vector<Patch<dim,spacedim> > &patches,
                                       // next output the types of the
                                       // cells. since all cells are
                                       // the same, this is simple
-      out << "CELL_TYPES " << n_cells << std::endl;
+      out << "CELL_TYPES " << n_cells << '\n';
       for (unsigned int i=0; i<n_cells; ++i)
        switch (dim)
          {
@@ -4041,21 +4070,25 @@ void DataOutBase::write_vtk (const std::vector<Patch<dim,spacedim> > &patches,
                                   // here). all following data sets
                                   // are point data
   out << "POINT_DATA " << n_nodes
-      << std::endl;
+      << '\n';
   for (unsigned int data_set=0; data_set<n_data_sets; ++data_set)
     {
       out << "SCALARS "
          << data_names[data_set]
          << " double 1"
-         << std::endl
+         << '\n'
          << "LOOKUP_TABLE default"
-         << std::endl;
+         << '\n';
       std::copy (data_vectors[data_set].begin(),
                 data_vectors[data_set].end(),
                 std::ostream_iterator<double>(out, " "));
-      out << std::endl;
+      out << '\n';
     }
   
+                                  // make sure everything now gets to
+                                  // disk
+  out.flush ();
+
                                   // assert the stream is still ok
   AssertThrow (out, ExcIO());
 }
@@ -4075,21 +4108,24 @@ write_deal_II_intermediate (const std::vector<Patch<dim,spacedim> > &patches,
                                    // here because we may want to read in data
                                    // again even if we don't know in advance
                                    // the template parameters, see step-19
-  out << dim << ' ' << spacedim << std::endl;
+  out << dim << ' ' << spacedim << '\n';
 
                                    // then write a header
-  out << "[deal.II intermediate format graphics data]" << std::endl
-      << "[written by " << PACKAGE_STRING << "]" << std::endl;
+  out << "[deal.II intermediate format graphics data]" << '\n'
+      << "[written by " << PACKAGE_STRING << "]" << '\n';
 
-  out << data_names.size() << std::endl;
+  out << data_names.size() << '\n';
   for (unsigned int i=0; i<data_names.size(); ++i)
-    out << data_names[i] << std::endl;
+    out << data_names[i] << '\n';
   
-  out << patches.size() << std::endl;
+  out << patches.size() << '\n';
   for (unsigned int i=0; i<patches.size(); ++i)
-    out << patches[i] << std::endl;
+    out << patches[i] << '\n';
 
-  out << std::endl;
+  out << '\n';
+                                  // make sure everything now gets to
+                                  // disk
+  out.flush ();
 } 
 
 
@@ -4733,27 +4769,27 @@ operator << (std::ostream                           &out,
 {
                                   // write a header line
   out << "[deal.II intermediate Patch<" << dim << ',' << spacedim << ">]"
-      << std::endl;
+      << '\n';
 
                                   // then write all the data that is
                                   // in this patch
   for (unsigned int i=0; i<GeometryInfo<dim>::vertices_per_cell; ++i)
     out << patch.vertices[i] << " ";
-  out << std::endl;
+  out << '\n';
 
   for (unsigned int i=0; i<GeometryInfo<dim>::faces_per_cell; ++i)
     out << patch.neighbors[i] << " ";
-  out << std::endl;
+  out << '\n';
 
   out << patch.patch_index << ' ' << patch.n_subdivisions
-      << std::endl;
+      << '\n';
 
-  out << patch.data.n_rows() << ' ' << patch.data.n_cols() << std::endl;
+  out << patch.data.n_rows() << ' ' << patch.data.n_cols() << '\n';
   for (unsigned int i=0; i<patch.data.n_rows(); ++i)
     for (unsigned int j=0; j<patch.data.n_cols(); ++j)
       out << patch.data[i][j] << ' ';
-  out << std::endl;
-  out << std::endl;
+  out << '\n';
+  out << '\n';
 
   return out;
 }
index 56423878fa246cff51b9339cc6b4d572ae7cb096..e87ec6df0e6500a90710e29cf4f2bf44cdebdd67 100644 (file)
@@ -62,12 +62,12 @@ void GridOut::write_dx (const Triangulation<dim> &tria,
                                   // write the vertices
   out << "object \"vertices\" class array type float rank 1 shape " << dim
       << " items " << n_vertices << " data follows"
-      << std::endl;
+      << '\n';
   
   for (unsigned int i=0; i<vertices.size(); ++i)
     if (vertex_used[i])
       {
-       out << '\t' << vertices[i] << std::endl;
+       out << '\t' << vertices[i] << '\n';
       };
   
                                   // write cells or faces
@@ -85,55 +85,55 @@ void GridOut::write_dx (const Triangulation<dim> &tria,
     {
       out << "object \"cells\" class array type int rank 1 shape "
          << n_vertices_per_cell
-         << " items " << n_cells << " data follows" << std::endl;
+         << " items " << n_cells << " data follows" << '\n';
       
       for (cell = tria.begin_active(); cell != endc; ++cell)
        {
          for (unsigned int v=0; v<GeometryInfo<dim>::vertices_per_cell; ++v)
            out << '\t' << cell->vertex_index(GeometryInfo<dim>::dx_to_deal[v]);
-         out << std::endl;
+         out << '\n';
        }
       out << "attribute \"element type\" string \"";
       if (dim==1) out << "lines";
       if (dim==2) out << "quads";
       if (dim==3) out << "cubes";
-      out << "\"" << std::endl
-         << "attribute \"ref\" string \"positions\"" << std::endl << std::endl;
+      out << "\"" << '\n'
+         << "attribute \"ref\" string \"positions\"" << '\n' << '\n';
 
                                       // Additional cell information
       
       out << "object \"material\" class array type int rank 0 items "
-         << n_cells << " data follows" << std::endl;
+         << n_cells << " data follows" << '\n';
       for (cell = tria.begin_active(); cell != endc; ++cell)
        out << ' ' << (unsigned int)cell->material_id();
-      out  << std::endl
-          << "attribute \"dep\" string \"connections\"" << std::endl << std::endl;
+      out  << '\n'
+          << "attribute \"dep\" string \"connections\"" << '\n' << '\n';
       
       out << "object \"level\" class array type int rank 0 items "
-         << n_cells << " data follows" << std::endl;
+         << n_cells << " data follows" << '\n';
       for (cell = tria.begin_active(); cell != endc; ++cell)
        out << ' ' << cell->level();
-      out  << std::endl
-          << "attribute \"dep\" string \"connections\"" << std::endl << std::endl;
+      out  << '\n'
+          << "attribute \"dep\" string \"connections\"" << '\n' << '\n';
       
       if (dx_flags.write_measure)
        {
          out << "object \"measure\" class array type float rank 0 items "
-             << n_cells << " data follows" << std::endl;
+             << n_cells << " data follows" << '\n';
          for (cell = tria.begin_active(); cell != endc; ++cell)
            out << '\t' << cell->measure();
-         out  << std::endl
-              << "attribute \"dep\" string \"connections\"" << std::endl << std::endl;
+         out  << '\n'
+              << "attribute \"dep\" string \"connections\"" << '\n' << '\n';
        }
       
       if (dx_flags.write_diameter)
        {
          out << "object \"diameter\" class array type float rank 0 items "
-             << n_cells << " data follows" << std::endl;
+             << n_cells << " data follows" << '\n';
          for (cell = tria.begin_active(); cell != endc; ++cell)
            out << '\t' << cell->diameter();
-         out  << std::endl
-              << "attribute \"dep\" string \"connections\"" << std::endl << std::endl;
+         out  << '\n'
+              << "attribute \"dep\" string \"connections\"" << '\n' << '\n';
        }
     }
   
@@ -142,7 +142,7 @@ void GridOut::write_dx (const Triangulation<dim> &tria,
       out << "object \"faces\" class array type int rank 1 shape "
          << n_vertices_per_face
          << " items " << n_faces << " data follows"
-         << std::endl;
+         << '\n';
 
       for (cell = tria.begin_active(); cell != endc; ++cell)
        {
@@ -152,54 +152,54 @@ void GridOut::write_dx (const Triangulation<dim> &tria,
              
              for (unsigned int v=0; v<GeometryInfo<dim>::vertices_per_face; ++v)
                out << '\t' << face->vertex_index(GeometryInfo<dim-1>::dx_to_deal[v]);
-             out << std::endl;
+             out << '\n';
            }
        }
       out << "attribute \"element type\" string \"";
       if (dim==2) out << "lines";
       if (dim==3) out << "quads";
-      out << "\"" << std::endl
-         << "attribute \"ref\" string \"positions\"" << std::endl << std::endl;
+      out << "\"" << '\n'
+         << "attribute \"ref\" string \"positions\"" << '\n' << '\n';
       
 
                                       // Additional face information
       
       out << "object \"boundary\" class array type int rank 0 items "
-         << n_faces << " data follows" << std::endl;
+         << n_faces << " data follows" << '\n';
       for (cell = tria.begin_active(); cell != endc; ++cell)
        {
                                           // Little trick to get -1
                                           // for the interior
          for (unsigned int f=0;f<GeometryInfo<dim>::faces_per_cell;++f)
            out << ' ' << (int)(signed char)cell->face(f)->boundary_indicator();
-         out << std::endl;
+         out << '\n';
        }
-      out << "attribute \"dep\" string \"connections\"" << std::endl << std::endl;
+      out << "attribute \"dep\" string \"connections\"" << '\n' << '\n';
       
       if (dx_flags.write_measure)
        {
          out << "object \"face measure\" class array type float rank 0 items "
-             << n_faces << " data follows" << std::endl;
+             << n_faces << " data follows" << '\n';
          for (cell = tria.begin_active(); cell != endc; ++cell)
            {
              for (unsigned int f=0;f<GeometryInfo<dim>::faces_per_cell;++f)
                out << ' ' << cell->face(f)->measure();
-             out << std::endl;
+             out << '\n';
            }
-         out << "attribute \"dep\" string \"connections\"" << std::endl << std::endl;
+         out << "attribute \"dep\" string \"connections\"" << '\n' << '\n';
        }
 
       if (dx_flags.write_diameter)
        {
          out << "object \"face diameter\" class array type float rank 0 items "
-             << n_faces << " data follows" << std::endl;
+             << n_faces << " data follows" << '\n';
          for (cell = tria.begin_active(); cell != endc; ++cell)
            {
              for (unsigned int f=0;f<GeometryInfo<dim>::faces_per_cell;++f)
                out << ' ' << cell->face(f)->diameter();
-             out << std::endl;
+             out << '\n';
            }
-         out << "attribute \"dep\" string \"connections\"" << std::endl << std::endl;
+         out << "attribute \"dep\" string \"connections\"" << '\n' << '\n';
        }
 
     }
@@ -213,45 +213,51 @@ void GridOut::write_dx (const Triangulation<dim> &tria,
     }
   else
     {
-     }
+    }
 
                                   // The wrapper
-  out << "object \"deal data\" class field" << std::endl
-      << "component \"positions\" value \"vertices\"" << std::endl
-      << "component \"connections\" value \"cells\"" << std::endl;
+  out << "object \"deal data\" class field" << '\n'
+      << "component \"positions\" value \"vertices\"" << '\n'
+      << "component \"connections\" value \"cells\"" << '\n';
 
   if (write_cells)
     {
-      out << "object \"cell data\" class field" << std::endl
-         << "component \"positions\" value \"vertices\"" << std::endl
-         << "component \"connections\" value \"cells\"" << std::endl;
-      out << "component \"material\" value \"material\"" << std::endl;
-      out << "component \"level\" value \"level\"" << std::endl;
+      out << "object \"cell data\" class field" << '\n'
+         << "component \"positions\" value \"vertices\"" << '\n'
+         << "component \"connections\" value \"cells\"" << '\n';
+      out << "component \"material\" value \"material\"" << '\n';
+      out << "component \"level\" value \"level\"" << '\n';
       if (dx_flags.write_measure)
-       out << "component \"measure\" value \"measure\"" << std::endl;
+       out << "component \"measure\" value \"measure\"" << '\n';
       if (dx_flags.write_diameter)
-       out << "component \"diameter\" value \"diameter\"" << std::endl;
+       out << "component \"diameter\" value \"diameter\"" << '\n';
     }
 
   if (write_faces)
     {
-      out << "object \"face data\" class field" << std::endl
-         << "component \"positions\" value \"vertices\"" << std::endl
-         << "component \"connections\" value \"faces\"" << std::endl;
-      out << "component \"boundary\" value \"boundary\"" << std::endl;
+      out << "object \"face data\" class field" << '\n'
+         << "component \"positions\" value \"vertices\"" << '\n'
+         << "component \"connections\" value \"faces\"" << '\n';
+      out << "component \"boundary\" value \"boundary\"" << '\n';
       if (dx_flags.write_measure)
-       out << "component \"measure\" value \"face measure\"" << std::endl;
+       out << "component \"measure\" value \"face measure\"" << '\n';
       if (dx_flags.write_diameter)
-       out << "component \"diameter\" value \"face diameter\"" << std::endl;
+       out << "component \"diameter\" value \"face diameter\"" << '\n';
     }
   
-  out << std::endl
-      << "object \"grid data\" class group" << std::endl;
+  out << '\n'
+      << "object \"grid data\" class group" << '\n';
     if (write_cells)
-      out << "member \"cells\" value \"cell data\"" << std::endl;
+      out << "member \"cells\" value \"cell data\"" << '\n';
     if (write_faces)
-      out << "member \"faces\" value \"face data\"" << std::endl;
-  out << "end" << std::endl;  
+      out << "member \"faces\" value \"face data\"" << '\n';
+  out << "end" << '\n';  
+
+                                  // make sure everything now gets to
+                                  // disk
+  out.flush ();
+
+  AssertThrow (out, ExcIO());
 }
 
 
@@ -283,19 +289,19 @@ void GridOut::write_ucd (const Triangulation<dim> &tria,
                                       // use
       std::time_t  time1= std::time (0);
       std::tm     *time = std::localtime(&time1); 
-      out << "# This file was generated by the deal.II library." << std::endl
+      out << "# This file was generated by the deal.II library." << '\n'
          << "# Date =  "
          << time->tm_year+1900 << "/"
          << time->tm_mon+1 << "/"
-         << time->tm_mday << std::endl
+         << time->tm_mday << '\n'
          << "# Time =  "
          << time->tm_hour << ":"
          << std::setw(2) << time->tm_min << ":"
-         << std::setw(2) << time->tm_sec << std::endl
-         << "#" << std::endl
+         << std::setw(2) << time->tm_sec << '\n'
+         << "#" << '\n'
          << "# For a description of the UCD format see the AVS Developer's guide."
-         << std::endl
-         << "#" << std::endl;
+         << '\n'
+         << "#" << '\n';
     };
 
                                   // start with ucd data
@@ -304,7 +310,7 @@ void GridOut::write_ucd (const Triangulation<dim> &tria,
                                  n_boundary_faces(tria) :
                                  0)
       << " 0 0 0"                  // no data
-      << std::endl;
+      << '\n';
 
                                   // actually write the vertices.
                                   // note that we shall number them
@@ -317,7 +323,7 @@ void GridOut::write_ucd (const Triangulation<dim> &tria,
            << vertices[i];
        for (unsigned int d=dim+1; d<=3; ++d)
          out << " 0";             // fill with zeroes
-       out << std::endl;
+       out << '\n';
       };
        
                                   // write cells. Enumerate cells
@@ -356,7 +362,7 @@ void GridOut::write_ucd (const Triangulation<dim> &tria,
       for (unsigned int vertex=0; vertex<GeometryInfo<dim>::vertices_per_cell;
           ++vertex)
        out << cell->vertex_index(GeometryInfo<dim>::ucd_to_deal[vertex])+1 << ' ';
-      out << std::endl;
+      out << '\n';
     };
 
                                   // write faces with non-zero boundary
@@ -364,6 +370,10 @@ void GridOut::write_ucd (const Triangulation<dim> &tria,
   if (ucd_flags.write_faces)
     write_ucd_faces (tria, cell_index, out);
     
+                                  // make sure everything now gets to
+                                  // disk
+  out.flush ();
+
   AssertThrow (out, ExcIO());
 }
 
@@ -393,13 +403,13 @@ void GridOut::write_xfig (const Triangulation<dim>& tria,
 
                                   // The following text was copied
                                   // from an existing XFig file.
-  out << "#FIG 3.2\nLandscape\nCenter\nInches" << std::endl
-      << "A4\n100.00\nSingle" << std::endl
+  out << "#FIG 3.2\nLandscape\nCenter\nInches" << '\n'
+      << "A4\n100.00\nSingle" << '\n'
                                     // Background is transparent
-      << "-3" << std::endl
-      << "# generated by deal.II GridOut class" << std::endl
-      << "# reduce first number to scale up image" << std::endl
-      << "1200 2" << std::endl;
+      << "-3" << '\n'
+      << "# generated by deal.II GridOut class" << '\n'
+      << "# reduce first number to scale up image" << '\n'
+      << "1200 2" << '\n';
 
                                   // We write all cells and cells on
                                   // coarser levels are behind cells
@@ -435,7 +445,7 @@ void GridOut::write_xfig (const Triangulation<dim>& tria,
                                         // some style parameters
          << " 0 0 -1 0 0 "
                                         // number of points
-         << nv+1 << std::endl;
+         << nv+1 << '\n';
 
                                       // For each point, write scaled
                                       // and shifted coordinates
@@ -451,7 +461,7 @@ void GridOut::write_xfig (const Triangulation<dim>& tria,
                              (p(d)-xfig_flags.offset(d)));
              out << '\t' << val;
            }
-         out << std::endl;
+         out << '\n';
        }
                                       // Now write boundary edges
       static const unsigned int face_reorder[4]={2,1,3,0};
@@ -480,7 +490,7 @@ void GridOut::write_xfig (const Triangulation<dim>& tria,
                                                   // some style parameters
                    << " 0 0 -1 0 0 "
                                                   // number of points
-                   << nvf << std::endl;
+                   << nvf << '\n';
                
                                                 // For each point, write scaled
                                                 // and shifted coordinates
@@ -496,11 +506,17 @@ void GridOut::write_xfig (const Triangulation<dim>& tria,
                                        (p(d)-xfig_flags.offset(d)));
                        out << '\t' << val;
                      }
-                   out << std::endl;
+                   out << '\n';
                  } 
              }
          }
     }
+
+                                  // make sure everything now gets to
+                                  // disk
+  out.flush ();
+
+  AssertThrow (out, ExcIO());
 }
 
 #endif
@@ -574,7 +590,7 @@ void GridOut::write_ucd_faces (const Triangulation<dim> &tria,
                                       // note: vertex numbers are 1-base
        for (unsigned int vertex=0; vertex<GeometryInfo<dim>::vertices_per_face; ++vertex)
          out << face->vertex_index(GeometryInfo<dim-1>::ucd_to_deal[vertex])+1 << ' ';
-       out << std::endl;
+       out << '\n';
 
        ++index;
       };         
@@ -595,17 +611,22 @@ void GridOut::write_gnuplot (const Triangulation<1> &tria,
   for (; cell!=endc; ++cell)
     {
       if (gnuplot_flags.write_cell_numbers)
-       out << "# cell " << cell << std::endl;
+       out << "# cell " << cell << '\n';
 
       out << cell->vertex(0)
          << ' ' << cell->level()
-         << ' ' << static_cast<unsigned int>(cell->material_id()) << std::endl
+         << ' ' << static_cast<unsigned int>(cell->material_id()) << '\n'
          << cell->vertex(1)
                    << ' ' << cell->level()
-         << ' ' << static_cast<unsigned int>(cell->material_id()) << std::endl
-         << std::endl;
+         << ' ' << static_cast<unsigned int>(cell->material_id()) << '\n'
+         << '\n';
       break;
     }
+
+                                  // make sure everything now gets to
+                                  // disk
+  out.flush ();
+
   AssertThrow (out, ExcIO());
 }
 
@@ -652,7 +673,7 @@ void GridOut::write_gnuplot (const Triangulation<2> &tria,
   for (; cell!=endc; ++cell)
     {
       if (gnuplot_flags.write_cell_numbers)
-       out << "# cell " << cell << std::endl;
+       out << "# cell " << cell << '\n';
 
       if (mapping==0 || !cell->at_boundary())
        {
@@ -666,12 +687,12 @@ void GridOut::write_gnuplot (const Triangulation<2> &tria,
          for (unsigned int i=0; i<GeometryInfo<dim>::vertices_per_cell; ++i)
            out << cell->vertex(GeometryInfo<dim>::ucd_to_deal[i])
                << ' ' << cell->level()
-               << ' ' << static_cast<unsigned int>(cell->material_id()) << std::endl;
+               << ' ' << static_cast<unsigned int>(cell->material_id()) << '\n';
          out << cell->vertex(0)
              << ' ' << cell->level()
-             << ' ' << static_cast<unsigned int>(cell->material_id()) << std::endl
-             << std::endl  // double new line for gnuplot 3d plots
-             << std::endl;
+             << ' ' << static_cast<unsigned int>(cell->material_id()) << '\n'
+             << '\n'  // double new line for gnuplot 3d plots
+             << '\n';
        }
       else
                                         // cell is at boundary and we
@@ -698,10 +719,10 @@ void GridOut::write_gnuplot (const Triangulation<2> &tria,
                            (cell, q_projector->point(offset+i)))
                        << ' ' << cell->level()
                        << ' ' << static_cast<unsigned int>(cell->material_id())
-                       << std::endl;
+                       << '\n';
                  
-                 out << std::endl
-                     << std::endl;
+                 out << '\n'
+                     << '\n';
                }
              else
                {
@@ -713,22 +734,25 @@ void GridOut::write_gnuplot (const Triangulation<2> &tria,
                  out << face->vertex(0)
                      << ' ' << cell->level()
                      << ' ' << static_cast<unsigned int>(cell->material_id())
-                     << std::endl
+                     << '\n'
                      << face->vertex(1)
                      << ' ' << cell->level()
                      << ' ' << static_cast<unsigned int>(cell->material_id())
-                     << std::endl
-                     << std::endl
-                     << std::endl;
+                     << '\n'
+                     << '\n'
+                     << '\n';
                }
            }
        }
     }
 
   if (q_projector != 0)
-    delete q_projector;
-  
+    delete q_projector;  
   
+                                  // make sure everything now gets to
+                                  // disk
+  out.flush ();
+
   AssertThrow (out, ExcIO());
 }
 
@@ -778,74 +802,74 @@ void GridOut::write_gnuplot (const Triangulation<3> &tria,
   for (; cell!=endc; ++cell)
     {
       if (gnuplot_flags.write_cell_numbers)
-       out << "# cell " << cell << std::endl;
+       out << "# cell " << cell << '\n';
 
       if (mapping==0 || n_points==2 || !cell->has_boundary_lines())
        {
                                           // front face
          out << cell->vertex(0)
              << ' ' << cell->level()
-             << ' ' << static_cast<unsigned int>(cell->material_id()) << std::endl
+             << ' ' << static_cast<unsigned int>(cell->material_id()) << '\n'
              << cell->vertex(1)
              << ' ' << cell->level()
-             << ' ' << static_cast<unsigned int>(cell->material_id()) << std::endl
+             << ' ' << static_cast<unsigned int>(cell->material_id()) << '\n'
              << cell->vertex(5)
              << ' ' << cell->level()
-             << ' ' << static_cast<unsigned int>(cell->material_id()) << std::endl
+             << ' ' << static_cast<unsigned int>(cell->material_id()) << '\n'
              << cell->vertex(4)
              << ' ' << cell->level()
-             << ' ' << static_cast<unsigned int>(cell->material_id()) << std::endl
+             << ' ' << static_cast<unsigned int>(cell->material_id()) << '\n'
              << cell->vertex(0)
              << ' ' << cell->level()
-             << ' ' << static_cast<unsigned int>(cell->material_id()) << std::endl
-             << std::endl;
+             << ' ' << static_cast<unsigned int>(cell->material_id()) << '\n'
+             << '\n';
                                           // back face
          out << cell->vertex(2)
              << ' ' << cell->level()
-             << ' ' << static_cast<unsigned int>(cell->material_id()) << std::endl
+             << ' ' << static_cast<unsigned int>(cell->material_id()) << '\n'
              << cell->vertex(3)
              << ' ' << cell->level()
-             << ' ' << static_cast<unsigned int>(cell->material_id()) << std::endl
+             << ' ' << static_cast<unsigned int>(cell->material_id()) << '\n'
              << cell->vertex(7)
              << ' ' << cell->level()
-             << ' ' << static_cast<unsigned int>(cell->material_id()) << std::endl
+             << ' ' << static_cast<unsigned int>(cell->material_id()) << '\n'
              << cell->vertex(6)
              << ' ' << cell->level()
-             << ' ' << static_cast<unsigned int>(cell->material_id()) << std::endl
+             << ' ' << static_cast<unsigned int>(cell->material_id()) << '\n'
              << cell->vertex(2)
              << ' ' << cell->level()
-             << ' ' << static_cast<unsigned int>(cell->material_id()) << std::endl
-             << std::endl;
+             << ' ' << static_cast<unsigned int>(cell->material_id()) << '\n'
+             << '\n';
          
                                           // now for the four connecting lines
          out << cell->vertex(0)
              << ' ' << cell->level()
-             << ' ' << static_cast<unsigned int>(cell->material_id()) << std::endl
+             << ' ' << static_cast<unsigned int>(cell->material_id()) << '\n'
              << cell->vertex(2)
              << ' ' << cell->level()
-             << ' ' << static_cast<unsigned int>(cell->material_id()) << std::endl
-             << std::endl;
+             << ' ' << static_cast<unsigned int>(cell->material_id()) << '\n'
+             << '\n';
          out << cell->vertex(1)
              << ' ' << cell->level()
-             << ' ' << static_cast<unsigned int>(cell->material_id()) << std::endl
+             << ' ' << static_cast<unsigned int>(cell->material_id()) << '\n'
              << cell->vertex(3)
              << ' ' << cell->level()
-             << ' ' << static_cast<unsigned int>(cell->material_id()) << std::endl
-             << std::endl;
+             << ' ' << static_cast<unsigned int>(cell->material_id()) << '\n'
+             << '\n';
          out << cell->vertex(5)
              << ' ' << cell->level()
-             << ' ' << static_cast<unsigned int>(cell->material_id()) << std::endl
+             << ' ' << static_cast<unsigned int>(cell->material_id()) << '\n'
              << cell->vertex(7)
              << ' ' << cell->level()
-             << ' ' << static_cast<unsigned int>(cell->material_id()) << std::endl
-             << std::endl;
+             << ' ' << static_cast<unsigned int>(cell->material_id()) << '\n'
+             << '\n';
          out << cell->vertex(4)
              << ' ' << cell->level()
-             << ' ' << static_cast<unsigned int>(cell->material_id()) << std::endl
+             << ' ' << static_cast<unsigned int>(cell->material_id()) << '\n'
              << cell->vertex(6)
              << ' ' << cell->level()
-             << ' ' << static_cast<unsigned int>(cell->material_id()) << std::endl
-             << std::endl;
+             << ' ' << static_cast<unsigned int>(cell->material_id()) << '\n'
+             << '\n';
        }
       else
        {
@@ -864,27 +888,27 @@ void GridOut::write_gnuplot (const Triangulation<3> &tria,
                          cell, q_projector->point(offset+i*n_points+j));
                        out << p0
                            << ' ' << cell->level()
-                           << ' ' << static_cast<unsigned int>(cell->material_id()) << std::endl;
+                           << ' ' << static_cast<unsigned int>(cell->material_id()) << '\n';
                        out << (mapping->transform_unit_to_real_cell(
                                  cell, q_projector->point(offset+(i+1)*n_points+j)))
                            << ' ' << cell->level()
-                           << ' ' << static_cast<unsigned int>(cell->material_id()) << std::endl;
+                           << ' ' << static_cast<unsigned int>(cell->material_id()) << '\n';
                        out << (mapping->transform_unit_to_real_cell(
                                  cell, q_projector->point(offset+(i+1)*n_points+j+1)))
                            << ' ' << cell->level()
-                           << ' ' << static_cast<unsigned int>(cell->material_id()) << std::endl;
+                           << ' ' << static_cast<unsigned int>(cell->material_id()) << '\n';
                        out << (mapping->transform_unit_to_real_cell(
                                  cell, q_projector->point(offset+i*n_points+j+1)))
                            << ' ' << cell->level()
-                           << ' ' << static_cast<unsigned int>(cell->material_id()) << std::endl;
+                           << ' ' << static_cast<unsigned int>(cell->material_id()) << '\n';
                                                         // and the
                                                         // first
                                                         // point
                                                         // again
                        out << p0
                            << ' ' << cell->level()
-                           << ' ' << static_cast<unsigned int>(cell->material_id()) << std::endl;
-                       out << std::endl << std::endl;
+                           << ' ' << static_cast<unsigned int>(cell->material_id()) << '\n';
+                       out << '\n' << '\n';
                      }
                }
              else
@@ -913,17 +937,17 @@ void GridOut::write_gnuplot (const Triangulation<3> &tria,
                            out << (mapping->transform_unit_to_real_cell
                                    (cell, (1-boundary_points[i][0])*u0+boundary_points[i][0]*u1))
                                << ' ' << cell->level()
-                               << ' ' << static_cast<unsigned int>(cell->material_id()) << std::endl;
+                               << ' ' << static_cast<unsigned int>(cell->material_id()) << '\n';
                        }
                      else
                        out << v0
                            << ' ' << cell->level()
-                           << ' ' << static_cast<unsigned int>(cell->material_id()) << std::endl
+                           << ' ' << static_cast<unsigned int>(cell->material_id()) << '\n'
                            << v1
                            << ' ' << cell->level()
-                           << ' ' << static_cast<unsigned int>(cell->material_id()) << std::endl;
+                           << ' ' << static_cast<unsigned int>(cell->material_id()) << '\n';
 
-                     out << std::endl << std::endl;
+                     out << '\n' << '\n';
                    }
                }
            }
@@ -934,6 +958,10 @@ void GridOut::write_gnuplot (const Triangulation<3> &tria,
     delete q_projector;
   
   
+                                  // make sure everything now gets to
+                                  // disk
+  out.flush ();
+
   AssertThrow (out, ExcIO());
 }
 
@@ -1232,16 +1260,16 @@ void GridOut::write_eps (const Triangulation<dim> &tria,
                                       // use
       std::time_t  time1= std::time (0);
       std::tm     *time = std::localtime(&time1); 
-      out << "%!PS-Adobe-2.0 EPSF-1.2" << std::endl
-         << "%%Title: deal.II Output" << std::endl
-         << "%%Creator: the deal.II library" << std::endl
+      out << "%!PS-Adobe-2.0 EPSF-1.2" << '\n'
+         << "%%Title: deal.II Output" << '\n'
+         << "%%Creator: the deal.II library" << '\n'
          << "%%Creation Date: " 
          << time->tm_year+1900 << "/"
          << time->tm_mon+1 << "/"
          << time->tm_mday << " - "
          << time->tm_hour << ":"
          << std::setw(2) << time->tm_min << ":"
-         << std::setw(2) << time->tm_sec << std::endl
+         << std::setw(2) << time->tm_sec << '\n'
          << "%%BoundingBox: "
                                         // lower left corner
          << "0 0 "
@@ -1249,7 +1277,7 @@ void GridOut::write_eps (const Triangulation<dim> &tria,
          << static_cast<unsigned int>(std::floor(( (x_max-x_min) * scale )+1))
          << ' '
           << static_cast<unsigned int>(std::floor(( (y_max-y_min) * scale )+1))
-         << std::endl;
+         << '\n';
 
                                       // define some abbreviations to keep
                                       // the output small:
@@ -1257,10 +1285,10 @@ void GridOut::write_eps (const Triangulation<dim> &tria,
                                       // x=execute line stroke
                                       // b=black pen
                                       // r=red pen
-      out << "/m {moveto} bind def" << std::endl
-         << "/x {lineto stroke} bind def" << std::endl
-         << "/b {0 0 0 setrgbcolor} def" << std::endl
-         << "/r {1 0 0 setrgbcolor} def" << std::endl;
+      out << "/m {moveto} bind def" << '\n'
+         << "/x {lineto stroke} bind def" << '\n'
+         << "/b {0 0 0 setrgbcolor} def" << '\n'
+         << "/r {1 0 0 setrgbcolor} def" << '\n';
 
                                       // calculate colors for level
                                       // coloring; level 0 is black,
@@ -1271,7 +1299,7 @@ void GridOut::write_eps (const Triangulation<dim> &tria,
             << (max_level)
             << " add "
             << (0.66666/std::max(1U,(max_level-1)))
-            << " mul 1 0.8 sethsbcolor} def" << std::endl;
+            << " mul 1 0.8 sethsbcolor} def" << '\n';
 
                                       // in 2d, we can also plot cell
                                       // and vertex numbers, but this
@@ -1297,14 +1325,14 @@ void GridOut::write_eps (const Triangulation<dim> &tria,
                  "{pop} ifelse} forall} bind def\n"
                  "/MCshow { currentpoint stroke m\n"
                  "exch dup MFwidth -2 div 3 -1 roll R MFshow } def\n")
-             << std::endl;
+             << '\n';
        };
       
-      out << "%%EndProlog" << std::endl
-         << std::endl;
+      out << "%%EndProlog" << '\n'
+         << '\n';
 
                                       // set fine lines
-      out << eps_flags_base.line_width << " setlinewidth" << std::endl;
+      out << eps_flags_base.line_width << " setlinewidth" << '\n';
     };
 
                                   // now write the lines
@@ -1320,18 +1348,18 @@ void GridOut::write_eps (const Triangulation<dim> &tria,
       out << line->level
          << " l "
          << (line->first  - offset) * scale << " m "
-         << (line->second - offset) * scale << " x" << std::endl;
+         << (line->second - offset) * scale << " x" << '\n';
     else
       out << ((line->colorize && eps_flags_base.color_lines_on_user_flag) ? "r " : "b ")
          << (line->first  - offset) * scale << " m "
-         << (line->second - offset) * scale << " x" << std::endl;
+         << (line->second - offset) * scale << " x" << '\n';
     
                                   // finally write the cell numbers
                                   // in 2d, if that is desired
   if ((dim == 2) && (eps_flags_2.write_cell_numbers == true))
     {
       out << "(Helvetica) findfont 140 scalefont setfont"
-         << std::endl;
+         << '\n';
       
       typename Triangulation<dim>::active_cell_iterator
        cell = tria.begin_active (),
@@ -1340,7 +1368,7 @@ void GridOut::write_eps (const Triangulation<dim> &tria,
        {
          out << (cell->center()(0)-offset(0))*scale << ' '
              << (cell->center()(1)-offset(1))*scale
-             << " m" << std::endl
+             << " m" << '\n'
              << "[ [(Helvetica) 12.0 0.0 true true (";
          if (eps_flags_2.write_cell_number_level)
            out << cell;
@@ -1349,7 +1377,7 @@ void GridOut::write_eps (const Triangulation<dim> &tria,
 
          out << ")] "
              << "] -6 MCshow"
-             << std::endl;
+             << '\n';
        };
     };
 
@@ -1357,7 +1385,7 @@ void GridOut::write_eps (const Triangulation<dim> &tria,
   if ((dim == 2) && (eps_flags_2.write_vertex_numbers == true))
     {
       out << "(Helvetica) findfont 140 scalefont setfont"
-         << std::endl;
+         << '\n';
 
                                       // have a list of those
                                       // vertices which we have
@@ -1379,17 +1407,21 @@ void GridOut::write_eps (const Triangulation<dim> &tria,
              
              out << (cell->vertex(vertex)(0)-offset(0))*scale << ' '
                  << (cell->vertex(vertex)(1)-offset(1))*scale
-                 << " m" << std::endl
+                 << " m" << '\n'
                  << "[ [(Helvetica) 10.0 0.0 true true ("
                  << cell->vertex_index(vertex)
                  << ")] "
                  << "] -6 MCshow"
-                 << std::endl;
+                 << '\n';
            };
     };
   
-  out << "showpage" << std::endl;
+  out << "showpage" << '\n';
   
+                                  // make sure everything now gets to
+                                  // disk
+  out.flush ();
+
   AssertThrow (out, ExcIO());
 }
 

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.