From 15610a5f7b70430500d4471d52bf0f6939b4344f Mon Sep 17 00:00:00 2001 From: Rene Gassmoeller Date: Tue, 26 Dec 2017 15:33:47 -0600 Subject: [PATCH] Write data and vertices as floats --- source/base/data_out_base.cc | 37 ++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/source/base/data_out_base.cc b/source/base/data_out_base.cc index 6ac99bf6c1..6bcefb5ef9 100644 --- a/source/base/data_out_base.cc +++ b/source/base/data_out_base.cc @@ -400,10 +400,10 @@ namespace DataOutBase * Note that because of the similarity of the formats, this function * is also used by the Vtk and Tecplot output functions. */ - template + template void write_gmv_reorder_data_vectors (const std::vector > &patches, - Table<2,double> &data_vectors) + Table<2,Number> &data_vectors) { // unlike in the main function, we // don't have here the data_names @@ -456,6 +456,7 @@ namespace DataOutBase + DataOutFilter::DataOutFilter() : flags(false, true), @@ -1160,10 +1161,10 @@ namespace * arrays needs to match what * we print in the XML-preamble * to the respective parts of - * VTU files (e.g. Float64 and + * VTU files (e.g. Float32 and * Int32) */ - std::vector vertices; + std::vector vertices; std::vector cells; }; @@ -5266,7 +5267,7 @@ namespace DataOutBase // component names with double // underscores unless a vector // name has been specified - out << " (vector_data_ranges[n_th_vector]) != "") out << std::get<2>(vector_data_ranges[n_th_vector]); @@ -5285,7 +5286,7 @@ namespace DataOutBase for (unsigned int data_set=0; data_set\n"; } @@ -5379,11 +5380,11 @@ namespace DataOutBase // separate task and when wanting // to write out the data, we wait // for that task to finish - Table<2,double> data_vectors (n_data_sets, n_nodes); + Table<2,float> data_vectors (n_data_sets, n_nodes); void (*fun_ptr) (const std::vector > &, - Table<2,double> &) - = &write_gmv_reorder_data_vectors; + Table<2,float> &) + = &write_gmv_reorder_data_vectors; Threads::Task<> reorder_task = Threads::new_task (fun_ptr, patches, data_vectors); @@ -5398,7 +5399,7 @@ namespace DataOutBase out << "\n"; out << " \n"; - out << " \n"; write_nodes(patches, vtu_out); out << " \n"; @@ -5497,7 +5498,7 @@ namespace DataOutBase // component names with double // underscores unless a vector // name has been specified - out << " (vector_data_ranges[n_th_vector]) != "") out << std::get<2>(vector_data_ranges[n_th_vector]); @@ -5516,7 +5517,7 @@ namespace DataOutBase // now write data. pad all // vectors to have three // components - std::vector data; + std::vector data; data.reserve (n_nodes*dim); for (unsigned int n=0; n\n"; - std::vector data (data_vectors[data_set].begin(), - data_vectors[data_set].end()); + std::vector data (data_vectors[data_set].begin(), + data_vectors[data_set].end()); vtu_out << data; out << " \n"; } @@ -5636,7 +5637,7 @@ namespace DataOutBase // component names with double // underscores unless a vector // name has been specified - out << " (vector_data_ranges[n_th_vector]) != "") out << std::get<2>(vector_data_ranges[n_th_vector]); @@ -5655,7 +5656,7 @@ namespace DataOutBase for (unsigned int data_set=0; data_set\n"; } @@ -5663,7 +5664,7 @@ namespace DataOutBase out << " \n"; out << " \n"; - out << " \n"; + out << " \n"; out << " \n"; for (unsigned int i=0; i