]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Avoid trailing space in output files.
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Mon, 24 Jan 2011 04:18:28 +0000 (04:18 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Mon, 24 Jan 2011 04:18:28 +0000 (04:18 +0000)
git-svn-id: https://svn.dealii.org/trunk@23252 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/source/base/data_out_base.cc

index 993244255c7cb080b16114fd83e2088f8c468b8f..c9d54809df737a6a1dd1e44acf683fcdc75e9386 100644 (file)
@@ -4333,7 +4333,7 @@ DataOutBase::write_vtu (const std::vector<Patch<dim,spacedim> > &patches,
          << time->tm_hour << ":"
          << std::setw(2) << time->tm_min << ":"
          << std::setw(2) << time->tm_sec
-         << "\n --> \n";
+         << "\n-->\n";
                                       // LittleEndian vs BigEndian should not
                                       // matter; we are writing an ascii
                                       // file.
@@ -4385,39 +4385,39 @@ DataOutBase::write_vtu (const std::vector<Patch<dim,spacedim> > &patches,
                                   // note that according to the standard, we
                                   // have to print d=1..3 dimensions, even if
                                   // we are in reality in 2d, for example
-  out << "<Piece NumberOfPoints=\"" << n_nodes <<"\" NumberOfCells=\"" << n_cells << "\" > \n";
-  out << "  <Points> \n";
-  out << "    <DataArray type=\"Float64\" NumberOfComponents=\"3\" format=\"ascii\"> \n";
+  out << "<Piece NumberOfPoints=\"" << n_nodes <<"\" NumberOfCells=\"" << n_cells << "\" >\n";
+  out << "  <Points>\n";
+  out << "    <DataArray type=\"Float64\" NumberOfComponents=\"3\" format=\"ascii\">\n";
   write_nodes(patches, vtu_out);
-  out << "    </DataArray> \n";
-  out << "  </Points> \n \n";
+  out << "    </DataArray>\n";
+  out << "  </Points>\n\n";
                                   /////////////////////////////////
                                   // now for the cells
-  out << "  <Cells> \n";
-  out << "    <DataArray type=\"Int32\" Name=\"connectivity\" format=\"ascii\"> \n";                              
+  out << "  <Cells>\n";
+  out << "    <DataArray type=\"Int32\" Name=\"connectivity\" format=\"ascii\">\n";                               
   write_cells(patches, vtu_out);
-  out << "    </DataArray> \n";
+  out << "    </DataArray>\n";
   
                                   // XML VTU format uses offsets; this is
                                   // different than the VTK format, which
                                   // puts the number of nodes per cell in
                                   // front of the connectivity list.
-  out << "    <DataArray type=\"Int32\" Name=\"offsets\" format=\"ascii\"> \n";
+  out << "    <DataArray type=\"Int32\" Name=\"offsets\" format=\"ascii\">\n";
   for(unsigned int i=0; i<n_cells; ++i)
     out << ' ' << ( (i+1)*GeometryInfo<dim>::vertices_per_cell);
        
-  out << "    </DataArray> \n";
+  out << "    </DataArray>\n";
   
                                   // next output the types of the
                                   // cells. since all cells are
                                   // the same, this is simple
-  out << "    <DataArray type=\"UInt8\" Name=\"types\" format=\"ascii\"> \n";
+  out << "    <DataArray type=\"UInt8\" Name=\"types\" format=\"ascii\">\n";
   
   for (unsigned int i=0; i<n_cells; ++i)
     out << ' ' << vtk_cell_type[dim];
    
-  out << "    </DataArray> \n"; 
-  out << "  </Cells> \n";
+  out << "    </DataArray>\n"; 
+  out << "  </Cells>\n";
   
 
                                   ///////////////////////////////////////
@@ -4434,7 +4434,7 @@ DataOutBase::write_vtu (const std::vector<Patch<dim,spacedim> > &patches,
                                   // we do not support explicitly
                                   // here). all following data sets
                                   // are point data
-  out << "  <PointData Scalars=\"scalars\"> \n";
+  out << "  <PointData Scalars=\"scalars\">\n";
 
                                   // when writing, first write out
                                   // all vector data, then handle the
@@ -4480,7 +4480,7 @@ DataOutBase::write_vtu (const std::vector<Patch<dim,spacedim> > &patches,
                  out << data_names[std_cxx1x::get<1>(vector_data_ranges[n_th_vector])];
                }
 
-      out << "\" NumberOfComponents=\"3\" format=\"ascii\"> \n";
+      out << "\" NumberOfComponents=\"3\" format=\"ascii\">\n";
 
                                       // now write data. pad all
                                       // vectors to have three
@@ -4518,7 +4518,7 @@ DataOutBase::write_vtu (const std::vector<Patch<dim,spacedim> > &patches,
            }
        }
     
-      out << "    </DataArray> \n";
+      out << "    </DataArray>\n";
     }
 
                                   // now do the left over scalar data sets
@@ -4527,21 +4527,21 @@ DataOutBase::write_vtu (const std::vector<Patch<dim,spacedim> > &patches,
       {
        out << "    <DataArray type=\"Float64\" Name=\""
            << data_names[data_set]
-           << "\" format=\"ascii\"> \n";
+           << "\" format=\"ascii\">\n";
            
        std::copy (data_vectors[data_set].begin(),
                   data_vectors[data_set].end(),
                   std::ostream_iterator<double>(out, "\n"));
        out << '\n';
-       out << "    </DataArray> \n";
+       out << "    </DataArray>\n";
       }
 
-  out << "  </PointData> \n";
+  out << "  </PointData>\n";
 
                                   // Finish up writing a valid XML file
-  out << " </Piece> \n";
-  out << " </UnstructuredGrid> \n";
-  out << "</VTKFile> \n";
+  out << " </Piece>\n";
+  out << " </UnstructuredGrid>\n";
+  out << "</VTKFile>\n";
                                   // make sure everything now gets to
                                   // disk
   out.flush ();
@@ -4790,11 +4790,11 @@ DataOutInterface<dim,spacedim>::write_pvtu_record (std::ostream &out,
        
   const unsigned int n_data_sets = data_names.size();
        
-  out << "<?xml version=\"1.0\"?> \n";
+  out << "<?xml version=\"1.0\"?>\n";
        
   std::time_t  time1= std::time (0);
   std::tm     *time = std::localtime(&time1);
-  out << "<!-- \n";
+  out << "<!--\n";
   out << "#This file was generated by the deal.II library on "
       << time->tm_year+1900 << "/"
       << time->tm_mon+1 << "/"
@@ -4802,14 +4802,14 @@ DataOutInterface<dim,spacedim>::write_pvtu_record (std::ostream &out,
       << time->tm_hour << ":"
       << std::setw(2) << time->tm_min << ":"
       << std::setw(2) << time->tm_sec
-      << "\n --> \n";
+      << "\n-->\n";
        
-  out << "<VTKFile type=\"PUnstructuredGrid\" version=\"0.1\" byte_order=\"LittleEndian\"> \n";
-  out << "  <PUnstructuredGrid GhostLevel=\"0\"> \n";
-  out << "    <PPointData Scalars=\"scalars\"> \n";
-       
-                                  // We need to output in the same order as the write_vtu function does:
+  out << "<VTKFile type=\"PUnstructuredGrid\" version=\"0.1\" byte_order=\"LittleEndian\">\n";
+  out << "  <PUnstructuredGrid GhostLevel=\"0\">\n";
+  out << "    <PPointData Scalars=\"scalars\">\n";
        
+                                  // We need to output in the same order as
+                                  // the write_vtu function does:      
   std::vector<bool> data_set_written (n_data_sets, false);
   for (unsigned int n_th_vector=0; n_th_vector<vector_data_ranges.size(); ++n_th_vector)
     {
@@ -4850,7 +4850,7 @@ DataOutInterface<dim,spacedim>::write_pvtu_record (std::ostream &out,
          out << data_names[std_cxx1x::get<1>(vector_data_ranges[n_th_vector])];
        }
        
-      out << "\" NumberOfComponents=\"3\" format=\"ascii\"/> \n";
+      out << "\" NumberOfComponents=\"3\" format=\"ascii\"/>\n";
     }
        
   for (unsigned int data_set=0; data_set<n_data_sets; ++data_set)
@@ -4858,20 +4858,20 @@ DataOutInterface<dim,spacedim>::write_pvtu_record (std::ostream &out,
       {
        out << "    <PDataArray type=\"Float64\" Name=\""
            << data_names[data_set]
-           << "\" format=\"ascii\"/> \n";
+           << "\" format=\"ascii\"/>\n";
       }  
 
-  out << "    </PPointData> \n";
+  out << "    </PPointData>\n";
 
-  out << "    <PPoints> \n";
-  out << "      <PDataArray type=\"Float64\" NumberOfComponents=\"3\"/> \n";
-  out << "    </PPoints> \n";
+  out << "    <PPoints>\n";
+  out << "      <PDataArray type=\"Float64\" NumberOfComponents=\"3\"/>\n";
+  out << "    </PPoints>\n";
        
   for(unsigned int i=0; i<piece_names.size(); ++i)             
-    out << "    <Piece Source=\"" << piece_names[i] << "\"/> \n";
+    out << "    <Piece Source=\"" << piece_names[i] << "\"/>\n";
                
-  out << "  </PUnstructuredGrid> \n";
-  out << "</VTKFile> \n";
+  out << "  </PUnstructuredGrid>\n";
+  out << "</VTKFile>\n";
        
   out.flush();
        

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.