Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid use of taking .c_str() just to convert back to std::string. #5236

Merged
merged 1 commit into from
Jul 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions source/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ parse_parameters (const std::string &input_as_string,
if (dealii::Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
try
{
prm.parse_input_from_string(input_as_string.c_str());
prm.parse_input_from_string(input_as_string);
}
catch (const dealii::ExceptionBase &e)
{
Expand Down Expand Up @@ -486,7 +486,7 @@ parse_parameters (const std::string &input_as_string,
// other processors will be ok as well
if (dealii::Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) != 0)
{
prm.parse_input_from_string(input_as_string.c_str());
prm.parse_input_from_string(input_as_string);
}
}

Expand Down
2 changes: 1 addition & 1 deletion source/postprocess/depth_average.cc
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ namespace aspect
"velocity magnitude|sinking velocity|rising velocity|Vs|Vp|log viscosity|"
"viscosity|vertical heat flux|vertical mass flux|composition mass";
prm.declare_entry("List of output variables", "all",
Patterns::MultipleSelection(variables.c_str()),
Patterns::MultipleSelection(variables),
"A comma separated list which specifies which quantities to "
"average in each depth slice. It defaults to averaging all "
"available quantities, but this can be an expensive operation, "
Expand Down
4 changes: 2 additions & 2 deletions source/postprocess/particles.cc
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ namespace aspect
// Just write one data file in parallel
else if (group_files == 1)
{
data_out.write_vtu_in_parallel(filename.c_str(),
data_out.write_vtu_in_parallel(filename,
this->get_mpi_communicator());
}
// Write as many output files as 'group_files' groups
Expand All @@ -481,7 +481,7 @@ namespace aspect
int ierr = MPI_Comm_split(this->get_mpi_communicator(), color, my_id, &comm);
AssertThrowMPI(ierr);

data_out.write_vtu_in_parallel(filename.c_str(), comm);
data_out.write_vtu_in_parallel(filename, comm);
ierr = MPI_Comm_free(&comm);
AssertThrowMPI(ierr);
}
Expand Down
4 changes: 2 additions & 2 deletions source/postprocess/visualization.cc
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,7 @@ namespace aspect
// Just write one data file in parallel
if (group_files == 1)
{
data_out.write_vtu_in_parallel(filename.c_str(),
data_out.write_vtu_in_parallel(filename,
this->get_mpi_communicator());
}
else // Write as many output files as 'group_files' groups
Expand All @@ -602,7 +602,7 @@ namespace aspect
MPI_Comm comm;
int ierr = MPI_Comm_split(this->get_mpi_communicator(), color, my_id, &comm);
AssertThrowMPI(ierr);
data_out.write_vtu_in_parallel(filename.c_str(), comm);
data_out.write_vtu_in_parallel(filename, comm);
ierr = MPI_Comm_free(&comm);
AssertThrowMPI(ierr);
}
Expand Down
4 changes: 2 additions & 2 deletions source/simulator/checkpoint_restart.cc
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ namespace aspect

signals.pre_checkpoint_store_user_data(triangulation);

triangulation.save ((parameters.output_directory + "restart.mesh.new").c_str());
triangulation.save (parameters.output_directory + "restart.mesh.new");
}

// save general information This calls the serialization functions on all
Expand Down Expand Up @@ -523,7 +523,7 @@ namespace aspect
// now that we have resumed from the snapshot load the mesh and solution vectors
try
{
triangulation.load ((parameters.output_directory + "restart.mesh").c_str());
triangulation.load (parameters.output_directory + "restart.mesh");
}
catch (...)
{
Expand Down