From: Wolfgang Bangerth Date: Tue, 25 Jan 2011 14:38:23 +0000 (+0000) Subject: Restore original behavior. X-Git-Tag: v8.0.0~4434 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=255142406988434f4b9c87549deb2fa581668c86;p=dealii.git Restore original behavior. git-svn-id: https://svn.dealii.org/trunk@23262 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/source/base/data_out_base.cc b/deal.II/source/base/data_out_base.cc index 87b87a5732..b6f36224f3 100644 --- a/deal.II/source/base/data_out_base.cc +++ b/deal.II/source/base/data_out_base.cc @@ -1008,7 +1008,7 @@ namespace unsigned int d1, unsigned int d2, unsigned int d3) - { + { stream << start << '\t' << start+d1; if (dim>=2) @@ -1933,7 +1933,7 @@ void DataOutBase::write_ucd (const std::vector > &patches, if (patches.size() == 0) return; #endif - + const unsigned int n_data_sets = data_names.size(); UcdStream ucd_out(out, flags); @@ -2316,7 +2316,7 @@ void DataOutBase::write_gnuplot (const std::vector > &patche if (patches.size() == 0) return; #endif - + const unsigned int n_data_sets = data_names.size(); // write preamble @@ -2915,7 +2915,7 @@ void DataOutBase::write_eps (const std::vector > &patches, if (patches.size() == 0) return; #endif - + // Do not allow volume rendering AssertThrow (dim==2, ExcNotImplemented()); @@ -3276,7 +3276,7 @@ void DataOutBase::write_gmv (const std::vector > &patches, { Assert(dim<=3, ExcNotImplemented()); AssertThrow (out, ExcIO()); - + #ifndef DEAL_II_COMPILER_SUPPORTS_MPI // verify that there are indeed // patches to be written out. most @@ -3296,7 +3296,7 @@ void DataOutBase::write_gmv (const std::vector > &patches, 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 @@ -3450,7 +3450,7 @@ void DataOutBase::write_tecplot (const std::vector > &patche if (patches.size() == 0) return; #endif - + TecplotStream tecplot_out(out, flags); const unsigned int n_data_sets = data_names.size(); @@ -3741,7 +3741,7 @@ void DataOutBase::write_tecplot_binary (const std::vector > 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 @@ -4052,7 +4052,7 @@ DataOutBase::write_vtk (const std::vector > &patches, if (patches.size() == 0) return; #endif - + VtkStream vtk_out(out, flags); const unsigned int n_data_sets = data_names.size(); @@ -4320,9 +4320,9 @@ namespace char* codechar = code_out; char result; char fragment; - + result = state_in->result; - + switch (state_in->step) { while (1) @@ -4370,7 +4370,7 @@ namespace int base64_encode_blockend(char* code_out, base64_encodestate* state_in) { char* codechar = code_out; - + switch (state_in->step) { case step_B: @@ -4386,12 +4386,12 @@ namespace break; } *codechar++ = '\0'; - + return codechar - code_out; } } - - + + /** * Do a base64 encoding of the given data. * @@ -4420,12 +4420,12 @@ namespace 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 @@ -4453,7 +4453,7 @@ namespace 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 */ @@ -4464,17 +4464,17 @@ namespace 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 @@ -4513,7 +4513,7 @@ DataOutBase::write_vtu (const std::vector > &patches, if (patches.size() == 0) return; #endif - + VtuStream vtu_out(out, flags); const unsigned int n_data_sets = data_names.size(); @@ -4610,7 +4610,7 @@ DataOutBase::write_vtu (const std::vector > &patches, out << "\n"; out << " \n"; -#if !defined(HAVE_LIBZ) && 1 +#if !defined(HAVE_LIBZ) || 1 out << " \n"; write_nodes(patches, vtu_out); out << " \n"; @@ -4653,7 +4653,7 @@ DataOutBase::write_vtu (const std::vector > &patches, } } -/* +/* const char * encoded_vertices = encode_block ((char*)&vertices[0], @@ -4665,7 +4665,7 @@ DataOutBase::write_vtu (const std::vector > &patches, data = compress_and_encode_block (vertices); out << data.first << data.second; - + delete[] data.first; delete[] data.second; } @@ -4678,7 +4678,7 @@ DataOutBase::write_vtu (const std::vector > &patches, out << " \n"; write_cells(patches, vtu_out); out << " \n"; - + // XML VTU format uses offsets; this is // different than the VTK format, which // puts the number of nodes per cell in @@ -4686,21 +4686,21 @@ DataOutBase::write_vtu (const std::vector > &patches, out << " \n"; for(unsigned int i=0; i::vertices_per_cell); - out << "\n"; + out << "\n"; out << " \n"; - + // next output the types of the // cells. since all cells are // the same, this is simple out << " \n"; - + for (unsigned int i=0; i\n"; + out << "\n"; + out << " \n"; out << " \n"; - + /////////////////////////////////////// // data output. @@ -4750,7 +4750,7 @@ DataOutBase::write_vtu (const std::vector > &patches, // underscores unless a vector // name has been specified out << " (vector_data_ranges[n_th_vector]) != "") out << std_cxx1x::get<2>(vector_data_ranges[n_th_vector]); else @@ -4799,7 +4799,7 @@ DataOutBase::write_vtu (const std::vector > &patches, Assert (false, ExcInternalError()); } } - + out << " \n"; } @@ -4810,7 +4810,7 @@ DataOutBase::write_vtu (const std::vector > &patches, out << " \n"; - + std::copy (data_vectors[data_set].begin(), data_vectors[data_set].end(), std::ostream_iterator(out, "\n")); @@ -5064,15 +5064,15 @@ DataOutInterface::write_pvtu_record (std::ostream &out, const std::vector &piece_names) const { AssertThrow (out, ExcIO()); - + const std::vector data_names = get_dataset_names(); const std::vector > vector_data_ranges = get_vector_data_ranges(); - + const unsigned int n_data_sets = data_names.size(); - + out << "\n"; - + std::time_t time1= std::time (0); std::tm *time = std::localtime(&time1); out << "\n"; - + out << "\n"; out << " \n"; out << " \n"; - + // We need to output in the same order as - // the write_vtu function does: + // the write_vtu function does: std::vector data_set_written (n_data_sets, false); for (unsigned int n_th_vector=0; n_th_vector::write_pvtu_record (std::ostream &out, - 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 << " (vector_data_ranges[n_th_vector]) != "") out << std_cxx1x::get<2>(vector_data_ranges[n_th_vector]); else @@ -5130,32 +5130,32 @@ DataOutInterface::write_pvtu_record (std::ostream &out, 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"; - } + } out << " \n"; out << " \n"; out << " \n"; out << " \n"; - - for(unsigned int i=0; i\n"; - + out << " \n"; out << "\n"; - + out.flush(); - + // assert the stream is still ok AssertThrow (out, ExcIO()); } @@ -5221,10 +5221,10 @@ DataOutInterface::write (std::ostream &out, case vtk: write_vtk (out); break; - + case vtu: write_vtu (out); - break; + break; case deal_II_intermediate: write_deal_II_intermediate (out);