]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Move declaration of vtu_stream to where it is used. 14449/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Mon, 21 Nov 2022 18:02:18 +0000 (11:02 -0700)
committerWolfgang Bangerth <bangerth@colostate.edu>
Mon, 21 Nov 2022 18:46:23 +0000 (11:46 -0700)
While there, also use the underlying stream rather than vtu_out where possible.

source/base/data_out_base.cc

index a6639db497037ccfde128cf2827a4b22397e848c..bfa6e2add18a7daf1605f42b307ed008cefe88c7 100644 (file)
@@ -6167,8 +6167,6 @@ namespace DataOutBase
     }
 
 
-    VtuStream vtu_out(out, flags);
-
     const unsigned int n_data_sets = data_names.size();
     // check against # of data sets in first patch. checks against all other
     // patches are made in write_gmv_reorder_data_vectors
@@ -6247,6 +6245,8 @@ namespace DataOutBase
     out << "  </Points>\n\n";
     //-------------------------------
     // now for the cells
+    VtuStream vtu_out(out, flags);
+
     out << "  <Cells>\n";
     out << "    <DataArray type=\"Int32\" Name=\"connectivity\" format=\""
         << ascii_or_binary << "\">\n";
@@ -6347,16 +6347,16 @@ namespace DataOutBase
         for (unsigned int i = 0; i < cell_types.size(); ++i)
           cell_types_uint8_t[i] = static_cast<std::uint8_t>(cell_types[i]);
 
-        vtu_out << vtu_stringize_array(cell_types_uint8_t,
-                                       flags.compression_level,
-                                       out.precision());
+        out << vtu_stringize_array(cell_types_uint8_t,
+                                   flags.compression_level,
+                                   out.precision());
       }
     else
 #endif
       {
-        vtu_out << vtu_stringize_array(cell_types,
-                                       flags.compression_level,
-                                       out.precision());
+        out << vtu_stringize_array(cell_types,
+                                   flags.compression_level,
+                                   out.precision());
       }
 
     out << '\n';

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.