]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Utilities::to_string -> std::to_string 9400/head
authorDavid Wells <drwells@email.unc.edu>
Mon, 20 Jan 2020 15:16:31 +0000 (10:16 -0500)
committerDavid Wells <drwells@email.unc.edu>
Mon, 20 Jan 2020 19:39:04 +0000 (14:39 -0500)
None of these use the second arguments for padding so we might as well
use the standard library function.

15 files changed:
examples/step-10/step-10.cc
include/deal.II/lac/block_indices.h
include/deal.II/lac/read_write_vector.templates.h
include/deal.II/lac/sparse_matrix.templates.h
include/deal.II/matrix_free/fe_evaluation.h
include/deal.II/numerics/data_out_dof_data.templates.h
source/base/index_set.cc
source/differentiation/ad/ad_drivers.cc
source/differentiation/sd/symengine_tensor_operations.cc
source/dofs/dof_renumbering.cc
source/grid/grid_reordering.cc
source/grid/manifold_lib.cc
source/lac/petsc_parallel_sparse_matrix.cc
source/lac/petsc_precondition.cc
source/particles/particle.cc

index 4ee00fdebd901bb2fea5e0d20fdd9e53fad1df2a..deaa2f5e5795a6bf9b7973d4ab46c55493c86a68 100644 (file)
@@ -94,7 +94,7 @@ namespace Step10
       {
         std::cout << "Refinement level: " << refinement << std::endl;
 
-        std::string filename_base = "ball_" + Utilities::to_string(refinement);
+        std::string filename_base = "ball_" + std::to_string(refinement);
 
         for (unsigned int degree = 1; degree < 4; ++degree)
           {
@@ -134,8 +134,8 @@ namespace Step10
             grid_out.set_flags(gnuplot_flags);
 
             // Finally, generate a filename and a file for output:
-            std::string filename = filename_base + "_mapping_q_" +
-                                   Utilities::to_string(degree) + ".dat";
+            std::string filename =
+              filename_base + "_mapping_q_" + std::to_string(degree) + ".dat";
             std::ofstream gnuplot_file(filename);
 
             // Then write out the triangulation to this file. The last
index 19119ad6d921b3eff96dad404bd0cd6c0b6e2eeb..8da555b658e0ba6a8b5023e91bc6c148bb0cf9bc 100644 (file)
@@ -387,9 +387,9 @@ BlockIndices::to_string() const
     {
       if (i > 0)
         result += ',';
-      result += Utilities::to_string(block_size(i));
+      result += std::to_string(block_size(i));
     }
-  result += "|" + Utilities::to_string(total_size()) + ']';
+  result += "|" + std::to_string(total_size()) + ']';
   return result;
 }
 
index ba1c5f298b6405a16b7a0b334411d4797d9d2aeb..2be7fad2be0dd95eefc397847e16029c98d08c78 100644 (file)
@@ -679,7 +679,7 @@ namespace LinearAlgebra
         const int err = target_vector.Import(multivector, import, Insert);
         AssertThrow(err == 0,
                     ExcMessage("Epetra Import() failed with error code: " +
-                               Utilities::to_string(err)));
+                               std::to_string(err)));
 
         const double *new_values = target_vector.Values();
         const int     size       = target_vector.MyLength();
@@ -694,7 +694,7 @@ namespace LinearAlgebra
         const int err = target_vector.Import(multivector, import, Add);
         AssertThrow(err == 0,
                     ExcMessage("Epetra Import() failed with error code: " +
-                               Utilities::to_string(err)));
+                               std::to_string(err)));
 
         const double *new_values = target_vector.Values();
         const int     size       = target_vector.MyLength();
@@ -709,7 +709,7 @@ namespace LinearAlgebra
         const int err = target_vector.Import(multivector, import, Add);
         AssertThrow(err == 0,
                     ExcMessage("Epetra Import() failed with error code: " +
-                               Utilities::to_string(err)));
+                               std::to_string(err)));
 
         const double *new_values = target_vector.Values();
         const int     size       = target_vector.MyLength();
@@ -739,7 +739,7 @@ namespace LinearAlgebra
         const int err = target_vector.Import(multivector, import, Add);
         AssertThrow(err == 0,
                     ExcMessage("Epetra Import() failed with error code: " +
-                               Utilities::to_string(err)));
+                               std::to_string(err)));
 
         const double *new_values = target_vector.Values();
         const int     size       = target_vector.MyLength();
index bac9bbafcf3729087b5ecbb9a5a83c8cbf28b2ea..1e81b55c1687add2f11026947e9cd4d63436acc7 100644 (file)
@@ -1374,7 +1374,7 @@ namespace internal
                ExcMessage(
                  "There is a zero on the diagonal of this matrix "
                  "in row " +
-                 Utilities::to_string(row) +
+                 std::to_string(row) +
                  ". The preconditioner you selected cannot work if that "
                  "is the case because one of its steps requires "
                  "division by the diagonal elements of the matrix."
index 0d13715c5ddebb8f25be7ca8ef3ed50e1d94f6f6..e0531840925c308f420f3c8514af8d7b6ff72da8 100644 (file)
@@ -3070,20 +3070,19 @@ inline FEEvaluationBase<dim,
           first_selected_component,
     ExcMessage(
       "You tried to construct a vector-valued evaluator with " +
-      Utilities::to_string(n_components) +
+      std::to_string(n_components) +
       " components. However, "
       "the current base element has only " +
-      Utilities::to_string(
+      std::to_string(
         dof_info->start_components
           [dof_info->component_to_base_index[first_selected_component] + 1] -
         first_selected_component) +
       " components left when starting from local element index " +
-      Utilities::to_string(
+      std::to_string(
         first_selected_component -
         dof_info->start_components
           [dof_info->component_to_base_index[first_selected_component]]) +
-      " (global index " + Utilities::to_string(first_selected_component) +
-      ")"));
+      " (global index " + std::to_string(first_selected_component) + ")"));
 
   // do not check for correct dimensions of data fields here, should be done
   // in derived classes
index 3ac1a14d403765043c128e9ee1fd940ea428d12e..e120beba6a62e1d5f0f626be826ab309338deb45 100644 (file)
@@ -1149,7 +1149,7 @@ DataOut_DoFData<DoFHandlerType, patch_dim, patch_space_dim>::
         {
           for (unsigned int i = 0; i < n_components; ++i)
             {
-              deduced_names[i] = name + '_' + Utilities::to_string(i);
+              deduced_names[i] = name + '_' + std::to_string(i);
             }
         }
       else
index 7fb3b4c68ef5336aa0d8a5a4c5a7ff348ebee5d1..6f986b956febe27df88560464371bb70e6ca31d3 100644 (file)
@@ -523,10 +523,10 @@ IndexSet::make_tpetra_map(const MPI_Comm &communicator,
                         "contain all indices exactly once: the sum of "
                         "the number of entries the various processors "
                         "want to store locally is " +
-                        Utilities::to_string(n_global_elements) +
+                        std::to_string(n_global_elements) +
                         " whereas the total size of the object to be "
                         "allocated is " +
-                        Utilities::to_string(size()) +
+                        std::to_string(size()) +
                         ". In other words, there are "
                         "either indices that are not spoken for "
                         "by any processor, or there are indices that are "
@@ -592,10 +592,10 @@ IndexSet::make_trilinos_map(const MPI_Comm &communicator,
                         "contain all indices exactly once: the sum of "
                         "the number of entries the various processors "
                         "want to store locally is " +
-                        Utilities::to_string(n_global_elements) +
+                        std::to_string(n_global_elements) +
                         " whereas the total size of the object to be "
                         "allocated is " +
-                        Utilities::to_string(size()) +
+                        std::to_string(size()) +
                         ". In other words, there are "
                         "either indices that are not spoken for "
                         "by any processor, or there are indices that are "
index af6a49f008ce5db4f9e2a223f932394be59fe7b0..fe3e85e4e04cb2a807af03167dd34a51f968929e 100644 (file)
@@ -1674,15 +1674,14 @@ namespace Differentiation
               AssertThrow(
                 n_live_variables == 0,
                 ExcMessage(
-                  "There are currently " +
-                  Utilities::to_string(n_live_variables) +
+                  "There are currently " + std::to_string(n_live_variables) +
                   " live "
                   "adtl::adouble variables in existence. They currently "
                   "assume " +
-                  Utilities::to_string(n_set_directional_derivatives) +
+                  std::to_string(n_set_directional_derivatives) +
                   " directional derivatives "
                   "but you wish to increase this to " +
-                  Utilities::to_string(n_directional_derivatives) +
+                  std::to_string(n_directional_derivatives) +
                   ". \n"
                   "To safely change (or more specifically in this case, "
                   "increase) the number of directional derivatives, there "
index ced2db79404b77344eb4f8c142e46b497943e2a1..0cfce17dcddb8f2c44eec3a1c36b047bac4287f0 100644 (file)
@@ -46,7 +46,7 @@ namespace Differentiation
         {
           std::string out;
           for (unsigned int i = 0; i < rank; ++i)
-            out += dealii::Utilities::to_string(indices[i]);
+            out += std::to_string(indices[i]);
           return out;
         }
 
index ae93c7decfc51eae8930a5a30ea7b82c1ef1e74e..579d6e89fc7e81a856593810cade69154a1ffb2a 100644 (file)
@@ -456,7 +456,7 @@ namespace DoFRenumbering
                   locally_active_dofs.is_element(starting_index),
                   ExcMessage(
                     "You specified global degree of freedom " +
-                    Utilities::to_string(starting_index) +
+                    std::to_string(starting_index) +
                     " as a starting index, but this index is not among the "
                     "locally active ones on this processor, as required "
                     "for this function."));
index dfff9db7a440319f23b0f6bf2147b53b6629a21a..05106492d1b897b3dd712e44fd8e3f8f39d3723d 100644 (file)
@@ -1183,10 +1183,10 @@ GridReordering<2>::invert_all_cells_of_negative_grid(
   // might work also on single cells, grids
   // with both kind of cells are very likely to
   // be broken. Check for this here.
-  AssertThrow(n_negative_cells == 0 || n_negative_cells == cells.size(),
-              ExcMessage(
-                std::string(
-                  "This class assumes that either all cells have positive "
+  AssertThrow(
+    n_negative_cells == 0 || n_negative_cells == cells.size(),
+    ExcMessage(
+      std::string("This class assumes that either all cells have positive "
                   "volume, or that all cells have been specified in an "
                   "inverted vertex order so that their volume is negative. "
                   "(In the latter case, this class automatically inverts "
@@ -1195,9 +1195,8 @@ GridReordering<2>::invert_all_cells_of_negative_grid(
                   "negative volume. You need to check your mesh which "
                   "cells these are and how they got there.\n"
                   "As a hint, of the total ") +
-                Utilities::to_string(cells.size()) + " cells in the mesh, " +
-                Utilities::to_string(n_negative_cells) +
-                " appear to have a negative volume."));
+      std::to_string(cells.size()) + " cells in the mesh, " +
+      std::to_string(n_negative_cells) + " appear to have a negative volume."));
 }
 
 
index fd5562b2cba5d1a84c1498d414ab4b7ee4b2a0f9..9b190eab232aa0576eeb100f7369a2333baf9b6a 100644 (file)
@@ -2172,7 +2172,7 @@ TransfiniteInterpolationManifold<dim, spacedim>::
   Assert(triangulation != nullptr, ExcNotInitialized());
   Assert(triangulation->begin_active()->level() >= level_coarse,
          ExcMessage("The manifold was initialized with level " +
-                    Utilities::to_string(level_coarse) + " but there are now" +
+                    std::to_string(level_coarse) + " but there are now" +
                     "active cells on a lower level. Coarsening the mesh is " +
                     "currently not supported"));
 
index 625f5297e3926f1552682e02be2f65845f361cf4..22c7dd1bae57e0bfc018e515703c3c6e271ddca3 100644 (file)
@@ -376,17 +376,17 @@ namespace PETScWrappers
                ExcMessage(
                  std::string(
                    "Each row has to be owned by exactly one owner (n_rows()=") +
-                 Utilities::to_string(sparsity_pattern.n_rows()) +
+                 std::to_string(sparsity_pattern.n_rows()) +
                  " but sum(local_rows.n_elements())=" +
-                 Utilities::to_string(row_owners) + ")"));
+                 std::to_string(row_owners) + ")"));
         Assert(
           col_owners == sparsity_pattern.n_cols(),
           ExcMessage(
             std::string(
               "Each column has to be owned by exactly one owner (n_cols()=") +
-            Utilities::to_string(sparsity_pattern.n_cols()) +
+            std::to_string(sparsity_pattern.n_cols()) +
             " but sum(local_columns.n_elements())=" +
-            Utilities::to_string(col_owners) + ")"));
+            std::to_string(col_owners) + ")"));
       }
 #  endif
 
index ed961323d1a2e12ae377fb5d1548662247c2daf4..d29c011385aeeb8f3ab95a206c06b9e24081b725 100644 (file)
@@ -482,7 +482,7 @@ namespace PETScWrappers
       }
 
     set_option_value("-pc_hypre_boomeramg_agg_nl",
-                     Utilities::to_string(
+                     std::to_string(
                        additional_data.aggressive_coarsening_num_levels));
 
     std::stringstream ssStream;
@@ -630,7 +630,7 @@ namespace PETScWrappers
     set_option_value("-pc_hypre_parasails_sym", ssStream.str());
 
     set_option_value("-pc_hypre_parasails_nlevels",
-                     Utilities::to_string(additional_data.n_levels));
+                     std::to_string(additional_data.n_levels));
 
     ssStream.str(""); // empty the stringstream
     ssStream << additional_data.threshold;
index d421719f9f29e32990325615629b5abe23e913bd..7045add9bfc423426b97f87853ebda84074c2e2e 100644 (file)
@@ -309,9 +309,9 @@ namespace Particles
         std::string(
           "You are trying to assign properties with an incompatible length. ") +
         "The particle has space to store " +
-        Utilities::to_string(old_properties.size()) + " properties, " +
+        std::to_string(old_properties.size()) + " properties, " +
         "and this function tries to assign" +
-        Utilities::to_string(new_properties.size()) + " properties. " +
+        std::to_string(new_properties.size()) + " properties. " +
         "This is not allowed."));
 
     if (old_properties.size() > 0)

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.