unsigned int d1,
unsigned int d2,
unsigned int d3)
- {
+ {
stream << start << '\t'
<< start+d1;
if (dim>=2)
if (patches.size() == 0)
return;
#endif
-
+
const unsigned int n_data_sets = data_names.size();
UcdStream ucd_out(out, flags);
if (patches.size() == 0)
return;
#endif
-
+
const unsigned int n_data_sets = data_names.size();
// write preamble
if (patches.size() == 0)
return;
#endif
-
+
// Do not allow volume rendering
AssertThrow (dim==2, ExcNotImplemented());
{
Assert(dim<=3, ExcNotImplemented());
AssertThrow (out, ExcIO());
-
+
#ifndef DEAL_II_COMPILER_SUPPORTS_MPI
// verify that there are indeed
// patches to be written out. most
if (patches.size() == 0)
return;
#endif
-
+
GmvStream gmv_out(out, flags);
const unsigned int n_data_sets = data_names.size();
// check against # of data sets in
if (patches.size() == 0)
return;
#endif
-
+
TecplotStream tecplot_out(out, flags);
const unsigned int n_data_sets = data_names.size();
if (patches.size() == 0)
return;
#endif
-
+
const unsigned int n_data_sets = data_names.size();
// check against # of data sets in
// first patch. checks against all
if (patches.size() == 0)
return;
#endif
-
+
VtkStream vtk_out(out, flags);
const unsigned int n_data_sets = data_names.size();
char* codechar = code_out;
char result;
char fragment;
-
+
result = state_in->result;
-
+
switch (state_in->step)
{
while (1)
int base64_encode_blockend(char* code_out, base64_encodestate* state_in)
{
char* codechar = code_out;
-
+
switch (state_in->step)
{
case step_B:
break;
}
*codechar++ = '\0';
-
+
return codechar - code_out;
}
}
-
-
+
+
/**
* Do a base64 encoding of the given data.
*
encoded_data + encoded_length_header, &state);
base64::base64_encode_blockend (encoded_data + encoded_length_header + encoded_length_data,
&state);
-
+
return encoded_data;
}
-
-
+
+
#ifdef HAVE_LIBZ
/**
* Do a zlib compression followed by a
data.size() * sizeof(T),
Z_BEST_COMPRESSION);
Assert (err == Z_OK, ExcInternalError());
-
+
// now encode the compression header
const uint32_t compression_header[5]
= { 1, /* number of blocks */
char *encoded_header = encode_block ((char*)&compression_header[0],
5 * sizeof(compression_header[0]));
-
-
+
+
// now do the encoding in base64
char *encoded_data = encode_block (compressed_data,
compressed_data_length);
-
+
// release the buffer for the
// compressed data and return the
// encoded data
delete[] compressed_data;
-
+
return std::make_pair (encoded_header, encoded_data);
}
else
if (patches.size() == 0)
return;
#endif
-
+
VtuStream vtu_out(out, flags);
const unsigned int n_data_sets = data_names.size();
out << "<Piece NumberOfPoints=\"" << n_nodes
<<"\" NumberOfCells=\"" << n_cells << "\" >\n";
out << " <Points>\n";
-#if !defined(HAVE_LIBZ) && 1
+#if !defined(HAVE_LIBZ) || 1
out << " <DataArray type=\"Float64\" NumberOfComponents=\"3\" format=\"ascii\">\n";
write_nodes(patches, vtu_out);
out << " </DataArray>\n";
}
}
-/*
+/*
const char *
encoded_vertices
= encode_block ((char*)&vertices[0],
data
= compress_and_encode_block (vertices);
out << data.first << data.second;
-
+
delete[] data.first;
delete[] data.second;
}
out << " <DataArray type=\"Int32\" Name=\"connectivity\" format=\"ascii\">\n";
write_cells(patches, vtu_out);
out << " </DataArray>\n";
-
+
// XML VTU format uses offsets; this is
// different than the VTK format, which
// puts the number of nodes per cell in
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 << "\n";
+ out << "\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";
-
+
for (unsigned int i=0; i<n_cells; ++i)
out << ' ' << vtk_cell_type[dim];
- out << "\n";
- out << " </DataArray>\n";
+ out << "\n";
+ out << " </DataArray>\n";
out << " </Cells>\n";
-
+
///////////////////////////////////////
// data output.
// underscores unless a vector
// name has been specified
out << " <DataArray type=\"Float64\" Name=\"";
-
+
if (std_cxx1x::get<2>(vector_data_ranges[n_th_vector]) != "")
out << std_cxx1x::get<2>(vector_data_ranges[n_th_vector]);
else
Assert (false, ExcInternalError());
}
}
-
+
out << " </DataArray>\n";
}
out << " <DataArray type=\"Float64\" Name=\""
<< data_names[data_set]
<< "\" format=\"ascii\">\n";
-
+
std::copy (data_vectors[data_set].begin(),
data_vectors[data_set].end(),
std::ostream_iterator<double>(out, "\n"));
const std::vector<std::string> &piece_names) const
{
AssertThrow (out, ExcIO());
-
+
const std::vector<std::string> data_names = get_dataset_names();
const std::vector<std_cxx1x::tuple<unsigned int, unsigned int, std::string> > vector_data_ranges
= get_vector_data_ranges();
-
+
const unsigned int n_data_sets = data_names.size();
-
+
out << "<?xml version=\"1.0\"?>\n";
-
+
std::time_t time1= std::time (0);
std::tm *time = std::localtime(&time1);
out << "<!--\n";
<< std::setw(2) << time->tm_min << ":"
<< std::setw(2) << time->tm_sec
<< "\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:
+ // 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)
{
- std_cxx1x::get<0>(vector_data_ranges[n_th_vector]) <= 3,
ExcMessage ("Can't declare a vector with more than 3 components "
"in VTK"));
-
+
// mark these components as already
// written:
for (unsigned int i=std_cxx1x::get<0>(vector_data_ranges[n_th_vector]);
i<=std_cxx1x::get<1>(vector_data_ranges[n_th_vector]);
++i)
data_set_written[i] = true;
-
+
// write the
// header. concatenate all the
// component names with double
// underscores unless a vector
// name has been specified
out << " <PDataArray type=\"Float64\" Name=\"";
-
+
if (std_cxx1x::get<2>(vector_data_ranges[n_th_vector]) != "")
out << std_cxx1x::get<2>(vector_data_ranges[n_th_vector]);
else
out << data_names[i] << "__";
out << data_names[std_cxx1x::get<1>(vector_data_ranges[n_th_vector])];
}
-
+
out << "\" NumberOfComponents=\"3\" format=\"ascii\"/>\n";
}
-
+
for (unsigned int data_set=0; data_set<n_data_sets; ++data_set)
if (data_set_written[data_set] == false)
{
out << " <PDataArray type=\"Float64\" Name=\""
<< data_names[data_set]
<< "\" format=\"ascii\"/>\n";
- }
+ }
out << " </PPointData>\n";
out << " <PPoints>\n";
out << " <PDataArray type=\"Float64\" NumberOfComponents=\"3\"/>\n";
out << " </PPoints>\n";
-
- for(unsigned int i=0; i<piece_names.size(); ++i)
+
+ for(unsigned int i=0; i<piece_names.size(); ++i)
out << " <Piece Source=\"" << piece_names[i] << "\"/>\n";
-
+
out << " </PUnstructuredGrid>\n";
out << "</VTKFile>\n";
-
+
out.flush();
-
+
// assert the stream is still ok
AssertThrow (out, ExcIO());
}
case vtk:
write_vtk (out);
break;
-
+
case vtu:
write_vtu (out);
- break;
+ break;
case deal_II_intermediate:
write_deal_II_intermediate (out);