<< 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.
// 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";
///////////////////////////////////////
// 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
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
}
}
- out << " </DataArray> \n";
+ out << " </DataArray>\n";
}
// now do the left over scalar data sets
{
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 ();
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 << "/"
<< 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)
{
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)
{
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();