]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Address more unnecessary calls to .c_str(). 15699/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Mon, 10 Jul 2023 06:06:41 +0000 (00:06 -0600)
committerWolfgang Bangerth <bangerth@colostate.edu>
Mon, 10 Jul 2023 06:06:41 +0000 (00:06 -0600)
examples/step-33/step-33.cc
examples/step-35/step-35.cc
examples/step-62/step-62.cc
source/base/data_out_base.cc

index f93c33875c232f034e7cf7fe7e553be8b195ffa8..78c2d288c9a114d5befd6bb4ea1f1b0fbc02b342 100644 (file)
@@ -2373,7 +2373,7 @@ namespace Step33
       grid_in.attach_triangulation(triangulation);
 
       std::ifstream input_file(parameters.mesh_filename);
-      Assert(input_file, ExcFileNotOpen(parameters.mesh_filename.c_str()));
+      Assert(input_file, ExcFileNotOpen(parameters.mesh_filename));
 
       grid_in.read_ucd(input_file);
     }
index f215b414ab969eeab008a5716afbf9dac1f4d238..c2981564f527464e44dc4863356aff66671bc7d1 100644 (file)
@@ -726,7 +726,7 @@ namespace Step35
     {
       std::string   filename = "nsbench2.inp";
       std::ifstream file(filename);
-      Assert(file, ExcFileNotOpen(filename.c_str()));
+      Assert(file, ExcFileNotOpen(filename));
       grid_in.read_ucd(file);
     }
 
index d74cdb06e5a91b94aa19318108de4f6ef2bfa543..1fd621113b12488ea22f14136cc03b95cc4a3831 100644 (file)
@@ -1189,7 +1189,7 @@ namespace step62
                              << std::setfill('0') << frequency_idx;
         std::string filename = (parameters.simulation_name + "_" +
                                 frequency_idx_stream.str() + ".vtu");
-        data_out.write_vtu_in_parallel(filename.c_str(), mpi_communicator);
+        data_out.write_vtu_in_parallel(filename, mpi_communicator);
       }
   }
 
index 5210363d2e3afc9b112a76f51b04df55d5c82e23..912e1cf2fcad3345150cfe1be9ad721fd51d5d7b 100644 (file)
@@ -7889,7 +7889,7 @@ DataOutInterface<dim, spacedim>::write_vtu_with_pvtu_record(
   else if (n_groups == 1)
     {
       // write only a single data file in parallel
-      this->write_vtu_in_parallel(filename.c_str(), mpi_communicator);
+      this->write_vtu_in_parallel(filename, mpi_communicator);
     }
   else
     {
@@ -7898,7 +7898,7 @@ DataOutInterface<dim, spacedim>::write_vtu_with_pvtu_record(
       MPI_Comm comm_group;
       int ierr = MPI_Comm_split(mpi_communicator, color, rank, &comm_group);
       AssertThrowMPI(ierr);
-      this->write_vtu_in_parallel(filename.c_str(), comm_group);
+      this->write_vtu_in_parallel(filename, comm_group);
       Utilities::MPI::free_communicator(comm_group);
 #else
       AssertThrow(false, ExcMessage("Logical error. Should not arrive here."));

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.