]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Save a few cycles for single-character output.
authorWolfgang Bangerth <bangerth@colostate.edu>
Sat, 5 Feb 2022 22:48:43 +0000 (15:48 -0700)
committerWolfgang Bangerth <bangerth@colostate.edu>
Sat, 5 Feb 2022 22:48:43 +0000 (15:48 -0700)
14 files changed:
examples/step-16/step-16.cc
examples/step-50/step-50.cc
examples/step-71/step-71.cc
examples/step-79/step-79.cc
include/deal.II/differentiation/sd/symengine_number_visitor_internal.h
include/deal.II/differentiation/sd/symengine_optimizer.h
include/deal.II/differentiation/sd/symengine_utilities.h
include/deal.II/lac/affine_constraints.templates.h
source/base/data_out_base.cc
source/base/timer.cc
source/differentiation/ad/ad_drivers.cc
source/differentiation/ad/ad_helpers.cc
source/grid/grid_out.cc
source/numerics/point_value_history.cc

index 5eb6cefb6dbcefb5918ed3bd5d27ae6e36a0fc1f..cd58b79527f90a722004a1c62b0e75e5fc635a09 100644 (file)
@@ -586,7 +586,7 @@ namespace Step16
 
     solver.solve(system_matrix, solution, system_rhs, preconditioner);
     std::cout << "   Number of CG iterations: " << solver_control.last_step()
-              << "\n"
+              << '\n'
               << std::endl;
     constraints.distribute(solution);
   }
index 0ed27598bbee5d91a86e0c0f9c28ac73ca4a96a7..413808475455aa99414aad22b04df8d2f8f64259 100644 (file)
@@ -327,7 +327,7 @@ bool Settings::try_parse(const std::string &prm_filename)
     {
       std::cout << "****  Error: No input file provided!\n"
                 << "****  Error: Call this program as './step-50 input.prm\n"
-                << "\n"
+                << '\n'
                 << "****  You may want to use one of the input files in this\n"
                 << "****  directory, or use the following default values\n"
                 << "****  to create an input file:\n";
index 5389f9e11323985e6d852d88db4203567103d0a9..2dfa635e939960f01385624ab206d38926801a3e 100644 (file)
@@ -3911,8 +3911,8 @@ namespace Step71
               const SymmetricTensor<2, dim> sigma =
                 Physics::Transformations::Piola::push_forward(
                   material_hand_calculated.get_S(), F);
-              stream << time.get_current_time() << ";" << h[2] << ";" << b[2]
-                     << ";" << F[1][2] * 100.0 << ";" << sigma[1][2] << "\n";
+              stream << time.get_current_time() << ';' << h[2] << ';' << b[2]
+                     << ';' << F[1][2] * 100.0 << ';' << sigma[1][2] << '\n';
             }
         }
 
index e1dd2e4dc57e57a16e924222de7a71d792bb9c06..ec17414ef21f1cbc8a1b0830cbdd4248df7e1d1f 100644 (file)
@@ -1971,49 +1971,49 @@ namespace SAND
               {
                 /* Write one side at z = 0. */
                 stlfile << "   facet normal " << 0.000000e+00 << " "
-                        << 0.000000e+00 << " " << -1.000000e+00 << "\n";
+                        << 0.000000e+00 << " " << -1.000000e+00 << '\n';
                 stlfile << "      outer loop\n";
                 stlfile << "         vertex " << cell->vertex(0)[0] << " "
-                        << cell->vertex(0)[1] << " " << 0.000000e+00 << "\n";
+                        << cell->vertex(0)[1] << " " << 0.000000e+00 << '\n';
                 stlfile << "         vertex " << cell->vertex(2)[0] << " "
-                        << cell->vertex(2)[1] << " " << 0.000000e+00 << "\n";
+                        << cell->vertex(2)[1] << " " << 0.000000e+00 << '\n';
                 stlfile << "         vertex " << cell->vertex(1)[0] << " "
-                        << cell->vertex(1)[1] << " " << 0.000000e+00 << "\n";
+                        << cell->vertex(1)[1] << " " << 0.000000e+00 << '\n';
                 stlfile << "      endloop\n";
                 stlfile << "   endfacet\n";
                 stlfile << "   facet normal " << 0.000000e+00 << " "
-                        << 0.000000e+00 << " " << -1.000000e+00 << "\n";
+                        << 0.000000e+00 << " " << -1.000000e+00 << '\n';
                 stlfile << "      outer loop\n";
                 stlfile << "         vertex " << cell->vertex(1)[0] << " "
-                        << cell->vertex(1)[1] << " " << 0.000000e+00 << "\n";
+                        << cell->vertex(1)[1] << " " << 0.000000e+00 << '\n';
                 stlfile << "         vertex " << cell->vertex(2)[0] << " "
-                        << cell->vertex(2)[1] << " " << 0.000000e+00 << "\n";
+                        << cell->vertex(2)[1] << " " << 0.000000e+00 << '\n';
                 stlfile << "         vertex " << cell->vertex(3)[0] << " "
-                        << cell->vertex(3)[1] << " " << 0.000000e+00 << "\n";
+                        << cell->vertex(3)[1] << " " << 0.000000e+00 << '\n';
                 stlfile << "      endloop\n";
                 stlfile << "   endfacet\n";
 
                 /* Write one side at z = height. */
                 stlfile << "   facet normal " << 0.000000e+00 << " "
-                        << 0.000000e+00 << " " << 1.000000e+00 << "\n";
+                        << 0.000000e+00 << " " << 1.000000e+00 << '\n';
                 stlfile << "      outer loop\n";
                 stlfile << "         vertex " << cell->vertex(0)[0] << " "
-                        << cell->vertex(0)[1] << " " << height << "\n";
+                        << cell->vertex(0)[1] << " " << height << '\n';
                 stlfile << "         vertex " << cell->vertex(1)[0] << " "
-                        << cell->vertex(1)[1] << " " << height << "\n";
+                        << cell->vertex(1)[1] << " " << height << '\n';
                 stlfile << "         vertex " << cell->vertex(2)[0] << " "
-                        << cell->vertex(2)[1] << " " << height << "\n";
+                        << cell->vertex(2)[1] << " " << height << '\n';
                 stlfile << "      endloop\n";
                 stlfile << "   endfacet\n";
                 stlfile << "   facet normal " << 0.000000e+00 << " "
-                        << 0.000000e+00 << " " << 1.000000e+00 << "\n";
+                        << 0.000000e+00 << " " << 1.000000e+00 << '\n';
                 stlfile << "      outer loop\n";
                 stlfile << "         vertex " << cell->vertex(1)[0] << " "
-                        << cell->vertex(1)[1] << " " << height << "\n";
+                        << cell->vertex(1)[1] << " " << height << '\n';
                 stlfile << "         vertex " << cell->vertex(3)[0] << " "
-                        << cell->vertex(3)[1] << " " << height << "\n";
+                        << cell->vertex(3)[1] << " " << height << '\n';
                 stlfile << "         vertex " << cell->vertex(2)[0] << " "
-                        << cell->vertex(2)[1] << " " << height << "\n";
+                        << cell->vertex(2)[1] << " " << height << '\n';
                 stlfile << "      endloop\n";
                 stlfile << "   endfacet\n";
               }
@@ -2021,49 +2021,49 @@ namespace SAND
               {
                 /* Write one side at z = 0. */
                 stlfile << "   facet normal " << 0.000000e+00 << " "
-                        << 0.000000e+00 << " " << -1.000000e+00 << "\n";
+                        << 0.000000e+00 << " " << -1.000000e+00 << '\n';
                 stlfile << "      outer loop\n";
                 stlfile << "         vertex " << cell->vertex(0)[0] << " "
-                        << cell->vertex(0)[1] << " " << 0.000000e+00 << "\n";
+                        << cell->vertex(0)[1] << " " << 0.000000e+00 << '\n';
                 stlfile << "         vertex " << cell->vertex(1)[0] << " "
-                        << cell->vertex(1)[1] << " " << 0.000000e+00 << "\n";
+                        << cell->vertex(1)[1] << " " << 0.000000e+00 << '\n';
                 stlfile << "         vertex " << cell->vertex(2)[0] << " "
-                        << cell->vertex(2)[1] << " " << 0.000000e+00 << "\n";
+                        << cell->vertex(2)[1] << " " << 0.000000e+00 << '\n';
                 stlfile << "      endloop\n";
                 stlfile << "   endfacet\n";
                 stlfile << "   facet normal " << 0.000000e+00 << " "
-                        << 0.000000e+00 << " " << -1.000000e+00 << "\n";
+                        << 0.000000e+00 << " " << -1.000000e+00 << '\n';
                 stlfile << "      outer loop\n";
                 stlfile << "         vertex " << cell->vertex(1)[0] << " "
-                        << cell->vertex(1)[1] << " " << 0.000000e+00 << "\n";
+                        << cell->vertex(1)[1] << " " << 0.000000e+00 << '\n';
                 stlfile << "         vertex " << cell->vertex(3)[0] << " "
-                        << cell->vertex(3)[1] << " " << 0.000000e+00 << "\n";
+                        << cell->vertex(3)[1] << " " << 0.000000e+00 << '\n';
                 stlfile << "         vertex " << cell->vertex(2)[0] << " "
-                        << cell->vertex(2)[1] << " " << 0.000000e+00 << "\n";
+                        << cell->vertex(2)[1] << " " << 0.000000e+00 << '\n';
                 stlfile << "      endloop\n";
                 stlfile << "   endfacet\n";
 
                 /* Write one side at z = height. */
                 stlfile << "   facet normal " << 0.000000e+00 << " "
-                        << 0.000000e+00 << " " << 1.000000e+00 << "\n";
+                        << 0.000000e+00 << " " << 1.000000e+00 << '\n';
                 stlfile << "      outer loop\n";
                 stlfile << "         vertex " << cell->vertex(0)[0] << " "
-                        << cell->vertex(0)[1] << " " << height << "\n";
+                        << cell->vertex(0)[1] << " " << height << '\n';
                 stlfile << "         vertex " << cell->vertex(2)[0] << " "
-                        << cell->vertex(2)[1] << " " << height << "\n";
+                        << cell->vertex(2)[1] << " " << height << '\n';
                 stlfile << "         vertex " << cell->vertex(1)[0] << " "
-                        << cell->vertex(1)[1] << " " << height << "\n";
+                        << cell->vertex(1)[1] << " " << height << '\n';
                 stlfile << "      endloop\n";
                 stlfile << "   endfacet\n";
                 stlfile << "   facet normal " << 0.000000e+00 << " "
-                        << 0.000000e+00 << " " << 1.000000e+00 << "\n";
+                        << 0.000000e+00 << " " << 1.000000e+00 << '\n';
                 stlfile << "      outer loop\n";
                 stlfile << "         vertex " << cell->vertex(1)[0] << " "
-                        << cell->vertex(1)[1] << " " << height << "\n";
+                        << cell->vertex(1)[1] << " " << height << '\n';
                 stlfile << "         vertex " << cell->vertex(2)[0] << " "
-                        << cell->vertex(2)[1] << " " << height << "\n";
+                        << cell->vertex(2)[1] << " " << height << '\n';
                 stlfile << "         vertex " << cell->vertex(3)[0] << " "
-                        << cell->vertex(3)[1] << " " << height << "\n";
+                        << cell->vertex(3)[1] << " " << height << '\n';
                 stlfile << "      endloop\n";
                 stlfile << "   endfacet\n";
               }
@@ -2110,33 +2110,33 @@ namespace SAND
                         stlfile << "   facet normal "
                                 << normal_vector[0] / normal_norm << " "
                                 << normal_vector[1] / normal_norm << " "
-                                << 0.000000e+00 << "\n";
+                                << 0.000000e+00 << '\n';
                         stlfile << "      outer loop\n";
                         stlfile << "         vertex " << face->vertex(0)[0]
                                 << " " << face->vertex(0)[1] << " "
-                                << 0.000000e+00 << "\n";
+                                << 0.000000e+00 << '\n';
                         stlfile << "         vertex " << face->vertex(0)[0]
                                 << " " << face->vertex(0)[1] << " " << height
-                                << "\n";
+                                << '\n';
                         stlfile << "         vertex " << face->vertex(1)[0]
                                 << " " << face->vertex(1)[1] << " "
-                                << 0.000000e+00 << "\n";
+                                << 0.000000e+00 << '\n';
                         stlfile << "      endloop\n";
                         stlfile << "   endfacet\n";
                         stlfile << "   facet normal "
                                 << normal_vector[0] / normal_norm << " "
                                 << normal_vector[1] / normal_norm << " "
-                                << 0.000000e+00 << "\n";
+                                << 0.000000e+00 << '\n';
                         stlfile << "      outer loop\n";
                         stlfile << "         vertex " << face->vertex(0)[0]
                                 << " " << face->vertex(0)[1] << " " << height
-                                << "\n";
+                                << '\n';
                         stlfile << "         vertex " << face->vertex(1)[0]
                                 << " " << face->vertex(1)[1] << " " << height
-                                << "\n";
+                                << '\n';
                         stlfile << "         vertex " << face->vertex(1)[0]
                                 << " " << face->vertex(1)[1] << " "
-                                << 0.000000e+00 << "\n";
+                                << 0.000000e+00 << '\n';
                         stlfile << "      endloop\n";
                         stlfile << "   endfacet\n";
                       }
@@ -2145,33 +2145,33 @@ namespace SAND
                         stlfile << "   facet normal "
                                 << normal_vector[0] / normal_norm << " "
                                 << normal_vector[1] / normal_norm << " "
-                                << 0.000000e+00 << "\n";
+                                << 0.000000e+00 << '\n';
                         stlfile << "      outer loop\n";
                         stlfile << "         vertex " << face->vertex(0)[0]
                                 << " " << face->vertex(0)[1] << " "
-                                << 0.000000e+00 << "\n";
+                                << 0.000000e+00 << '\n';
                         stlfile << "         vertex " << face->vertex(1)[0]
                                 << " " << face->vertex(1)[1] << " "
-                                << 0.000000e+00 << "\n";
+                                << 0.000000e+00 << '\n';
                         stlfile << "         vertex " << face->vertex(0)[0]
                                 << " " << face->vertex(0)[1] << " " << height
-                                << "\n";
+                                << '\n';
                         stlfile << "      endloop\n";
                         stlfile << "   endfacet\n";
                         stlfile << "   facet normal "
                                 << normal_vector[0] / normal_norm << " "
                                 << normal_vector[1] / normal_norm << " "
-                                << 0.000000e+00 << "\n";
+                                << 0.000000e+00 << '\n';
                         stlfile << "      outer loop\n";
                         stlfile << "         vertex " << face->vertex(0)[0]
                                 << " " << face->vertex(0)[1] << " " << height
-                                << "\n";
+                                << '\n';
                         stlfile << "         vertex " << face->vertex(1)[0]
                                 << " " << face->vertex(1)[1] << " "
-                                << 0.000000e+00 << "\n";
+                                << 0.000000e+00 << '\n';
                         stlfile << "         vertex " << face->vertex(1)[0]
                                 << " " << face->vertex(1)[1] << " " << height
-                                << "\n";
+                                << '\n';
                         stlfile << "      endloop\n";
                         stlfile << "   endfacet\n";
                       }
index 6aba78f50fae4f41406960fa3ac3240ac687a319..c60c9c82bfec86c50cb12897db7783c3b4b81d68 100644 (file)
@@ -746,12 +746,12 @@ namespace Differentiation
             const SymEngine::RCP<const SymEngine::Basic> &cse_expr =
               intermediate_symbols_exprs[i].second;
             stream << "  " << i << ": " << cse_symbol << " = " << cse_expr
-                   << "\n";
+                   << '\n';
           }
 
         stream << "  Final reduced expressions for dependent variables: \n";
         for (unsigned i = 0; i < reduced_exprs.size(); ++i)
-          stream << "  " << i << ": " << reduced_exprs[i] << "\n";
+          stream << "  " << i << ": " << reduced_exprs[i] << '\n';
 
         stream << std::flush;
       }
@@ -976,7 +976,7 @@ namespace Differentiation
           {
             stream << "Independent variables: \n";
             for (unsigned i = 0; i < independent_symbols.size(); ++i)
-              stream << "  " << i << ": " << independent_symbols[i] << "\n";
+              stream << "  " << i << ": " << independent_symbols[i] << '\n';
 
             stream << std::flush;
           }
@@ -994,7 +994,7 @@ namespace Differentiation
               {
                 stream << "Dependent variables: \n";
                 for (unsigned i = 0; i < dependent_functions.size(); ++i)
-                  stream << "  " << i << dependent_functions[i] << "\n";
+                  stream << "  " << i << dependent_functions[i] << '\n';
 
                 stream << std::flush;
               }
index 559ca22520001de7764c922ce7b478692a18e13b..fb6d190ce72218afa863f130e9b6b8627553522a 100644 (file)
@@ -2162,38 +2162,36 @@ namespace Differentiation
                                       const bool /*print_cse*/) const
     {
       // Settings
-      stream << "Method? " << optimization_method() << "\n";
-      stream << "Flags: " << optimization_flags() << "\n";
-      stream << "Optimized? " << (optimized() ? "Yes" : "No") << "\n";
+      stream << "Method? " << optimization_method() << '\n';
+      stream << "Flags: " << optimization_flags() << '\n';
+      stream << "Optimized? " << (optimized() ? "Yes" : "No") << '\n';
       stream << "Values substituted? " << values_substituted() << "\n\n";
 
       // Independent variables
       stream << "Symbols (" << n_independent_variables()
-             << " independent variables):"
-             << "\n";
+             << " independent variables):" << '\n';
       int cntr = 0;
       for (SD::types::substitution_map::const_iterator it =
              independent_variables_symbols.begin();
            it != independent_variables_symbols.end();
            ++it, ++cntr)
         {
-          stream << cntr << ": " << it->first << "\n";
+          stream << cntr << ": " << it->first << '\n';
         }
-      stream << "\n" << std::flush;
+      stream << '\n' << std::flush;
 
       // Dependent functions
       stream << "Functions (" << n_dependent_variables()
-             << " dependent variables):"
-             << "\n";
+             << " dependent variables):" << '\n';
       cntr = 0;
       for (typename SD::types::symbol_vector::const_iterator it =
              dependent_variables_functions.begin();
            it != dependent_variables_functions.end();
            ++it, ++cntr)
         {
-          stream << cntr << ": " << (*it) << "\n";
+          stream << cntr << ": " << (*it) << '\n';
         }
-      stream << "\n" << std::flush;
+      stream << '\n' << std::flush;
 
       // Common subexpression
       if (optimized() == true && use_symbolic_CSE() == true)
@@ -2219,7 +2217,7 @@ namespace Differentiation
                       print_dependent_functions,
                       print_cse_reductions);
 
-              stream << "\n" << std::flush;
+              stream << '\n' << std::flush;
             }
           else if (optimization_method() == OptimizerType::lambda)
             {
@@ -2261,8 +2259,7 @@ namespace Differentiation
 
       if (values_substituted())
         {
-          stream << "Evaluated functions:"
-                 << "\n";
+          stream << "Evaluated functions:" << '\n';
           stream << std::flush;
           cntr = 0;
           for (typename std::vector<ReturnType>::const_iterator it =
@@ -2270,9 +2267,9 @@ namespace Differentiation
                it != dependent_variables_output.end();
                ++it, ++cntr)
             {
-              stream << cntr << ": " << (*it) << "\n";
+              stream << cntr << ": " << (*it) << '\n';
             }
-          stream << "\n" << std::flush;
+          stream << '\n' << std::flush;
         }
     }
 
index 426ee96baa74ba65ce88be8b0ea9a6067956926d..f3407e24adb72c601caddd4dcf557aef9dae41a6 100644 (file)
@@ -146,7 +146,7 @@ namespace Differentiation
         const SD::types::substitution_map &symbol_value_map)
       {
         for (const auto &entry : symbol_value_map)
-          stream << entry.first << " = " << entry.second << "\n";
+          stream << entry.first << " = " << entry.second << '\n';
 
         stream << std::flush;
         return stream;
index b268155e904a7a552217e0ab5ab7490ccc952a36..fdcadc83c996431e23d87ea7b0bc4cd8d7326903 100644 (file)
@@ -1242,11 +1242,11 @@ AffineConstraints<number>::print(std::ostream &out) const
         {
           for (const std::pair<size_type, number> &entry : line.entries)
             out << "    " << line.index << " " << entry.first << ":  "
-                << entry.second << "\n";
+                << entry.second << '\n';
 
           // print out inhomogeneity.
           if (line.inhomogeneity != number(0.))
-            out << "    " << line.index << ": " << line.inhomogeneity << "\n";
+            out << "    " << line.index << ": " << line.inhomogeneity << '\n';
         }
       else
         // but also output something if the constraint simply reads
@@ -1254,7 +1254,7 @@ AffineConstraints<number>::print(std::ostream &out) const
         // combination of other dofs
         {
           if (line.inhomogeneity != number(0.))
-            out << "    " << line.index << " = " << line.inhomogeneity << "\n";
+            out << "    " << line.index << " = " << line.inhomogeneity << '\n';
           else
             out << "    " << line.index << " = 0\n";
         }
@@ -1276,9 +1276,9 @@ AffineConstraints<number>::write_dot(std::ostream &out) const
       if (lines[i].entries.size() > 0)
         for (size_type j = 0; j < lines[i].entries.size(); ++j)
           out << "  " << lines[i].index << "->" << lines[i].entries[j].first
-              << "; // weight: " << lines[i].entries[j].second << "\n";
+              << "; // weight: " << lines[i].entries[j].second << '\n';
       else
-        out << "  " << lines[i].index << "\n";
+        out << "  " << lines[i].index << '\n';
     }
   out << "}" << std::endl;
 }
index eec9f23856c7b38d5eee8a542e9203dd2c609feb..41d587b83753b57190febf323c589e88746d3a0e 100644 (file)
@@ -3351,8 +3351,8 @@ namespace DataOutBase
       {
         out
           << "# This file was generated by the deal.II library." << '\n'
-          << "# Date =  " << Utilities::System::get_date() << "\n"
-          << "# Time =  " << Utilities::System::get_time() << "\n"
+          << "# Date =  " << Utilities::System::get_date() << '\n'
+          << "# Time =  " << Utilities::System::get_time() << '\n'
           << "#" << '\n'
           << "# For a description of the UCD format see the AVS Developer's guide."
           << '\n'
@@ -5531,15 +5531,15 @@ namespace DataOutBase
          (flags.time != std::numeric_limits<double>::min() ? 1 : 0));
       if (n_metadata > 0)
         {
-          out << "FIELD FieldData " << n_metadata << "\n";
+          out << "FIELD FieldData " << n_metadata << '\n';
 
           if (flags.cycle != std::numeric_limits<unsigned int>::min())
             {
-              out << "CYCLE 1 1 int\n" << flags.cycle << "\n";
+              out << "CYCLE 1 1 int\n" << flags.cycle << '\n';
             }
           if (flags.time != std::numeric_limits<double>::min())
             {
-              out << "TIME 1 1 double\n" << flags.time << "\n";
+              out << "TIME 1 1 double\n" << flags.time << '\n';
             }
         }
     }
@@ -6010,7 +6010,7 @@ namespace DataOutBase
       }
 
     vtu_out << offsets;
-    out << "\n";
+    out << '\n';
     out << "    </DataArray>\n";
 
     // next output the types of the cells. since all cells are the same, this is
@@ -6020,7 +6020,7 @@ namespace DataOutBase
 
     // this should compress well :-)
     vtu_out << cell_types;
-    out << "\n";
+    out << '\n';
     out << "    </DataArray>\n";
     out << "  </Cells>\n";
 
@@ -6186,7 +6186,7 @@ namespace DataOutBase
           } // loop over nodes
 
         vtu_out << data;
-        out << "\n";
+        out << '\n';
         out << "    </DataArray>\n";
 
       } // loop over ranges
@@ -6209,7 +6209,7 @@ namespace DataOutBase
           std::vector<float> data(data_vectors[data_set].begin(),
                                   data_vectors[data_set].end());
           vtu_out << data;
-          out << "\n";
+          out << '\n';
           out << "    </DataArray>\n";
         }
 
@@ -9283,7 +9283,7 @@ XDMFEntry::get_xdmf_content(const unsigned int   indent_level,
          << " " << (attribute_dim.second > 1 ? 3 : 1)
          << "\" NumberType=\"Float\" Precision=\"8\" Format=\"HDF\">\n";
       ss << indent(indent_level + 3) << h5_sol_filename << ":/"
-         << attribute_dim.first << "\n";
+         << attribute_dim.first << '\n';
       ss << indent(indent_level + 2) << "</DataItem>\n";
       ss << indent(indent_level + 1) << "</Attribute>\n";
     }
index c8524fdb4f38787ed7e12c25505f9f2198dd4e72..ee6f00dda078ca1613b4887d8871f9b5cc0b9f94 100644 (file)
@@ -732,8 +732,7 @@ TimerOutput::print_summary() const
       out_stream << "\n\n+---------------------------------------------"
                  << extra_dash << "+"
                  << "------------+------------+"
-                 << "------------+------------+"
-                 << "\n"
+                 << "------------+------------+" << '\n'
                  << "| Total CPU/wall time elapsed since start     "
                  << extra_space << "|" << std::setw(10) << std::setprecision(3)
                  << std::right << total_cpu_time << "s |            |"
@@ -958,13 +957,13 @@ TimerOutput::print_wall_time_statistics(const MPI_Comm &mpi_comm,
     const std::string time_rank_space  = "                  |";
 
     // now generate a nice table
-    out_stream << "\n"
+    out_stream << '\n'
                << "+------------------------------" << extra_dash << "+"
                << time_rank_column
                << (n_ranks > 1 && quantile > 0. ? time_rank_column : "")
                << "------------+"
                << (n_ranks > 1 && quantile > 0. ? time_rank_column : "")
-               << time_rank_column << "\n"
+               << time_rank_column << '\n'
                << "| Total wallclock time elapsed " << extra_space << "|";
 
     print_statistics(timer_all.wall_time());
@@ -974,7 +973,7 @@ TimerOutput::print_wall_time_statistics(const MPI_Comm &mpi_comm,
                << (n_ranks > 1 && quantile > 0. ? time_rank_space : "")
                << "             "
                << (n_ranks > 1 && quantile > 0. ? time_rank_space : "")
-               << time_rank_space << "\n";
+               << time_rank_space << '\n';
     out_stream << "| Section          " << extra_space << "| no. calls "
                << "|   min time  rank |";
     if (n_ranks > 1 && quantile > 0.)
@@ -990,7 +989,7 @@ TimerOutput::print_wall_time_statistics(const MPI_Comm &mpi_comm,
                << (n_ranks > 1 && quantile > 0. ? time_rank_column : "")
                << "------------+"
                << (n_ranks > 1 && quantile > 0. ? time_rank_column : "")
-               << time_rank_column << "\n";
+               << time_rank_column << '\n';
     for (const auto &i : sections)
       {
         std::string name_out = i.first;
@@ -1011,7 +1010,7 @@ TimerOutput::print_wall_time_statistics(const MPI_Comm &mpi_comm,
                << (n_ranks > 1 && quantile > 0. ? time_rank_column : "")
                << "------------+"
                << (n_ranks > 1 && quantile > 0. ? time_rank_column : "")
-               << time_rank_column << "\n";
+               << time_rank_column << '\n';
   }
 }
 
index fa0806fc56c80837c0546e7ecb87a23bb1da49da..867006da11b468259c7bde57e161e7c50e493183 100644 (file)
@@ -620,11 +620,11 @@ namespace Differentiation
           stream << tape_index << "->" << status_tape
                  << (i < (registered_tape_indices.size() - 1) ? "," : "");
         }
-      stream << "\n";
+      stream << '\n';
 
-      stream << "Keep values? " << keep_independent_values() << "\n";
+      stream << "Keep values? " << keep_independent_values() << '\n';
       stream << "Use stored tape buffer sizes? "
-             << use_stored_taped_buffer_sizes << "\n";
+             << use_stored_taped_buffer_sizes << '\n';
     }
 
 
@@ -645,28 +645,28 @@ namespace Differentiation
       ::tapestats(tape_index, counts.data());
       Assert(counts.size() >= 18, ExcInternalError());
       stream
-        << "Tape index: " << tape_index << "\n"
-        << "Number of independent variables: " << counts[0] << "\n"
-        << "Number of dependent variables:   " << counts[1] << "\n"
-        << "Max number of live, active variables: " << counts[2] << "\n"
-        << "Size of taylor stack (number of overwrites): " << counts[3] << "\n"
-        << "Operations buffer size: " << counts[4] << "\n"
-        << "Total number of recorded operations: " << counts[5] << "\n"
-        << "Operations file written or not: " << counts[6] << "\n"
-        << "Overall number of locations: " << counts[7] << "\n"
-        << "Locations file written or not: " << counts[8] << "\n"
-        << "Overall number of values: " << counts[9] << "\n"
-        << "Values file written or not: " << counts[10] << "\n"
-        << "Locations buffer size: " << counts[11] << "\n"
-        << "Values buffer size: " << counts[12] << "\n"
-        << "Taylor buffer size: " << counts[13] << "\n"
-        << "Number of eq_*_prod for sparsity pattern: " << counts[14] << "\n"
+        << "Tape index: " << tape_index << '\n'
+        << "Number of independent variables: " << counts[0] << '\n'
+        << "Number of dependent variables:   " << counts[1] << '\n'
+        << "Max number of live, active variables: " << counts[2] << '\n'
+        << "Size of taylor stack (number of overwrites): " << counts[3] << '\n'
+        << "Operations buffer size: " << counts[4] << '\n'
+        << "Total number of recorded operations: " << counts[5] << '\n'
+        << "Operations file written or not: " << counts[6] << '\n'
+        << "Overall number of locations: " << counts[7] << '\n'
+        << "Locations file written or not: " << counts[8] << '\n'
+        << "Overall number of values: " << counts[9] << '\n'
+        << "Values file written or not: " << counts[10] << '\n'
+        << "Locations buffer size: " << counts[11] << '\n'
+        << "Values buffer size: " << counts[12] << '\n'
+        << "Taylor buffer size: " << counts[13] << '\n'
+        << "Number of eq_*_prod for sparsity pattern: " << counts[14] << '\n'
         << "Use of 'min_op', deferred to 'abs_op' for piecewise calculations: "
-        << counts[15] << "\n"
+        << counts[15] << '\n'
         << "Number of 'abs' calls that can switch branch: " << counts[16]
-        << "\n"
+        << '\n'
         << "Number of parameters (doubles) interchangeable without retaping: "
-        << counts[17] << "\n"
+        << counts[17] << '\n'
         << std::flush;
     }
 
index 3494a45893c81b27dda90d20cb8e67a881a4c70a..faab8bd8b0b168c93e902c5fa9bd66e89ba3a028 100644 (file)
@@ -313,41 +313,36 @@ namespace Differentiation
       // Set stream to print booleans as "true"/"false"
       stream.setf(std::ios_base::boolalpha);
 
-      stream << "Active tape index: " << active_tape_index() << "\n";
-      stream << "Recording? " << is_recording() << "\n";
+      stream << "Active tape index: " << active_tape_index() << '\n';
+      stream << "Recording? " << is_recording() << '\n';
       stream << std::flush;
 
       if (AD::is_taped_ad_number<ad_type>::value)
         taped_driver.print(stream);
 
-      stream << "Registered independent variables: "
-             << "\n";
+      stream << "Registered independent variables: " << '\n';
       for (unsigned int i = 0; i < n_independent_variables(); ++i)
         stream << registered_independent_variable_values[i]
                << (i < (n_independent_variables() - 1) ? "," : "");
       stream << std::endl;
 
-      stream << "Independent variable values: "
-             << "\n";
+      stream << "Independent variable values: " << '\n';
       print_values(stream);
 
-      stream << "Registered marked independent variables: "
-             << "\n";
+      stream << "Registered marked independent variables: " << '\n';
       for (unsigned int i = 0; i < n_independent_variables(); ++i)
         stream << registered_marked_independent_variables[i]
                << (i < (n_independent_variables() - 1) ? "," : "")
                << std::flush;
       stream << std::endl;
 
-      stream << "Dependent variable values: "
-             << "\n";
+      stream << "Dependent variable values: " << '\n';
       for (unsigned int i = 0; i < n_dependent_variables(); ++i)
         stream << dependent_variables[i]
                << (i < (n_dependent_variables() - 1) ? "," : "");
       stream << std::endl;
 
-      stream << "Registered dependent variables: "
-             << "\n";
+      stream << "Registered dependent variables: " << '\n';
       for (unsigned int i = 0; i < n_dependent_variables(); ++i)
         stream << registered_marked_dependent_variables[i]
                << (i < (n_dependent_variables() - 1) ? "," : "");
index 1d1c84b7bf2587705c90950aea979ee53ff27d59..ef9bcfff6a78f956c26337d6d4e0cbd624cb0c1d 100644 (file)
@@ -3003,8 +3003,7 @@ GridOut::write_mathgl(const Triangulation<dim, spacedim> &tria,
       << "\n#"
       << "\n# Note: This file is understood by MathGL v2.1 and higher only, and can "
       << "\n#       be quickly viewed in a graphical environment using \'mglview\'. "
-      << "\n#"
-      << "\n";
+      << "\n#" << '\n';
   }
 
   // define a helper to keep loops approximately dim-independent
@@ -3014,8 +3013,7 @@ GridOut::write_mathgl(const Triangulation<dim, spacedim> &tria,
   // (ii) write preamble and graphing tweaks
   out << "\n#"
       << "\n#   Preamble."
-      << "\n#"
-      << "\n";
+      << "\n#" << '\n';
 
   if (mathgl_flags.draw_bounding_box)
     out << "\nbox";
@@ -3035,14 +3033,13 @@ GridOut::write_mathgl(const Triangulation<dim, spacedim> &tria,
       default:
         Assert(false, ExcNotImplemented());
     }
-  out << "\n";
+  out << '\n';
 
   // (iii) write vertex ordering
   out << "\n#"
       << "\n#   Vertex ordering."
       << "\n#   list <vertex order> <vertex indices>"
-      << "\n#"
-      << "\n";
+      << "\n#" << '\n';
 
   // todo: This denotes the natural ordering of vertices, but it needs
   // to check this is really always true for a given grid (it's not
@@ -3050,13 +3047,12 @@ GridOut::write_mathgl(const Triangulation<dim, spacedim> &tria,
   switch (dim)
     {
       case 2:
-        out << "\nlist f 0 1 2 3"
-            << "\n";
+        out << "\nlist f 0 1 2 3" << '\n';
         break;
       case 3:
         out
           << "\nlist f 0 2 4 6 | 1 3 5 7 | 0 4 1 5 | 2 6 3 7 | 0 1 2 3 | 4 5 6 7"
-          << "\n";
+          << '\n';
         break;
       default:
         Assert(false, ExcNotImplemented());
@@ -3066,8 +3062,7 @@ GridOut::write_mathgl(const Triangulation<dim, spacedim> &tria,
   out << "\n#"
       << "\n#   List of vertices."
       << "\n#   list <id> <vertices>"
-      << "\n#"
-      << "\n";
+      << "\n#" << '\n';
 
   // run over all active cells and write out a list of
   // xyz-coordinates that correspond to vertices
@@ -3092,8 +3087,7 @@ GridOut::write_mathgl(const Triangulation<dim, spacedim> &tria,
   out << "\n#"
       << "\n#   List of cells to quadplot."
       << "\n#   quadplot <vertex order> <id> <style>"
-      << "\n#"
-      << "\n";
+      << "\n#" << '\n';
   for (unsigned int i = 0; i < tria.n_active_cells(); ++i)
     {
       out << "\nquadplot f ";
@@ -3101,13 +3095,12 @@ GridOut::write_mathgl(const Triangulation<dim, spacedim> &tria,
         out << axes[j] << i << " ";
       out << "\'k#\'";
     }
-  out << "\n";
+  out << '\n';
 
   // (vi) write footer
   out << "\n#"
       << "\n#"
-      << "\n#"
-      << "\n";
+      << "\n#" << '\n';
 
   // make sure everything now gets to the output stream
   out.flush();
index b43e38edbaa8ec80b0ef9867b36acac505ec8d58..43d67af8e024fe0a4f6e0a80cdc59ca472b54cd7 100644 (file)
@@ -1020,7 +1020,7 @@ PointValueHistory<dim>::write_gnuplot(
             {
               to_gnuplot << "<" << indep_name << "> ";
             }
-          to_gnuplot << "\n";
+          to_gnuplot << '\n';
         }
       else
         {
@@ -1028,7 +1028,7 @@ PointValueHistory<dim>::write_gnuplot(
             {
               to_gnuplot << "<Indep_" << component << "> ";
             }
-          to_gnuplot << "\n";
+          to_gnuplot << '\n';
         }
       // write general data stored
       for (unsigned int key = 0; key < dataset_key.size(); ++key)
@@ -1039,7 +1039,7 @@ PointValueHistory<dim>::write_gnuplot(
             {
               to_gnuplot << " " << independent_values[component][key];
             }
-          to_gnuplot << "\n";
+          to_gnuplot << '\n';
         }
 
       to_gnuplot.close();
@@ -1092,14 +1092,14 @@ PointValueHistory<dim>::write_gnuplot(
           // support point into the file as
           // comments
           to_gnuplot << "# Requested location: " << point->requested_location
-                     << "\n";
+                     << '\n';
           to_gnuplot << "# DoF_index : Support location (for each component)\n";
           for (unsigned int component = 0;
                component < dof_handler->get_fe(0).n_components();
                component++)
             {
               to_gnuplot << "# " << point->solution_indices[component] << " : "
-                         << point->support_point_locations[component] << "\n";
+                         << point->support_point_locations[component] << '\n';
             }
           if (triangulation_changed)
             to_gnuplot
@@ -1160,7 +1160,7 @@ PointValueHistory<dim>::write_gnuplot(
                     }
                 }
             }
-          to_gnuplot << "\n";
+          to_gnuplot << '\n';
 
           // write data stored for the point
           for (unsigned int key = 0; key < dataset_key.size(); ++key)
@@ -1187,7 +1187,7 @@ PointValueHistory<dim>::write_gnuplot(
                                                component][key];
                     }
                 }
-              to_gnuplot << "\n";
+              to_gnuplot << '\n';
             }
 
           to_gnuplot.close();
@@ -1307,12 +1307,11 @@ void
 PointValueHistory<dim>::status(std::ostream &out)
 {
   out << "***PointValueHistory status output***\n\n";
-  out << "Closed: " << closed << "\n";
-  out << "Cleared: " << cleared << "\n";
-  out << "Triangulation_changed: " << triangulation_changed << "\n";
-  out << "Have_dof_handler: " << have_dof_handler << "\n";
-  out << "Geometric Data"
-      << "\n";
+  out << "Closed: " << closed << '\n';
+  out << "Cleared: " << cleared << '\n';
+  out << "Triangulation_changed: " << triangulation_changed << '\n';
+  out << "Have_dof_handler: " << have_dof_handler << '\n';
+  out << "Geometric Data" << '\n';
 
   typename std::vector<
     internal::PointValueHistoryImplementation::PointGeometryData<dim>>::iterator
@@ -1328,16 +1327,16 @@ PointValueHistory<dim>::status(std::ostream &out)
           for (; point != point_geometry_data.end(); ++point)
             {
               out << "# Requested location: " << point->requested_location
-                  << "\n";
+                  << '\n';
               out << "# DoF_index : Support location (for each component)\n";
               for (unsigned int component = 0;
                    component < dof_handler->get_fe(0).n_components();
                    component++)
                 {
                   out << point->solution_indices[component] << " : "
-                      << point->support_point_locations[component] << "\n";
+                      << point->support_point_locations[component] << '\n';
                 }
-              out << "\n";
+              out << '\n';
             }
         }
       else
@@ -1345,12 +1344,12 @@ PointValueHistory<dim>::status(std::ostream &out)
           out << "#Cannot access DoF_indices once cleared\n";
         }
     }
-  out << "\n";
+  out << '\n';
 
   if (independent_values.size() != 0)
     {
       out << "Independent value(s): " << independent_values.size() << " : "
-          << independent_values[0].size() << "\n";
+          << independent_values[0].size() << '\n';
       if (indep_names.size() > 0)
         {
           out << "Names: ";
@@ -1358,7 +1357,7 @@ PointValueHistory<dim>::status(std::ostream &out)
             {
               out << "<" << indep_name << "> ";
             }
-          out << "\n";
+          out << '\n';
         }
     }
   else
@@ -1389,15 +1388,14 @@ PointValueHistory<dim>::status(std::ostream &out)
           out << data_entry.first << ": " << data_entry.second.size() << " (";
           out << mask->second.size() << ", "
               << mask->second.n_selected_components() << ") : ";
-          out << (data_entry.second)[0].size() << "\n";
+          out << (data_entry.second)[0].size() << '\n';
         }
       else
         {
           out << data_entry.first << ": " << data_entry.second.size() << " (";
           out << mask->second.size() << ", "
               << mask->second.n_selected_components() << ") : ";
-          out << "No points added"
-              << "\n";
+          out << "No points added" << '\n';
         }
       // add names, if available
       if (component_names->second.size() > 0)
@@ -1406,10 +1404,10 @@ PointValueHistory<dim>::status(std::ostream &out)
             {
               out << "<" << name << "> ";
             }
-          out << "\n";
+          out << '\n';
         }
     }
-  out << "\n";
+  out << '\n';
   out << "***end of status output***\n\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.