From: Wolfgang Bangerth Date: Sun, 9 Jul 2023 23:00:24 +0000 (-0600) Subject: std::[io]fstream can now deal with std::string for filenames. X-Git-Tag: relicensing~712^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F15694%2Fhead;p=dealii.git std::[io]fstream can now deal with std::string for filenames. --- diff --git a/examples/step-63/step-63.cc b/examples/step-63/step-63.cc index 99f88fe149..5d4eda65c7 100644 --- a/examples/step-63/step-63.cc +++ b/examples/step-63/step-63.cc @@ -1159,7 +1159,7 @@ namespace Step63 const std::string filename = "solution-" + Utilities::int_to_string(cycle) + ".vtu"; - std::ofstream output(filename.c_str()); + std::ofstream output(filename); data_out.write_vtu(output); } diff --git a/include/deal.II/base/path_search.h b/include/deal.II/base/path_search.h index 82fae2c051..6069e4aed3 100644 --- a/include/deal.II/base/path_search.h +++ b/include/deal.II/base/path_search.h @@ -48,7 +48,7 @@ DEAL_II_NAMESPACE_OPEN * * dealii::PathSearch search("MESH"); * std::string full_name = search.find("grid"); - * std::ifstream in(full_name.c_str()); + * std::ifstream in(full_name); * ... * @endcode * diff --git a/include/deal.II/numerics/dof_output_operator.templates.h b/include/deal.II/numerics/dof_output_operator.templates.h index 3e54ae8145..aeb556ab96 100644 --- a/include/deal.II/numerics/dof_output_operator.templates.h +++ b/include/deal.II/numerics/dof_output_operator.templates.h @@ -63,7 +63,7 @@ namespace Algorithms std::ostringstream streamOut; streamOut << filename_base << std::setw(digits) << std::setfill('0') << this->step << out.default_suffix(); - std::ofstream out_filename(streamOut.str().c_str()); + std::ofstream out_filename(streamOut.str()); out.build_patches(); out.write(out_filename); out.clear(); diff --git a/include/deal.II/numerics/dof_print_solver_step.h b/include/deal.II/numerics/dof_print_solver_step.h index 2e47c7d841..8f507b815d 100644 --- a/include/deal.II/numerics/dof_print_solver_step.h +++ b/include/deal.II/numerics/dof_print_solver_step.h @@ -125,7 +125,7 @@ DoFPrintSolverStep::print_vectors( deallog << "Writing file:" << fname << std::endl; out.build_patches(); - std::ofstream of(fname.c_str()); + std::ofstream of(fname); out.write(of); } diff --git a/source/base/data_out_base.cc b/source/base/data_out_base.cc index b1f9235303..5210363d2e 100644 --- a/source/base/data_out_base.cc +++ b/source/base/data_out_base.cc @@ -7882,7 +7882,7 @@ DataOutInterface::write_vtu_with_pvtu_record( if (n_groups == 0 || n_groups > n_ranks) { // every processor writes one file - std::ofstream output(filename.c_str()); + std::ofstream output(filename); AssertThrow(output, ExcFileNotOpen(filename)); this->write_vtu(output); } @@ -7923,7 +7923,7 @@ DataOutInterface::write_vtu_with_pvtu_record( filename_vector.emplace_back(filename); } - std::ofstream pvtu_output((directory + pvtu_filename).c_str()); + std::ofstream pvtu_output(directory + pvtu_filename); this->write_pvtu_record(pvtu_output, filename_vector); } diff --git a/source/base/parameter_handler.cc b/source/base/parameter_handler.cc index 68c49b2582..19d2ce7a97 100644 --- a/source/base/parameter_handler.cc +++ b/source/base/parameter_handler.cc @@ -2021,7 +2021,7 @@ ParameterHandler::scan_line(std::string line, "'INCLUDE' statement, but it does not " "name a file for inclusion.")); - std::ifstream input(line.c_str()); + std::ifstream input(line); AssertThrow(input, ExcCannotOpenIncludeStatementFile(current_line_n, input_filename, diff --git a/source/distributed/fully_distributed_tria.cc b/source/distributed/fully_distributed_tria.cc index c120fe867f..7723fec305 100644 --- a/source/distributed/fully_distributed_tria.cc +++ b/source/distributed/fully_distributed_tria.cc @@ -488,7 +488,7 @@ namespace parallel if (myrank == 0) { std::string fname = std::string(filename) + ".info"; - std::ofstream f(fname.c_str()); + std::ofstream f(fname); f << "version nproc n_attached_fixed_size_objs n_attached_variable_size_objs n_global_active_cells" << std::endl << 4 << " " @@ -618,7 +618,7 @@ namespace parallel attached_count_variable, n_global_active_cells; { std::string fname = std::string(filename) + ".info"; - std::ifstream f(fname.c_str()); + std::ifstream f(fname); AssertThrow(f.fail() == false, ExcIO()); std::string firstline; getline(f, firstline); // skip first line diff --git a/source/distributed/tria.cc b/source/distributed/tria.cc index 261c20261d..f683ab3667 100644 --- a/source/distributed/tria.cc +++ b/source/distributed/tria.cc @@ -2021,7 +2021,7 @@ namespace parallel if (this->my_subdomain == 0) { std::string fname = std::string(filename) + ".info"; - std::ofstream f(fname.c_str()); + std::ofstream f(fname); f << "version nproc n_attached_fixed_size_objs n_attached_variable_size_objs n_coarse_cells" << std::endl << 5 << " " @@ -2091,7 +2091,7 @@ namespace parallel attached_count_variable, n_coarse_cells; { std::string fname = std::string(filename) + ".info"; - std::ifstream f(fname.c_str()); + std::ifstream f(fname); AssertThrow(f.fail() == false, ExcIO()); std::string firstline; getline(f, firstline); // skip first line diff --git a/source/grid/grid_in.cc b/source/grid/grid_in.cc index 92a068b609..94d7ff9899 100644 --- a/source/grid/grid_in.cc +++ b/source/grid/grid_in.cc @@ -4169,7 +4169,7 @@ GridIn::read(const std::string &filename, Format format) } else { - std::ifstream in(name.c_str()); + std::ifstream in(name); read(in, format); } } diff --git a/source/grid/grid_out.cc b/source/grid/grid_out.cc index 8a9a546860..924b3dbfab 100644 --- a/source/grid/grid_out.cc +++ b/source/grid/grid_out.cc @@ -3693,7 +3693,7 @@ GridOut::write_mesh_per_processor_as_vtu( const std::string pvtu_filename = (filename_without_extension + ".pvtu"); - std::ofstream pvtu_output(pvtu_filename.c_str()); + std::ofstream pvtu_output(pvtu_filename); DataOut data_out; data_out.attach_triangulation(*tr); @@ -3712,7 +3712,7 @@ GridOut::write_mesh_per_processor_as_vtu( } } - std::ofstream out(new_file.c_str()); + std::ofstream out(new_file); std::vector< std::tuple::write_gnuplot( if (n_indep != 0) { std::string filename = base_name + "_indep.gpl"; - std::ofstream to_gnuplot(filename.c_str()); + std::ofstream to_gnuplot(filename); to_gnuplot << "# Data independent of mesh location\n"; @@ -1089,7 +1089,7 @@ PointValueHistory::write_gnuplot( // Utilities::int_to_string(data_store_index, // 2) call, can handle up to 100 // points - std::ofstream to_gnuplot(filename.c_str()); + std::ofstream to_gnuplot(filename); // put helpful info about the // support point into the file as diff --git a/tests/ad_common_tests/step-44-helper_res_lin_01.h b/tests/ad_common_tests/step-44-helper_res_lin_01.h index 4a5edcb7b0..564fdf6417 100644 --- a/tests/ad_common_tests/step-44-helper_res_lin_01.h +++ b/tests/ad_common_tests/step-44-helper_res_lin_01.h @@ -1723,7 +1723,7 @@ namespace Step44 data_out.build_patches(q_mapping, degree); std::ostringstream filename; filename << "solution-" << dim << "d-" << time.get_timestep() << ".vtk"; - std::ofstream output(filename.str().c_str()); + std::ofstream output(filename.str()); data_out.write_vtk(output); } } // namespace Step44 diff --git a/tests/ad_common_tests/step-44-helper_scalar_01.h b/tests/ad_common_tests/step-44-helper_scalar_01.h index efc93878f5..a924f9eb3f 100644 --- a/tests/ad_common_tests/step-44-helper_scalar_01.h +++ b/tests/ad_common_tests/step-44-helper_scalar_01.h @@ -2256,7 +2256,7 @@ namespace Step44 data_out.build_patches(q_mapping, degree); std::ostringstream filename; filename << "solution-" << dim << "d-" << time.get_timestep() << ".vtk"; - std::ofstream output(filename.str().c_str()); + std::ofstream output(filename.str()); data_out.write_vtk(output); } } // namespace Step44 diff --git a/tests/ad_common_tests/step-44-helper_var_form_01.h b/tests/ad_common_tests/step-44-helper_var_form_01.h index 5b3420a020..1651a2d13d 100644 --- a/tests/ad_common_tests/step-44-helper_var_form_01.h +++ b/tests/ad_common_tests/step-44-helper_var_form_01.h @@ -1650,7 +1650,7 @@ namespace Step44 data_out.build_patches(q_mapping, degree); std::ostringstream filename; filename << "solution-" << dim << "d-" << time.get_timestep() << ".vtk"; - std::ofstream output(filename.str().c_str()); + std::ofstream output(filename.str()); data_out.write_vtk(output); } } // namespace Step44 diff --git a/tests/ad_common_tests/step-44-helper_vector_01.h b/tests/ad_common_tests/step-44-helper_vector_01.h index 3dde0e8d16..2e7c48d55f 100644 --- a/tests/ad_common_tests/step-44-helper_vector_01.h +++ b/tests/ad_common_tests/step-44-helper_vector_01.h @@ -1743,7 +1743,7 @@ namespace Step44 data_out.build_patches(q_mapping, degree); std::ostringstream filename; filename << "solution-" << dim << "d-" << time.get_timestep() << ".vtk"; - std::ofstream output(filename.str().c_str()); + std::ofstream output(filename.str()); data_out.write_vtk(output); } } // namespace Step44 diff --git a/tests/adolc/step-44.cc b/tests/adolc/step-44.cc index a031f8ed2a..e400f75270 100644 --- a/tests/adolc/step-44.cc +++ b/tests/adolc/step-44.cc @@ -2063,7 +2063,7 @@ namespace Step44 data_out.build_patches(q_mapping, degree); std::ostringstream filename; filename << "solution-" << dim << "d-" << time.get_timestep() << ".vtk"; - std::ofstream output(filename.str().c_str()); + std::ofstream output(filename.str()); data_out.write_vtk(output); } } // namespace Step44 diff --git a/tests/aniso/refine_and_coarsen_anisotropic.cc b/tests/aniso/refine_and_coarsen_anisotropic.cc index fc999ef928..820647dc3b 100644 --- a/tests/aniso/refine_and_coarsen_anisotropic.cc +++ b/tests/aniso/refine_and_coarsen_anisotropic.cc @@ -106,7 +106,7 @@ test_isotropic(int type, std::ostream &logfile) grid_out.set_flags(eps2); std::ostringstream filename; filename << "grid_" << type << '_' << cycle << ".eps"; - std::ofstream outfile(filename.str().c_str()); + std::ofstream outfile(filename.str()); grid_out.write_eps(tria, outfile); } diff --git a/tests/bits/joa_1.cc b/tests/bits/joa_1.cc index 7baa7e8288..6f6f57bfef 100644 --- a/tests/bits/joa_1.cc +++ b/tests/bits/joa_1.cc @@ -987,7 +987,7 @@ LaplaceProblem::output_results(const unsigned int cycle) const filename += ('0' + cycle); filename += ".eps"; - std::ofstream output(filename.c_str()); + std::ofstream output(filename); GridOut grid_out; grid_out.write_eps(triangulation, output); diff --git a/tests/bits/step-4_dg_periodic.cc b/tests/bits/step-4_dg_periodic.cc index ff5563f030..9a6b18b772 100644 --- a/tests/bits/step-4_dg_periodic.cc +++ b/tests/bits/step-4_dg_periodic.cc @@ -238,7 +238,7 @@ Step4::output_results(const unsigned int cycle) const data_out.add_data_vector(solution, "u"); data_out.build_patches(fe.degree); - std::ofstream output((filename + ".vtk").c_str()); + std::ofstream output(filename + ".vtk"); data_out.write_vtk(output); } diff --git a/tests/bits/step-4_dg_periodic_coupling.cc b/tests/bits/step-4_dg_periodic_coupling.cc index 3a248210b5..ec2bf87952 100644 --- a/tests/bits/step-4_dg_periodic_coupling.cc +++ b/tests/bits/step-4_dg_periodic_coupling.cc @@ -245,7 +245,7 @@ Step4::output_results(const unsigned int cycle) const data_out.add_data_vector(solution, "u"); data_out.build_patches(fe.degree); - std::ofstream output((filename + ".vtk").c_str()); + std::ofstream output(filename + ".vtk"); data_out.write_vtk(output); } diff --git a/tests/codim_one/bem.cc b/tests/codim_one/bem.cc index fdc2b303e7..7117085608 100644 --- a/tests/codim_one/bem.cc +++ b/tests/codim_one/bem.cc @@ -425,7 +425,7 @@ BEM::read_grid(std::string filename) { GridIn gi; gi.attach_triangulation(tria); - std::ifstream in(filename.c_str()); + std::ifstream in(filename); gi.read_ucd(in); for (auto cell = tria.begin_active(); cell != tria.end(); ++cell) diff --git a/tests/codim_one/data_out.cc b/tests/codim_one/data_out.cc index fa61cbc19b..4e48cfacd5 100644 --- a/tests/codim_one/data_out.cc +++ b/tests/codim_one/data_out.cc @@ -49,7 +49,7 @@ test(std::string filename) GridIn gi; gi.attach_triangulation(triangulation); - std::ifstream in(filename.c_str()); + std::ifstream in(filename); gi.read_ucd(in); FE_Q fe(1); diff --git a/tests/codim_one/error_estimator_02.cc b/tests/codim_one/error_estimator_02.cc index 797abd496e..374dcab1c9 100644 --- a/tests/codim_one/error_estimator_02.cc +++ b/tests/codim_one/error_estimator_02.cc @@ -171,7 +171,7 @@ check() data_out.build_patches(); std::string filename = spacedim == 2 ? "solution-2d-" : "solution-3d-"; filename += Utilities::int_to_string(0, 2) + ".vtk"; - std::ofstream output(filename.c_str()); + std::ofstream output(filename); data_out.write_vtk(output); } diff --git a/tests/codim_one/gradients.cc b/tests/codim_one/gradients.cc index 4e21a4151e..f85f4d7130 100644 --- a/tests/codim_one/gradients.cc +++ b/tests/codim_one/gradients.cc @@ -58,7 +58,7 @@ test(std::string filename) GridIn gi; gi.attach_triangulation(triangulation); - std::ifstream in(filename.c_str()); + std::ifstream in(filename); gi.read_ucd(in); const QMidpoint q_midpoint; diff --git a/tests/codim_one/gradients_1.cc b/tests/codim_one/gradients_1.cc index da5e8e5eca..fe7d6c9047 100644 --- a/tests/codim_one/gradients_1.cc +++ b/tests/codim_one/gradients_1.cc @@ -58,7 +58,7 @@ test(std::string filename, unsigned int degree = 1) GridIn gi; gi.attach_triangulation(triangulation); - std::ifstream in(filename.c_str()); + std::ifstream in(filename); gi.read_ucd(in); // finite elements used for the diff --git a/tests/codim_one/grid_in_out.cc b/tests/codim_one/grid_in_out.cc index a9c8066eb8..f17ace3fa1 100644 --- a/tests/codim_one/grid_in_out.cc +++ b/tests/codim_one/grid_in_out.cc @@ -32,7 +32,7 @@ test(std::string filename) Triangulation tria; GridIn gi; gi.attach_triangulation(tria); - std::ifstream in(filename.c_str()); + std::ifstream in(filename); gi.read_ucd(in); GridOut grid_out; diff --git a/tests/codim_one/grid_in_out_02.cc b/tests/codim_one/grid_in_out_02.cc index 58f5c72c78..547544cafd 100644 --- a/tests/codim_one/grid_in_out_02.cc +++ b/tests/codim_one/grid_in_out_02.cc @@ -32,7 +32,7 @@ test(std::string filename) Triangulation tria; GridIn gi; gi.attach_triangulation(tria); - std::ifstream in(filename.c_str()); + std::ifstream in(filename); gi.read_ucd(in); GridOut grid_out; diff --git a/tests/codim_one/grid_in_out_03.cc b/tests/codim_one/grid_in_out_03.cc index de874e6e8f..70fe9105c8 100644 --- a/tests/codim_one/grid_in_out_03.cc +++ b/tests/codim_one/grid_in_out_03.cc @@ -36,7 +36,7 @@ test(std::string filename) Triangulation tria; GridIn gi; gi.attach_triangulation(tria); - std::ifstream in(filename.c_str()); + std::ifstream in(filename); gi.read_ucd(in); PersistentTriangulation ptria(tria); diff --git a/tests/codim_one/grid_refinement.cc b/tests/codim_one/grid_refinement.cc index 5bb56bff91..0cfb1c4505 100644 --- a/tests/codim_one/grid_refinement.cc +++ b/tests/codim_one/grid_refinement.cc @@ -37,7 +37,7 @@ test(std::string filename) Triangulation tria; GridIn gi; gi.attach_triangulation(tria); - std::ifstream in(filename.c_str()); + std::ifstream in(filename); gi.read_ucd(in); tria.set_all_manifold_ids(1); tria.set_manifold(1, boundary); diff --git a/tests/codim_one/interpolate_boundary_values_01.cc b/tests/codim_one/interpolate_boundary_values_01.cc index a224c48a62..19161e3d8a 100644 --- a/tests/codim_one/interpolate_boundary_values_01.cc +++ b/tests/codim_one/interpolate_boundary_values_01.cc @@ -39,7 +39,7 @@ test(std::string filename) Triangulation tria; GridIn gi; gi.attach_triangulation(tria); - std::ifstream in(filename.c_str()); + std::ifstream in(filename); gi.read_ucd(in); deallog << tria.n_active_cells() << " active cells" << std::endl; diff --git a/tests/codim_one/interpolate_boundary_values_01_vector_valued.cc b/tests/codim_one/interpolate_boundary_values_01_vector_valued.cc index c172d5af76..00f7d7ef3f 100644 --- a/tests/codim_one/interpolate_boundary_values_01_vector_valued.cc +++ b/tests/codim_one/interpolate_boundary_values_01_vector_valued.cc @@ -57,7 +57,7 @@ test(std::string filename) Triangulation tria; GridIn gi; gi.attach_triangulation(tria); - std::ifstream in(filename.c_str()); + std::ifstream in(filename); gi.read_ucd(in); deallog << tria.n_active_cells() << " active cells" << std::endl; diff --git a/tests/codim_one/interpolation.cc b/tests/codim_one/interpolation.cc index 659cbdd209..2acda2b183 100644 --- a/tests/codim_one/interpolation.cc +++ b/tests/codim_one/interpolation.cc @@ -49,7 +49,7 @@ test(std::string filename, unsigned int n) GridIn gi; gi.attach_triangulation(triangulation); - std::ifstream in(filename.c_str()); + std::ifstream in(filename); gi.read_ucd(in); FE_Q fe(n); diff --git a/tests/codim_one/interpolation_2.cc b/tests/codim_one/interpolation_2.cc index 58dbba99fd..38d43e2835 100644 --- a/tests/codim_one/interpolation_2.cc +++ b/tests/codim_one/interpolation_2.cc @@ -51,7 +51,7 @@ test(std::string filename) GridIn gi; gi.attach_triangulation(triangulation); - std::ifstream in(filename.c_str()); + std::ifstream in(filename); gi.read_ucd(in); FE_Q fe(1); diff --git a/tests/codim_one/interpolation_3.cc b/tests/codim_one/interpolation_3.cc index 7315891fd1..8bd12ab127 100644 --- a/tests/codim_one/interpolation_3.cc +++ b/tests/codim_one/interpolation_3.cc @@ -53,7 +53,7 @@ test(std::string filename) GridIn gi; gi.attach_triangulation(triangulation); - std::ifstream in(filename.c_str()); + std::ifstream in(filename); gi.read_ucd(in); FE_Q fe_base(1); diff --git a/tests/codim_one/mapping_fe_field_01.cc b/tests/codim_one/mapping_fe_field_01.cc index bfeb69c90d..fdd4fc2b5a 100644 --- a/tests/codim_one/mapping_fe_field_01.cc +++ b/tests/codim_one/mapping_fe_field_01.cc @@ -97,7 +97,7 @@ test(const unsigned int refs, std::string filename_scal = ("scal_check_" + Utilities::int_to_string(id) + ".vtu"); - std::ofstream file_scal(filename_scal.c_str()); + std::ofstream file_scal(filename_scal); data_out_scal.write_vtu(file_scal); data_out_scal.write_vtk(deallog.get_file_stream()); @@ -119,7 +119,7 @@ test(const unsigned int refs, std::string filename_euler = ("euler_check_" + Utilities::int_to_string(id) + ".vtu"); - std::ofstream file_euler(filename_euler.c_str()); + std::ofstream file_euler(filename_euler); data_out_euler.write_vtu(file_euler); data_out_euler.write_vtk(deallog.get_file_stream()); diff --git a/tests/codim_one/mapping_q1.cc b/tests/codim_one/mapping_q1.cc index 3974a0b6e0..a0c05c5bc6 100644 --- a/tests/codim_one/mapping_q1.cc +++ b/tests/codim_one/mapping_q1.cc @@ -40,7 +40,7 @@ test(std::string filename) Triangulation tria; GridIn gi; gi.attach_triangulation(tria); - std::ifstream in(filename.c_str()); + std::ifstream in(filename); gi.read_ucd(in); GridOut grid_out; diff --git a/tests/codim_one/mapping_q1_eulerian.cc b/tests/codim_one/mapping_q1_eulerian.cc index c1b8918c2e..b8677675cd 100644 --- a/tests/codim_one/mapping_q1_eulerian.cc +++ b/tests/codim_one/mapping_q1_eulerian.cc @@ -51,7 +51,7 @@ test(std::string filename) GridIn gi; gi.attach_triangulation(tria); - std::ifstream in(filename.c_str()); + std::ifstream in(filename); gi.read_ucd(in); shift_dh.distribute_dofs(fe); diff --git a/tests/codim_one/mapping_q_eulerian.cc b/tests/codim_one/mapping_q_eulerian.cc index 719fd3288d..7b3f1f545f 100644 --- a/tests/codim_one/mapping_q_eulerian.cc +++ b/tests/codim_one/mapping_q_eulerian.cc @@ -51,7 +51,7 @@ test(std::string filename, unsigned int degree) GridIn gi; gi.attach_triangulation(tria); - std::ifstream in(filename.c_str()); + std::ifstream in(filename); gi.read_ucd(in); shift_dh.distribute_dofs(fe); diff --git a/tests/codim_one/projection.cc b/tests/codim_one/projection.cc index 4035811c14..bcebbb3581 100644 --- a/tests/codim_one/projection.cc +++ b/tests/codim_one/projection.cc @@ -53,7 +53,7 @@ test(std::string filename, unsigned int n) GridIn gi; gi.attach_triangulation(triangulation); - std::ifstream in(filename.c_str()); + std::ifstream in(filename); gi.read_ucd(in); FE_Q fe(n); diff --git a/tests/codim_one/projection_dgp.cc b/tests/codim_one/projection_dgp.cc index 2f793d8ed2..1779e43737 100644 --- a/tests/codim_one/projection_dgp.cc +++ b/tests/codim_one/projection_dgp.cc @@ -54,7 +54,7 @@ test(std::string filename, unsigned int n) GridIn gi; gi.attach_triangulation(triangulation); - std::ifstream in(filename.c_str()); + std::ifstream in(filename); gi.read_ucd(in); FE_DGP fe(n); diff --git a/tests/codim_one/renumber_component_wise_01.cc b/tests/codim_one/renumber_component_wise_01.cc index 76799f1789..93aa58244b 100644 --- a/tests/codim_one/renumber_component_wise_01.cc +++ b/tests/codim_one/renumber_component_wise_01.cc @@ -40,7 +40,7 @@ test(std::string filename) Triangulation tria; GridIn gi; gi.attach_triangulation(tria); - std::ifstream in(filename.c_str()); + std::ifstream in(filename); gi.read_ucd(in); deallog << tria.n_active_cells() << " active cells" << std::endl; diff --git a/tests/codim_one/surface.cc b/tests/codim_one/surface.cc index 60bea82566..06403f32b6 100644 --- a/tests/codim_one/surface.cc +++ b/tests/codim_one/surface.cc @@ -48,7 +48,7 @@ test(std::string filename) GridIn gi; gi.attach_triangulation(triangulation); - std::ifstream in(filename.c_str()); + std::ifstream in(filename); gi.read_ucd(in); const QGauss quadrature(2); diff --git a/tests/data_out/data_out_hdf5_02.cc b/tests/data_out/data_out_hdf5_02.cc index 503f999979..96843cfb47 100644 --- a/tests/data_out/data_out_hdf5_02.cc +++ b/tests/data_out/data_out_hdf5_02.cc @@ -124,7 +124,7 @@ check() data_filter.get_data_set_dim(i)); } - std::ofstream xdmf_file((output_basename + ".xdmf").c_str()); + std::ofstream xdmf_file(output_basename + ".xdmf"); xdmf_file << "\n"; xdmf_file << "\n"; @@ -150,7 +150,7 @@ check() << "\n==============================" << std::endl; cat_file((output_basename + ".xdmf").c_str()); - std::ifstream f((output_basename + ".h5").c_str()); + std::ifstream f(output_basename + ".h5"); AssertThrow(f.good(), ExcIO()); deallog << std::flush; diff --git a/tests/distributed_grids/2d_refinement_10.cc b/tests/distributed_grids/2d_refinement_10.cc index 81e2f2ef5d..fc0a829380 100644 --- a/tests/distributed_grids/2d_refinement_10.cc +++ b/tests/distributed_grids/2d_refinement_10.cc @@ -324,7 +324,7 @@ TriaTest::write_vtu(const unsigned int counter) const case_name + Utilities::int_to_string(counter, 4); const std::string slot_itag = ".slot-" + Utilities::int_to_string(myid, 4); - std::ofstream output((output_tag + slot_itag + ".vtu").c_str()); + std::ofstream output(output_tag + slot_itag + ".vtu"); data_out.write_vtu(output); if (I_am_host) @@ -337,7 +337,7 @@ TriaTest::write_vtu(const unsigned int counter) const filenames.push_back(output_tag + ".slot-" + Utilities::int_to_string(i, 4) + ".vtu"); } - std::ofstream pvtu_output((output_tag + ".pvtu").c_str()); + std::ofstream pvtu_output(output_tag + ".pvtu"); data_out.write_pvtu_record(pvtu_output, filenames); } #else diff --git a/tests/distributed_grids/3d_refinement_12.cc b/tests/distributed_grids/3d_refinement_12.cc index 4c55019a48..897ace4b05 100644 --- a/tests/distributed_grids/3d_refinement_12.cc +++ b/tests/distributed_grids/3d_refinement_12.cc @@ -324,7 +324,7 @@ TriaTest::write_vtu(const unsigned int counter) const case_name + Utilities::int_to_string(counter, 4); const std::string slot_itag = ".slot-" + Utilities::int_to_string(myid, 4); - std::ofstream output((output_tag + slot_itag + ".vtu").c_str()); + std::ofstream output(output_tag + slot_itag + ".vtu"); data_out.write_vtu(output); if (I_am_host) @@ -337,7 +337,7 @@ TriaTest::write_vtu(const unsigned int counter) const filenames.push_back(output_tag + ".slot-" + Utilities::int_to_string(i, 4) + ".vtu"); } - std::ofstream pvtu_output((output_tag + ".pvtu").c_str()); + std::ofstream pvtu_output(output_tag + ".pvtu"); data_out.write_pvtu_record(pvtu_output, filenames); } #else diff --git a/tests/distributed_grids/coarse_grid_common.h b/tests/distributed_grids/coarse_grid_common.h index a3f3668287..8e226d4cc7 100644 --- a/tests/distributed_grids/coarse_grid_common.h +++ b/tests/distributed_grids/coarse_grid_common.h @@ -48,7 +48,7 @@ write_vtk(const parallel::distributed::Triangulation &tria, // into the logstream { unsigned int c = 0; - std::ifstream in((std::string(filename) + ".pvtu").c_str()); + std::ifstream in(std::string(filename) + ".pvtu"); while (in && ++c < 20) { std::string s; @@ -59,7 +59,7 @@ write_vtk(const parallel::distributed::Triangulation &tria, { unsigned int c = 0; - std::ifstream in((std::string(filename) + "_0000.vtu").c_str()); + std::ifstream in(std::string(filename) + "_0000.vtu"); while (in && ++c < 20) { std::string s; @@ -79,9 +79,9 @@ assert_tria_equal(const Triangulation &a, const Triangulation &b) std::string file1 = "tmp_grid1"; std::string file2 = "tmp_grid2"; - std::ofstream out1(file1.c_str()); + std::ofstream out1(file1); GridOut().write_gnuplot(a, out1); - std::ofstream out2(file2.c_str()); + std::ofstream out2(file2); GridOut().write_gnuplot(b, out2); out1.close(); diff --git a/tests/dofs/dof_renumbering_10.cc b/tests/dofs/dof_renumbering_10.cc index fa8ce0e169..48a10900e3 100644 --- a/tests/dofs/dof_renumbering_10.cc +++ b/tests/dofs/dof_renumbering_10.cc @@ -120,7 +120,7 @@ test(const bool adaptive_ref = true) dealii::Utilities::int_to_string(this_mpi_core); const std::string filename = base_filename + ".gp"; - std::ofstream f(filename.c_str()); + std::ofstream f(filename); f << "set terminal png size 400,410 enhanced font \"Helvetica,8\"" << std::endl diff --git a/tests/dofs/dof_tools_extract_dofs_with_support_contained_within_01.cc b/tests/dofs/dof_tools_extract_dofs_with_support_contained_within_01.cc index e3cb6462d6..67f7d8599d 100644 --- a/tests/dofs/dof_tools_extract_dofs_with_support_contained_within_01.cc +++ b/tests/dofs/dof_tools_extract_dofs_with_support_contained_within_01.cc @@ -97,7 +97,7 @@ test(const unsigned int flag) const std::string filename = "grid" + Utilities::int_to_string(dim) + Utilities::int_to_string(flag) + ".gp"; - std::ofstream f(filename.c_str()); + std::ofstream f(filename); f << "set terminal png size 400,410 enhanced font \"Helvetica,8\"" << std::endl diff --git a/tests/dofs/dof_tools_extract_dofs_with_support_contained_within_02.cc b/tests/dofs/dof_tools_extract_dofs_with_support_contained_within_02.cc index 159435c6c0..bb83679192 100644 --- a/tests/dofs/dof_tools_extract_dofs_with_support_contained_within_02.cc +++ b/tests/dofs/dof_tools_extract_dofs_with_support_contained_within_02.cc @@ -157,7 +157,7 @@ test(const unsigned int flag) const std::string filename = output_name(flag, triangulation.locally_owned_subdomain()); - std::ofstream output(filename.c_str()); + std::ofstream output(filename); data_out.write_vtu(output); if (Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) == 0) @@ -170,7 +170,7 @@ test(const unsigned int flag) const std::string pvtu_filename = "output" + Utilities::int_to_string(flag) + ".pvtu"; - std::ofstream pvtu_output(pvtu_filename.c_str()); + std::ofstream pvtu_output(pvtu_filename); data_out.write_pvtu_record(pvtu_output, filenames); } } diff --git a/tests/dofs/dof_tools_extract_dofs_with_support_contained_within_03.cc b/tests/dofs/dof_tools_extract_dofs_with_support_contained_within_03.cc index bb8d191cc6..bf78b33430 100644 --- a/tests/dofs/dof_tools_extract_dofs_with_support_contained_within_03.cc +++ b/tests/dofs/dof_tools_extract_dofs_with_support_contained_within_03.cc @@ -122,7 +122,7 @@ test(const bool left = true) const std::string filename = "grid" + Utilities::int_to_string(dim) + ".gp"; - std::ofstream f(filename.c_str()); + std::ofstream f(filename); f << "set terminal png size 400,410 enhanced font \"Helvetica,8\"" << std::endl diff --git a/tests/dofs/dof_tools_extract_dofs_with_support_contained_within_04.cc b/tests/dofs/dof_tools_extract_dofs_with_support_contained_within_04.cc index 86690f8c84..7732236342 100644 --- a/tests/dofs/dof_tools_extract_dofs_with_support_contained_within_04.cc +++ b/tests/dofs/dof_tools_extract_dofs_with_support_contained_within_04.cc @@ -229,7 +229,7 @@ test() const std::string filename = "grid" + dealii::Utilities::int_to_string(n_mpi_processes) + dealii::Utilities::int_to_string(this_mpi_process); - std::ofstream f((filename + ".gp").c_str()); + std::ofstream f(filename + ".gp"); f << "set terminal png size 400,410 enhanced font \"Helvetica,8\"" << std::endl @@ -281,7 +281,7 @@ test() const std::string filename = output_name(triangulation.locally_owned_subdomain()); - std::ofstream output(filename.c_str()); + std::ofstream output(filename); data_out.write_vtu(output); if (dealii::Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) == 0) @@ -293,7 +293,7 @@ test() filenames.push_back(output_name(i)); const std::string pvtu_filename = "output.pvtu"; - std::ofstream pvtu_output(pvtu_filename.c_str()); + std::ofstream pvtu_output(pvtu_filename); data_out.write_pvtu_record(pvtu_output, filenames); } } diff --git a/tests/dofs/locally_relevant_dofs_per_subdomain_01.cc b/tests/dofs/locally_relevant_dofs_per_subdomain_01.cc index 8a85810e76..b64616951a 100644 --- a/tests/dofs/locally_relevant_dofs_per_subdomain_01.cc +++ b/tests/dofs/locally_relevant_dofs_per_subdomain_01.cc @@ -55,7 +55,7 @@ write_mesh(const parallel::shared::Triangulation &tria, const std::string filename = (filename_ + Utilities::int_to_string(tria.locally_owned_subdomain(), 4)); { - std::ofstream output((filename + ".vtu").c_str()); + std::ofstream output(filename + ".vtu"); data_out.write_vtu(output); } } diff --git a/tests/dofs/locally_relevant_dofs_per_subdomain_01_hp.cc b/tests/dofs/locally_relevant_dofs_per_subdomain_01_hp.cc index 2a6a71bd5e..8ddf60743d 100644 --- a/tests/dofs/locally_relevant_dofs_per_subdomain_01_hp.cc +++ b/tests/dofs/locally_relevant_dofs_per_subdomain_01_hp.cc @@ -59,7 +59,7 @@ write_mesh(const parallel::shared::Triangulation &tria, const std::string filename = (filename_ + Utilities::int_to_string(tria.locally_owned_subdomain(), 4)); { - std::ofstream output((filename + ".vtu").c_str()); + std::ofstream output(filename + ".vtu"); data_out.write_vtu(output); } } diff --git a/tests/dofs/range_based_for_step-6.cc b/tests/dofs/range_based_for_step-6.cc index c98bfd723a..c84e6344c5 100644 --- a/tests/dofs/range_based_for_step-6.cc +++ b/tests/dofs/range_based_for_step-6.cc @@ -302,7 +302,7 @@ Step6::output_results(const unsigned int cycle) const filename += ('0' + cycle); filename += ".eps"; - std::ofstream output(filename.c_str()); + std::ofstream output(filename); GridOut grid_out; grid_out.write_eps(triangulation, output); diff --git a/tests/fe/fe_enriched_04.cc b/tests/fe/fe_enriched_04.cc index b56d3cc9d5..b1476bd7ed 100644 --- a/tests/fe/fe_enriched_04.cc +++ b/tests/fe/fe_enriched_04.cc @@ -184,7 +184,7 @@ plot_shape_function() std::string filename = "shape_functions_" + dealii::Utilities::int_to_string(dim) + "D.vtu"; - std::ofstream output(filename.c_str()); + std::ofstream output(filename); data_out.write_vtu(output); dof_handler.clear(); diff --git a/tests/fe/fe_enriched_05.cc b/tests/fe/fe_enriched_05.cc index 3e72d567d3..fc25194a96 100644 --- a/tests/fe/fe_enriched_05.cc +++ b/tests/fe/fe_enriched_05.cc @@ -135,7 +135,7 @@ test4() std::string filename = "h-shape_functions_" + dealii::Utilities::int_to_string(dim) + "D.vtu"; - std::ofstream output(filename.c_str()); + std::ofstream output(filename); data_out.write_vtu(output); #endif diff --git a/tests/fe/fe_enriched_06.cc b/tests/fe/fe_enriched_06.cc index 151d886f3b..8ea8fb7034 100644 --- a/tests/fe/fe_enriched_06.cc +++ b/tests/fe/fe_enriched_06.cc @@ -171,7 +171,7 @@ test5() std::string filename = "4cell_functions_" + dealii::Utilities::int_to_string(dim) + "D.vtu"; - std::ofstream output(filename.c_str()); + std::ofstream output(filename); data_out.write_vtu(output); #endif diff --git a/tests/fe/fe_enriched_07.cc b/tests/fe/fe_enriched_07.cc index 7c55b4eee1..8b15387840 100644 --- a/tests/fe/fe_enriched_07.cc +++ b/tests/fe/fe_enriched_07.cc @@ -186,7 +186,7 @@ test6(const bool do_href, "_p_feq=" + std::to_string(p_feq) + "_p_feenr=" + std::to_string(p_feen) + "_" + dealii::Utilities::int_to_string(dim) + "D.vtu"; - std::ofstream output(filename.c_str()); + std::ofstream output(filename); data_out.write_vtu(output); #endif diff --git a/tests/fe/fe_enriched_08.cc b/tests/fe/fe_enriched_08.cc index 928e32ed56..96cf627c11 100644 --- a/tests/fe/fe_enriched_08.cc +++ b/tests/fe/fe_enriched_08.cc @@ -174,7 +174,7 @@ test2cells(const unsigned int p_feq = 2, const unsigned int p_feen = 1) "2cell-shape_functions_p_feq=" + std::to_string(p_feq) + "_p_feenr=" + std::to_string(p_feen) + "_" + dealii::Utilities::int_to_string(dim) + "D.vtu"; - std::ofstream output(filename.c_str()); + std::ofstream output(filename); data_out.write_vtu(output); #endif diff --git a/tests/fe/fe_enriched_color_05.cc b/tests/fe/fe_enriched_color_05.cc index 5ae9fb3cdb..fa4f4ea139 100644 --- a/tests/fe/fe_enriched_color_05.cc +++ b/tests/fe/fe_enriched_color_05.cc @@ -150,7 +150,7 @@ plot_shape_function(DoFHandler &dof_handler, unsigned int patches = 5) std::string filename = "hp-shape_functions_" + dealii::Utilities::int_to_string(dim) + "D.vtu"; - std::ofstream output(filename.c_str()); + std::ofstream output(filename); data_out.write_vtu(output); } diff --git a/tests/fe/fe_enriched_color_07.cc b/tests/fe/fe_enriched_color_07.cc index fc2488ad4c..ab06770941 100644 --- a/tests/fe/fe_enriched_color_07.cc +++ b/tests/fe/fe_enriched_color_07.cc @@ -988,7 +988,7 @@ plot_shape_function(DoFHandler &dof_handler, unsigned int patches = 5) dealii::Utilities::int_to_string(0); const std::string filename = base_filename + ".gp"; - std::ofstream f(filename.c_str()); + std::ofstream f(filename); f << "set terminal png size 400,410 enhanced font \"Helvetica,8\"" << std::endl @@ -1030,7 +1030,7 @@ plot_shape_function(DoFHandler &dof_handler, unsigned int patches = 5) data_out.build_patches(patches); std::string filename = "shape_functions.vtu"; - std::ofstream output(filename.c_str()); + std::ofstream output(filename); data_out.write_vtu(output); std::cout << "...finished plotting shape functions" << std::endl; @@ -1361,7 +1361,7 @@ LaplaceProblem::build_fe_space() "fe_indices" + dealii::Utilities::int_to_string(dim) + "_p" + dealii::Utilities::int_to_string(0); const std::string filename = base_filename + ".gp"; - std::ofstream f(filename.c_str()); + std::ofstream f(filename); f << "set terminal png size 400,410 enhanced font \"Helvetica,8\"" << std::endl @@ -1391,7 +1391,7 @@ LaplaceProblem::build_fe_space() "cell_id" + dealii::Utilities::int_to_string(dim) + "_p" + dealii::Utilities::int_to_string(0); const std::string filename = base_filename + ".gp"; - std::ofstream f(filename.c_str()); + std::ofstream f(filename); f << "set terminal png size 400,410 enhanced font \"Helvetica,8\"" << std::endl @@ -1672,7 +1672,7 @@ LaplaceProblem::output_results(const unsigned int cycle) std::string filename = "solution-"; filename += Utilities::to_string(cycle); filename += ".vtk"; - std::ofstream output(filename.c_str()); + std::ofstream output(filename); DataOut data_out; data_out.attach_dof_handler(dof_handler); diff --git a/tests/fe/fe_enriched_color_08.cc b/tests/fe/fe_enriched_color_08.cc index 6a1eaf9865..15fd59a366 100644 --- a/tests/fe/fe_enriched_color_08.cc +++ b/tests/fe/fe_enriched_color_08.cc @@ -114,7 +114,7 @@ plot_shape_function(DoFHandler &dof_handler, unsigned int patches = 5) dealii::Utilities::int_to_string(0); const std::string filename = base_filename + ".gp"; - std::ofstream f(filename.c_str()); + std::ofstream f(filename); f << "set terminal png size 400,410 enhanced font \"Helvetica,8\"" << std::endl @@ -158,7 +158,7 @@ plot_shape_function(DoFHandler &dof_handler, unsigned int patches = 5) data_out.build_patches(patches); std::string filename = "shape_functions.vtu"; - std::ofstream output(filename.c_str()); + std::ofstream output(filename); data_out.write_vtu(output); deallog << "...finished plotting shape functions" << std::endl; diff --git a/tests/fe/fe_enriched_step-36.cc b/tests/fe/fe_enriched_step-36.cc index eabb8d684b..41944399a2 100644 --- a/tests/fe/fe_enriched_step-36.cc +++ b/tests/fe/fe_enriched_step-36.cc @@ -554,7 +554,7 @@ namespace Step36 std::string filename = "solution-"; filename += ('0' + cycle); filename += ".vtk"; - std::ofstream output(filename.c_str()); + std::ofstream output(filename); DataOut data_out; data_out.attach_dof_handler(dof_handler); @@ -570,7 +570,7 @@ namespace Step36 std::string filename = "mesh-"; filename += ('0' + cycle); filename += ".vtk"; - std::ofstream output(filename.c_str()); + std::ofstream output(filename); DataOut data_out; data_out.attach_dof_handler(dof_handler); @@ -586,7 +586,7 @@ namespace Step36 { const std::string scalar_fname = "scalar-data.txt"; - std::ofstream output(scalar_fname.c_str(), + std::ofstream output(scalar_fname, std::ios::out | (cycle == 0 ? std::ios::trunc : std::ios::app)); diff --git a/tests/fe/fe_enriched_step-36b.cc b/tests/fe/fe_enriched_step-36b.cc index 9b8cdabcc4..2d0a4addb2 100644 --- a/tests/fe/fe_enriched_step-36b.cc +++ b/tests/fe/fe_enriched_step-36b.cc @@ -814,7 +814,7 @@ namespace Step36 std::string filename = "solution-"; filename += ('0' + cycle); filename += ".vtk"; - std::ofstream output(filename.c_str()); + std::ofstream output(filename); Postprocessor postprocessor( enrichment); // has to live until the DataOut object is destroyed; @@ -835,7 +835,7 @@ namespace Step36 std::string filename = "mesh-"; filename += ('0' + cycle); filename += ".vtk"; - std::ofstream output(filename.c_str()); + std::ofstream output(filename); DataOut data_out; data_out.attach_dof_handler(dof_handler); @@ -851,7 +851,7 @@ namespace Step36 { const std::string scalar_fname = "scalar-data.txt"; - std::ofstream output(scalar_fname.c_str(), + std::ofstream output(scalar_fname, std::ios::out | (cycle == 0 ? std::ios::trunc : std::ios::app)); diff --git a/tests/fe/fe_system_components_base.cc b/tests/fe/fe_system_components_base.cc index ef1cdfb515..1dc3998c2d 100644 --- a/tests/fe/fe_system_components_base.cc +++ b/tests/fe/fe_system_components_base.cc @@ -90,7 +90,7 @@ test(const bool renumber = false) const std::string filename = "grid" + Utilities::int_to_string(dim) + Utilities::int_to_string(renumber) + ".gp"; - std::ofstream f(filename.c_str()); + std::ofstream f(filename); f << "set terminal png size 420,440 enhanced font \"Helvetica,16\"" << std::endl diff --git a/tests/fe/fe_tools_test.cc b/tests/fe/fe_tools_test.cc index 3859b26385..6947ba398b 100644 --- a/tests/fe/fe_tools_test.cc +++ b/tests/fe/fe_tools_test.cc @@ -160,7 +160,7 @@ test(const Triangulation &tria, data_out.add_data_vector(function1, fe_string1); data_out.build_patches(2); // std::string file1_name=fe_string1+"_function.gnuplot"; - // std::ofstream file1(file1_name.c_str()); + // std::ofstream file1(file1_name); // data_out.write_gnuplot(file1); // file1.close(); data_out.clear(); @@ -190,7 +190,7 @@ test(const Triangulation &tria, data_out.build_patches(2); data_out.write_gnuplot(deallog.get_file_stream()); - // std::ofstream file2(file2_name.c_str()); + // std::ofstream file2(file2_name); // file2.setf(std::ios::showpoint | std::ios::left); // data_out.write_gnuplot(file2); // file2.close(); diff --git a/tests/fe/nedelec_crash_01.cc b/tests/fe/nedelec_crash_01.cc index 706f167ffd..bd297ba16f 100644 --- a/tests/fe/nedelec_crash_01.cc +++ b/tests/fe/nedelec_crash_01.cc @@ -31,7 +31,7 @@ int main() { const std::string logname = "output"; - std::ofstream logfile(logname.c_str()); + std::ofstream logfile(logname); deallog.attach(logfile); // generate a version of the diff --git a/tests/fe/shapes_faceq.cc b/tests/fe/shapes_faceq.cc index 67afa77ece..8a593f6f99 100644 --- a/tests/fe/shapes_faceq.cc +++ b/tests/fe/shapes_faceq.cc @@ -59,7 +59,7 @@ int main() { const std::string logname = "output"; - std::ofstream logfile(logname.c_str()); + std::ofstream logfile(logname); deallog << std::setprecision(PRECISION) << std::fixed; deallog.attach(logfile); diff --git a/tests/fe/shapes_traceq.cc b/tests/fe/shapes_traceq.cc index be43d8083e..7ffafbd65b 100644 --- a/tests/fe/shapes_traceq.cc +++ b/tests/fe/shapes_traceq.cc @@ -58,7 +58,7 @@ int main() { const std::string logname = "output"; - std::ofstream logfile(logname.c_str()); + std::ofstream logfile(logname); deallog << std::setprecision(PRECISION) << std::fixed; deallog.attach(logfile); diff --git a/tests/grid/grid_generator_plate_with_a_hole.cc b/tests/grid/grid_generator_plate_with_a_hole.cc index e79273173f..a2900c60a1 100644 --- a/tests/grid/grid_generator_plate_with_a_hole.cc +++ b/tests/grid/grid_generator_plate_with_a_hole.cc @@ -99,7 +99,7 @@ test() const std::string filename = "output_" + Utilities::int_to_string(dim) + ".vtu"; - std::ofstream output(filename.c_str()); + std::ofstream output(filename); data_out.write_vtu(output); } } diff --git a/tests/grid/grid_generator_plate_with_a_hole_2.cc b/tests/grid/grid_generator_plate_with_a_hole_2.cc index f572d1c0d9..35fe9c2d08 100644 --- a/tests/grid/grid_generator_plate_with_a_hole_2.cc +++ b/tests/grid/grid_generator_plate_with_a_hole_2.cc @@ -103,7 +103,7 @@ test() const std::string filename = "output_" + Utilities::int_to_string(dim) + ".vtu"; - std::ofstream output(filename.c_str()); + std::ofstream output(filename); data_out.write_vtu(output); } } diff --git a/tests/grid/grid_generator_plate_with_a_hole_3.cc b/tests/grid/grid_generator_plate_with_a_hole_3.cc index 0ca85a5f0d..fcde178f3d 100644 --- a/tests/grid/grid_generator_plate_with_a_hole_3.cc +++ b/tests/grid/grid_generator_plate_with_a_hole_3.cc @@ -103,7 +103,7 @@ test() const std::string filename = "output_" + Utilities::int_to_string(dim) + ".vtu"; - std::ofstream output(filename.c_str()); + std::ofstream output(filename); data_out.write_vtu(output); } } diff --git a/tests/grid/grid_generator_plate_with_a_hole_4.cc b/tests/grid/grid_generator_plate_with_a_hole_4.cc index 61a6c9d888..fc798b2fe1 100644 --- a/tests/grid/grid_generator_plate_with_a_hole_4.cc +++ b/tests/grid/grid_generator_plate_with_a_hole_4.cc @@ -99,7 +99,7 @@ test() const std::string filename = "output_" + Utilities::int_to_string(dim) + ".vtu"; - std::ofstream output(filename.c_str()); + std::ofstream output(filename); data_out.write_vtu(output); } } diff --git a/tests/grid/grid_out_vtk_02.cc b/tests/grid/grid_out_vtk_02.cc index b7c8ea7a3f..03f663dfd7 100644 --- a/tests/grid/grid_out_vtk_02.cc +++ b/tests/grid/grid_out_vtk_02.cc @@ -69,7 +69,7 @@ test() // + "d." + // Utilities::int_to_string(tr.locally_owned_subdomain(), 4) + // ".vtk"); - // std::ofstream stream(filename.c_str()); + // std::ofstream stream(filename); output(tr, deallog.get_file_stream()); // tr.begin_active()->set_level_subdomain_id(1+myid); diff --git a/tests/grid/grid_tools_active_cell_layer_within_distance_01.cc b/tests/grid/grid_tools_active_cell_layer_within_distance_01.cc index 8c9488d32a..a1d5ace326 100644 --- a/tests/grid/grid_tools_active_cell_layer_within_distance_01.cc +++ b/tests/grid/grid_tools_active_cell_layer_within_distance_01.cc @@ -86,7 +86,7 @@ test() { const std::string filename = "grid_no_halo_" + Utilities::int_to_string(dim) + "d.vtk"; - std::ofstream f(filename.c_str()); + std::ofstream f(filename); GridOut().write_vtk(tria, f); } @@ -112,7 +112,7 @@ test() { const std::string filename = "grid_with_halo_" + Utilities::int_to_string(dim) + "d.vtk"; - std::ofstream f(filename.c_str()); + std::ofstream f(filename); GridOut().write_vtk(tria, f); } } diff --git a/tests/grid/grid_tools_active_cell_layer_within_distance_02.cc b/tests/grid/grid_tools_active_cell_layer_within_distance_02.cc index 0cc9e1bb0e..0f87690e62 100644 --- a/tests/grid/grid_tools_active_cell_layer_within_distance_02.cc +++ b/tests/grid/grid_tools_active_cell_layer_within_distance_02.cc @@ -113,7 +113,7 @@ test() { const std::string filename = "grid_no_skin_" + Utilities::int_to_string(dim) + "d.vtk"; - std::ofstream f(filename.c_str()); + std::ofstream f(filename); GridOut().write_vtk(tria, f); } #endif @@ -145,7 +145,7 @@ test() { const std::string filename = "grid_with_skin_" + Utilities::int_to_string(dim) + "d.vtk"; - std::ofstream f(filename.c_str()); + std::ofstream f(filename); GridOut().write_vtk(tria, f); } #endif diff --git a/tests/grid/grid_tools_halo_layer_01.cc b/tests/grid/grid_tools_halo_layer_01.cc index 1f3deb248a..3ffa68655c 100644 --- a/tests/grid/grid_tools_halo_layer_01.cc +++ b/tests/grid/grid_tools_halo_layer_01.cc @@ -81,7 +81,7 @@ test() { const std::string filename = "grid_no_halo_" + Utilities::int_to_string(dim) + "d.vtk"; - std::ofstream f(filename.c_str()); + std::ofstream f(filename); GridOut().write_vtk(tria, f); } @@ -107,7 +107,7 @@ test() { const std::string filename = "grid_with_halo_" + Utilities::int_to_string(dim) + "d.vtk"; - std::ofstream f(filename.c_str()); + std::ofstream f(filename); GridOut().write_vtk(tria, f); } } diff --git a/tests/grid/grid_tools_halo_layer_02.cc b/tests/grid/grid_tools_halo_layer_02.cc index 0af87dda9e..f4a3891cc3 100644 --- a/tests/grid/grid_tools_halo_layer_02.cc +++ b/tests/grid/grid_tools_halo_layer_02.cc @@ -75,7 +75,7 @@ test() { const std::string filename = "grid_no_halo_" + Utilities::int_to_string(dim) + "d.vtk"; - std::ofstream f(filename.c_str()); + std::ofstream f(filename); GridOut().write_vtk(tria, f); } @@ -99,7 +99,7 @@ test() { const std::string filename = "grid_with_halo_" + Utilities::int_to_string(dim) + "d.vtk"; - std::ofstream f(filename.c_str()); + std::ofstream f(filename); GridOut().write_vtk(tria, f); } } diff --git a/tests/grid/grid_tools_halo_layer_03.cc b/tests/grid/grid_tools_halo_layer_03.cc index 3f4e511c9b..276c6897da 100644 --- a/tests/grid/grid_tools_halo_layer_03.cc +++ b/tests/grid/grid_tools_halo_layer_03.cc @@ -80,7 +80,7 @@ test() { const std::string filename = "grid_no_halo_" + Utilities::int_to_string(dim) + "d.vtk"; - std::ofstream f(filename.c_str()); + std::ofstream f(filename); GridOut().write_vtk(tria, f); } @@ -108,7 +108,7 @@ test() { const std::string filename = "grid_with_halo_" + Utilities::int_to_string(dim) + "d.vtk"; - std::ofstream f(filename.c_str()); + std::ofstream f(filename); GridOut().write_vtk(tria, f); } } diff --git a/tests/grid/grid_tools_halo_layer_04.cc b/tests/grid/grid_tools_halo_layer_04.cc index 702cf05e0b..023956e817 100644 --- a/tests/grid/grid_tools_halo_layer_04.cc +++ b/tests/grid/grid_tools_halo_layer_04.cc @@ -69,7 +69,7 @@ write_vtk(const DoFHandler &dof_handler, const std::string filename) data_component_interpretation); data_out.build_patches(); - std::ofstream output(filename.c_str()); + std::ofstream output(filename); data_out.write_vtk(output); } diff --git a/tests/grid/grid_tools_halo_layer_05.cc b/tests/grid/grid_tools_halo_layer_05.cc index 5a6b8df527..a571862012 100644 --- a/tests/grid/grid_tools_halo_layer_05.cc +++ b/tests/grid/grid_tools_halo_layer_05.cc @@ -69,7 +69,7 @@ write_vtk(const DoFHandler &dof_handler, const std::string filename) data_component_interpretation); data_out.build_patches(); - std::ofstream output(filename.c_str()); + std::ofstream output(filename); data_out.write_vtk(output); } diff --git a/tests/hp/crash_17.cc b/tests/hp/crash_17.cc index 29376226d3..ff244ec5b0 100644 --- a/tests/hp/crash_17.cc +++ b/tests/hp/crash_17.cc @@ -525,7 +525,7 @@ LaplaceProblem::output_results(const unsigned int cycle) const { const std::string filename = "grid-" + Utilities::int_to_string(cycle, 2) + ".eps"; - std::ofstream output(filename.c_str()); + std::ofstream output(filename); GridOut grid_out; grid_out.write_eps(triangulation, output); @@ -563,7 +563,7 @@ LaplaceProblem::output_results(const unsigned int cycle) const data_out.add_data_vector(fe_indices, "fe_index"); data_out.build_patches(); - std::ofstream output(filename.c_str()); + std::ofstream output(filename); data_out.write_vtk(output); } } diff --git a/tests/hp/crash_18.cc b/tests/hp/crash_18.cc index caee3829d9..aa1fc803e2 100644 --- a/tests/hp/crash_18.cc +++ b/tests/hp/crash_18.cc @@ -533,7 +533,7 @@ LaplaceProblem::output_results(const unsigned int cycle) const { const std::string filename = "grid-" + Utilities::int_to_string(cycle, 2) + ".eps"; - std::ofstream output(filename.c_str()); + std::ofstream output(filename); GridOut grid_out; grid_out.write_eps(triangulation, output); @@ -571,7 +571,7 @@ LaplaceProblem::output_results(const unsigned int cycle) const data_out.add_data_vector(fe_indices, "fe_index"); data_out.build_patches(); - std::ofstream output(filename.c_str()); + std::ofstream output(filename); data_out.write_vtk(output); } } diff --git a/tests/hp/hp_constraints_neither_dominate_01.cc b/tests/hp/hp_constraints_neither_dominate_01.cc index 7a0741d6ad..ad5c622ba9 100644 --- a/tests/hp/hp_constraints_neither_dominate_01.cc +++ b/tests/hp/hp_constraints_neither_dominate_01.cc @@ -166,7 +166,7 @@ test2cells(const unsigned int p1 = 2, const unsigned int p2 = 1) std::string filename = "shape_functions_" + dealii::Utilities::int_to_string(counter, 1) + "_" + dealii::Utilities::int_to_string(dim) + "D.vtu"; - std::ofstream output(filename.c_str()); + std::ofstream output(filename); data_out.write_vtu(output); #endif diff --git a/tests/hp/hp_constraints_neither_dominate_02.cc b/tests/hp/hp_constraints_neither_dominate_02.cc index bec5aa61cb..0cb04b486d 100644 --- a/tests/hp/hp_constraints_neither_dominate_02.cc +++ b/tests/hp/hp_constraints_neither_dominate_02.cc @@ -214,7 +214,7 @@ test2cells(const FiniteElement &fe_0, std::string filename = "shape_functions_" + dealii::Utilities::int_to_string(counter, 1) + "_" + dealii::Utilities::int_to_string(dim) + "D.vtu"; - std::ofstream output(filename.c_str()); + std::ofstream output(filename); data_out.write_vtu(output); #endif diff --git a/tests/hp/hp_q_hierarchical_constraints.cc b/tests/hp/hp_q_hierarchical_constraints.cc index 743589fb7e..b4d3449569 100644 --- a/tests/hp/hp_q_hierarchical_constraints.cc +++ b/tests/hp/hp_q_hierarchical_constraints.cc @@ -139,7 +139,7 @@ test(const bool apply_constrains, const unsigned int hp) << (apply_constrains ? "_constrained" : "") << hp_string << '_' << i << ".vtk"; - std::ofstream output(filename.str().c_str()); + std::ofstream output(filename.str()); data_out.write_vtk(output); #endif } diff --git a/tests/hp/laplace.h b/tests/hp/laplace.h index aa3d13281c..bcba063f9b 100644 --- a/tests/hp/laplace.h +++ b/tests/hp/laplace.h @@ -602,7 +602,7 @@ Laplace::print_errors() error_table.write_text(std::cout); const std::string fname = output_name + ".gp"; - std::ofstream output(fname.c_str(), std::ios::out | std::ios::trunc); + std::ofstream output(fname, std::ios::out | std::ios::trunc); // use Gnuplot datablocks: output << "$data << EOD" << std::endl; diff --git a/tests/hp/step-27.cc b/tests/hp/step-27.cc index c925cd8016..8e4f65f767 100644 --- a/tests/hp/step-27.cc +++ b/tests/hp/step-27.cc @@ -331,7 +331,7 @@ namespace Step27 const std::string filename = "solution-" + Utilities::int_to_string(cycle, 2) + ".vtk"; - std::ofstream output(filename.c_str()); + std::ofstream output(filename); data_out.write_vtk(output); } diff --git a/tests/integrators/assembler_simple_matrix_01.cc b/tests/integrators/assembler_simple_matrix_01.cc index 4baf9afb97..874a90b872 100644 --- a/tests/integrators/assembler_simple_matrix_01.cc +++ b/tests/integrators/assembler_simple_matrix_01.cc @@ -54,7 +54,7 @@ int main() { const std::string logname = "output"; - std::ofstream logfile(logname.c_str()); + std::ofstream logfile(logname); deallog.attach(logfile); Triangulation<2, 2> tr; diff --git a/tests/integrators/assembler_simple_matrix_01m.cc b/tests/integrators/assembler_simple_matrix_01m.cc index b7be41ddd0..fca631c090 100644 --- a/tests/integrators/assembler_simple_matrix_01m.cc +++ b/tests/integrators/assembler_simple_matrix_01m.cc @@ -54,7 +54,7 @@ int main() { const std::string logname = "output"; - std::ofstream logfile(logname.c_str()); + std::ofstream logfile(logname); deallog.attach(logfile); Triangulation<2, 2> tr; diff --git a/tests/integrators/assembler_simple_matrix_02.cc b/tests/integrators/assembler_simple_matrix_02.cc index 97dea68355..86516cce0e 100644 --- a/tests/integrators/assembler_simple_matrix_02.cc +++ b/tests/integrators/assembler_simple_matrix_02.cc @@ -85,7 +85,7 @@ int main() { const std::string logname = "output"; - std::ofstream logfile(logname.c_str()); + std::ofstream logfile(logname); deallog.attach(logfile); FE_DGP<2> p0(0); diff --git a/tests/integrators/assembler_simple_matrix_02m.cc b/tests/integrators/assembler_simple_matrix_02m.cc index e66f11926b..f815a2422e 100644 --- a/tests/integrators/assembler_simple_matrix_02m.cc +++ b/tests/integrators/assembler_simple_matrix_02m.cc @@ -85,7 +85,7 @@ int main() { const std::string logname = "output"; - std::ofstream logfile(logname.c_str()); + std::ofstream logfile(logname); deallog.attach(logfile); FE_DGP<2> p0(0); diff --git a/tests/integrators/assembler_simple_matrix_04.cc b/tests/integrators/assembler_simple_matrix_04.cc index 9e067c3391..2cbfdee2c8 100644 --- a/tests/integrators/assembler_simple_matrix_04.cc +++ b/tests/integrators/assembler_simple_matrix_04.cc @@ -116,7 +116,7 @@ int main() { const std::string logname = "output"; - std::ofstream logfile(logname.c_str()); + std::ofstream logfile(logname); deallog.attach(logfile); FE_DGP<2> p0(0); diff --git a/tests/integrators/assembler_simple_mgmatrix_01.cc b/tests/integrators/assembler_simple_mgmatrix_01.cc index 7264d8e7cc..8580689d54 100644 --- a/tests/integrators/assembler_simple_mgmatrix_01.cc +++ b/tests/integrators/assembler_simple_mgmatrix_01.cc @@ -54,7 +54,7 @@ int main() { const std::string logname = "output"; - std::ofstream logfile(logname.c_str()); + std::ofstream logfile(logname); deallog.attach(logfile); Triangulation<2, 2> tr; diff --git a/tests/integrators/assembler_simple_mgmatrix_02.cc b/tests/integrators/assembler_simple_mgmatrix_02.cc index 0ce35f8c42..b8afd48c14 100644 --- a/tests/integrators/assembler_simple_mgmatrix_02.cc +++ b/tests/integrators/assembler_simple_mgmatrix_02.cc @@ -82,7 +82,7 @@ int main() { const std::string logname = "output"; - std::ofstream logfile(logname.c_str()); + std::ofstream logfile(logname); deallog.attach(logfile); FE_DGP<2> p0(0); diff --git a/tests/integrators/assembler_simple_mgmatrix_03.cc b/tests/integrators/assembler_simple_mgmatrix_03.cc index c412efbf54..d71c7b4ecd 100644 --- a/tests/integrators/assembler_simple_mgmatrix_03.cc +++ b/tests/integrators/assembler_simple_mgmatrix_03.cc @@ -124,7 +124,7 @@ int main() { const std::string logname = "output"; - std::ofstream logfile(logname.c_str()); + std::ofstream logfile(logname); deallog.attach(logfile); FE_DGP<2> p0(0); diff --git a/tests/integrators/assembler_simple_mgmatrix_04.cc b/tests/integrators/assembler_simple_mgmatrix_04.cc index 5ff21666b2..79da1f07fc 100644 --- a/tests/integrators/assembler_simple_mgmatrix_04.cc +++ b/tests/integrators/assembler_simple_mgmatrix_04.cc @@ -231,7 +231,7 @@ int main() { const std::string logname("output"); - std::ofstream logfile(logname.c_str()); + std::ofstream logfile(logname); deallog.attach(logfile); FE_DGP<2> p0(0); diff --git a/tests/integrators/cells_and_faces_01.cc b/tests/integrators/cells_and_faces_01.cc index da81bbe96d..759ff3175b 100644 --- a/tests/integrators/cells_and_faces_01.cc +++ b/tests/integrators/cells_and_faces_01.cc @@ -218,7 +218,7 @@ int main() { const std::string logname = "output"; - std::ofstream logfile(logname.c_str()); + std::ofstream logfile(logname); deallog.attach(logfile); FE_DGP<2> el2(0); diff --git a/tests/integrators/divergence_01.cc b/tests/integrators/divergence_01.cc index e497de263d..ff6f581512 100644 --- a/tests/integrators/divergence_01.cc +++ b/tests/integrators/divergence_01.cc @@ -240,7 +240,7 @@ int main() { const std::string logname = "output"; - std::ofstream logfile(logname.c_str()); + std::ofstream logfile(logname); deallog.attach(logfile); Triangulation<2> tr2; diff --git a/tests/integrators/functional_01.cc b/tests/integrators/functional_01.cc index fbc014e985..c8a2e47dd0 100644 --- a/tests/integrators/functional_01.cc +++ b/tests/integrators/functional_01.cc @@ -190,7 +190,7 @@ int main() { const std::string logname = "output"; - std::ofstream logfile(logname.c_str()); + std::ofstream logfile(logname); deallog.attach(logfile); FE_DGP<2> el2(0); diff --git a/tests/integrators/mesh_worker_01.cc b/tests/integrators/mesh_worker_01.cc index ef44d9d0de..850c61942b 100644 --- a/tests/integrators/mesh_worker_01.cc +++ b/tests/integrators/mesh_worker_01.cc @@ -228,7 +228,7 @@ int main() { const std::string logname = "output"; - std::ofstream logfile(logname.c_str()); + std::ofstream logfile(logname); deallog.attach(logfile); std::vector>> fe2; diff --git a/tests/integrators/mesh_worker_02.cc b/tests/integrators/mesh_worker_02.cc index 302424fd87..7dce6e778b 100644 --- a/tests/integrators/mesh_worker_02.cc +++ b/tests/integrators/mesh_worker_02.cc @@ -326,7 +326,7 @@ int main() { const std::string logname = "output"; - std::ofstream logfile(logname.c_str()); + std::ofstream logfile(logname); deallog.attach(logfile); std::vector>> fe2; diff --git a/tests/integrators/mesh_worker_03.cc b/tests/integrators/mesh_worker_03.cc index 89fc9d4da1..ed2ad3f796 100644 --- a/tests/integrators/mesh_worker_03.cc +++ b/tests/integrators/mesh_worker_03.cc @@ -326,7 +326,7 @@ int main() { const std::string logname = "output"; - std::ofstream logfile(logname.c_str()); + std::ofstream logfile(logname); deallog.attach(logfile); FE_DGP<2> dgp0(0); diff --git a/tests/integrators/mesh_worker_1d_dg.cc b/tests/integrators/mesh_worker_1d_dg.cc index 2a9570c4d9..e76f0a5f89 100644 --- a/tests/integrators/mesh_worker_1d_dg.cc +++ b/tests/integrators/mesh_worker_1d_dg.cc @@ -461,7 +461,7 @@ int main() { const std::string logname = "output"; - std::ofstream logfile(logname.c_str()); + std::ofstream logfile(logname); deallog.attach(logfile); Advection::AdvectionProblem<1> advection_problem; diff --git a/tests/integrators/mesh_worker_matrix_01.cc b/tests/integrators/mesh_worker_matrix_01.cc index c198c713da..9188499d0a 100644 --- a/tests/integrators/mesh_worker_matrix_01.cc +++ b/tests/integrators/mesh_worker_matrix_01.cc @@ -230,7 +230,7 @@ int main() { const std::string logname = "output"; - std::ofstream logfile(logname.c_str()); + std::ofstream logfile(logname); deallog.attach(logfile); FE_DGP<2> p0(0); diff --git a/tests/lac/solver_relaxation_01.cc b/tests/lac/solver_relaxation_01.cc index 28e66827d4..495b4a3e07 100644 --- a/tests/lac/solver_relaxation_01.cc +++ b/tests/lac/solver_relaxation_01.cc @@ -58,7 +58,7 @@ int main() { const std::string logname = "output"; - std::ofstream logfile(logname.c_str()); + std::ofstream logfile(logname); // logfile.setf(std::ios::fixed); deallog << std::setprecision(4); deallog.attach(logfile); diff --git a/tests/lac/solver_relaxation_02.cc b/tests/lac/solver_relaxation_02.cc index e5ec9fbc43..e1c18c1a77 100644 --- a/tests/lac/solver_relaxation_02.cc +++ b/tests/lac/solver_relaxation_02.cc @@ -59,7 +59,7 @@ int main() { const std::string logname = "output"; - std::ofstream logfile(logname.c_str()); + std::ofstream logfile(logname); // logfile.setf(std::ios::fixed); deallog << std::setprecision(4); deallog.attach(logfile); diff --git a/tests/lac/solver_relaxation_03.cc b/tests/lac/solver_relaxation_03.cc index af432d6a6f..09590735cc 100644 --- a/tests/lac/solver_relaxation_03.cc +++ b/tests/lac/solver_relaxation_03.cc @@ -60,7 +60,7 @@ int main() { const std::string logname = "output"; - std::ofstream logfile(logname.c_str()); + std::ofstream logfile(logname); // logfile.setf(std::ios::fixed); deallog << std::setprecision(4); deallog.attach(logfile); diff --git a/tests/lac/solver_relaxation_04.cc b/tests/lac/solver_relaxation_04.cc index c543cd501d..b3a75c4f88 100644 --- a/tests/lac/solver_relaxation_04.cc +++ b/tests/lac/solver_relaxation_04.cc @@ -58,7 +58,7 @@ int main() { const std::string logname = "output"; - std::ofstream logfile(logname.c_str()); + std::ofstream logfile(logname); // logfile.setf(std::ios::fixed); deallog << std::setprecision(4); deallog.attach(logfile); diff --git a/tests/lac/sparse_matrix_Tmmult_01.cc b/tests/lac/sparse_matrix_Tmmult_01.cc index 3f04b2795a..1ff9206b0c 100644 --- a/tests/lac/sparse_matrix_Tmmult_01.cc +++ b/tests/lac/sparse_matrix_Tmmult_01.cc @@ -80,7 +80,7 @@ int main() { const std::string logname = "output"; - std::ofstream logfile(logname.c_str()); + std::ofstream logfile(logname); deallog.attach(logfile); Testing::srand(3391466); diff --git a/tests/lac/sparse_matrix_Tmmult_02.cc b/tests/lac/sparse_matrix_Tmmult_02.cc index 03cbd447a8..4f140ecc52 100644 --- a/tests/lac/sparse_matrix_Tmmult_02.cc +++ b/tests/lac/sparse_matrix_Tmmult_02.cc @@ -85,7 +85,7 @@ int main() { const std::string logname = "output"; - std::ofstream logfile(logname.c_str()); + std::ofstream logfile(logname); deallog.attach(logfile); Testing::srand(3391466); diff --git a/tests/lac/sparse_matrix_iterator.cc b/tests/lac/sparse_matrix_iterator.cc index 5ad22c633f..2120b52325 100644 --- a/tests/lac/sparse_matrix_iterator.cc +++ b/tests/lac/sparse_matrix_iterator.cc @@ -22,7 +22,7 @@ int main() { const std::string logname = "output"; - std::ofstream logfile(logname.c_str()); + std::ofstream logfile(logname); deallog.attach(logfile); SparsityPattern pattern(4, 5, 2); diff --git a/tests/lac/sparse_matrix_mmult_01.cc b/tests/lac/sparse_matrix_mmult_01.cc index 9a26261a96..13079df684 100644 --- a/tests/lac/sparse_matrix_mmult_01.cc +++ b/tests/lac/sparse_matrix_mmult_01.cc @@ -80,7 +80,7 @@ int main() { const std::string logname = "output"; - std::ofstream logfile(logname.c_str()); + std::ofstream logfile(logname); deallog.attach(logfile); Testing::srand(3391466); diff --git a/tests/lac/sparse_matrix_mmult_02.cc b/tests/lac/sparse_matrix_mmult_02.cc index b354f16696..d0df8feef5 100644 --- a/tests/lac/sparse_matrix_mmult_02.cc +++ b/tests/lac/sparse_matrix_mmult_02.cc @@ -85,7 +85,7 @@ int main() { const std::string logname = "output"; - std::ofstream logfile(logname.c_str()); + std::ofstream logfile(logname); deallog.attach(logfile); Testing::srand(3391466); diff --git a/tests/matrix_free/dof_info_01.cc b/tests/matrix_free/dof_info_01.cc index 2e9581fa9d..47156c372b 100644 --- a/tests/matrix_free/dof_info_01.cc +++ b/tests/matrix_free/dof_info_01.cc @@ -153,7 +153,7 @@ test(const bool adaptive_ref = true) dealii::Utilities::int_to_string(this_mpi_core); const std::string filename = base_filename + ".gp"; - std::ofstream f(filename.c_str()); + std::ofstream f(filename); f << "set terminal png size 400,410 enhanced font \"Helvetica,8\"" << std::endl diff --git a/tests/matrix_free/dof_info_02.cc b/tests/matrix_free/dof_info_02.cc index 5cf1e1739a..2ea4edc520 100644 --- a/tests/matrix_free/dof_info_02.cc +++ b/tests/matrix_free/dof_info_02.cc @@ -155,7 +155,7 @@ test(const bool adaptive_ref = true) dealii::Utilities::int_to_string(this_mpi_core); const std::string filename = base_filename + ".gp"; - std::ofstream f(filename.c_str()); + std::ofstream f(filename); f << "set terminal png size 400,410 enhanced font \"Helvetica,8\"" << std::endl diff --git a/tests/matrix_free/interpolate_to_mg.cc b/tests/matrix_free/interpolate_to_mg.cc index aa60ed9879..f2226fb70c 100644 --- a/tests/matrix_free/interpolate_to_mg.cc +++ b/tests/matrix_free/interpolate_to_mg.cc @@ -163,7 +163,7 @@ test(const unsigned int n_glob_ref = 2, const unsigned int n_ref = 0) data_out.build_patches(); const std::string filename = "output_" + Utilities::int_to_string(myid) + ".vtu"; - std::ofstream output(filename.c_str()); + std::ofstream output(filename); data_out.write_vtu(output); const std::string mg_mesh = "mg_mesh"; diff --git a/tests/metis/metis_05.cc b/tests/metis/metis_05.cc index 8465dfd269..8865449d5f 100644 --- a/tests/metis/metis_05.cc +++ b/tests/metis/metis_05.cc @@ -113,7 +113,7 @@ test(const bool with_weighting, const bool write_to_vtk = false) std::stringstream filename; filename << "grid_" << dim << "d.with_weighting_" << with_weighting << ".vtk"; - std::ofstream outfile(filename.str().c_str()); + std::ofstream outfile(filename.str()); data_out.write_vtk(outfile); } } diff --git a/tests/mpi/codim_01.cc b/tests/mpi/codim_01.cc index a30b962daa..bc88b2a41e 100644 --- a/tests/mpi/codim_01.cc +++ b/tests/mpi/codim_01.cc @@ -104,7 +104,7 @@ test(std::ostream & /*out*/) name[1] += tr.locally_owned_subdomain(); { - std::ofstream file(name.c_str()); + std::ofstream file(name); data_out.build_patches(); data_out.write_vtu(file); } diff --git a/tests/mpi/communicate_moved_vertices_03.cc b/tests/mpi/communicate_moved_vertices_03.cc index 03e2cb6134..18263be934 100644 --- a/tests/mpi/communicate_moved_vertices_03.cc +++ b/tests/mpi/communicate_moved_vertices_03.cc @@ -95,7 +95,7 @@ test() /*std::string filename("grid"+Utilities::int_to_string(Utilities::MPI::this_mpi_process(MPI_COMM_WORLD),2)+".vtu"); - std::ofstream out(filename.c_str()); + std::ofstream out(filename); GridOut grid_out; grid_out.write_vtu(triangulation, out);*/ deallog << Utilities::int_to_string(dim, 1) << "D OK" << std::endl; diff --git a/tests/mpi/data_out_hdf5_02.cc b/tests/mpi/data_out_hdf5_02.cc index 61def44c80..f94ae20aa6 100644 --- a/tests/mpi/data_out_hdf5_02.cc +++ b/tests/mpi/data_out_hdf5_02.cc @@ -77,7 +77,7 @@ check() data_filter.get_data_set_dim(i)); } - std::ofstream xdmf_file((output_basename + ".xdmf").c_str()); + std::ofstream xdmf_file(output_basename + ".xdmf"); xdmf_file << "\n"; xdmf_file << "\n"; @@ -105,7 +105,7 @@ check() if (0 == Utilities::MPI::this_mpi_process(MPI_COMM_WORLD)) { cat_file((output_basename + ".xdmf").c_str()); - std::ifstream f((output_basename + ".h5").c_str()); + std::ifstream f(output_basename + ".h5"); AssertThrow(f.good(), ExcIO()); } diff --git a/tests/mpi/fe_tools_extrapolate_common.h b/tests/mpi/fe_tools_extrapolate_common.h index ed0b3eca11..7af7359dc8 100644 --- a/tests/mpi/fe_tools_extrapolate_common.h +++ b/tests/mpi/fe_tools_extrapolate_common.h @@ -124,7 +124,7 @@ output_vector(const VectorType & v, (output_name + "." + Utilities::int_to_string(Utilities::MPI::this_mpi_process(MPI_COMM_WORLD), 1)); - std::ofstream output((filename + ".vtu").c_str()); + std::ofstream output(filename + ".vtu"); data_out.write_vtu(output); } diff --git a/tests/mpi/interpolate_to_different_mesh_01.cc b/tests/mpi/interpolate_to_different_mesh_01.cc index 14ab76e876..4bb7abb077 100644 --- a/tests/mpi/interpolate_to_different_mesh_01.cc +++ b/tests/mpi/interpolate_to_different_mesh_01.cc @@ -87,7 +87,7 @@ output(DoFHandler & dh, filename << filename_ << Utilities::int_to_string(loop, 2) << '.' << Utilities::int_to_string(myid, 2) << ".vtu"; - std::ofstream output(filename.str().c_str()); + std::ofstream output(filename.str()); data_out.write_vtu(output); if (myid) { @@ -99,7 +99,7 @@ output(DoFHandler & dh, "." + Utilities::int_to_string(i, 2) + ".vtu"); const std::string pvtu_filename = (filename_ + Utilities::int_to_string(loop, 2) + ".pvtu"); - std::ofstream pvtu_output(pvtu_filename.c_str()); + std::ofstream pvtu_output(pvtu_filename); data_out.write_pvtu_record(pvtu_output, filenames); } } diff --git a/tests/mpi/mg_01.cc b/tests/mpi/mg_01.cc index 74ec6c7d53..18198f36c6 100644 --- a/tests/mpi/mg_01.cc +++ b/tests/mpi/mg_01.cc @@ -45,7 +45,7 @@ output(parallel::distributed::Triangulation &tr) const std::string filename = ("mesh." + Utilities::int_to_string(tr.locally_owned_subdomain(), 4) + ".fig"); - std::ofstream stream(filename.c_str()); + std::ofstream stream(filename); GridOutFlags::XFig flags; flags.color_by = GridOutFlags::XFig::level_subdomain_id; diff --git a/tests/mpi/mg_05.cc b/tests/mpi/mg_05.cc index 8c5247a0a4..3e24516cff 100644 --- a/tests/mpi/mg_05.cc +++ b/tests/mpi/mg_05.cc @@ -58,7 +58,7 @@ output(parallel::distributed::Triangulation &tr) const std::string filename = ("mesh." + Utilities::int_to_string(tr.locally_owned_subdomain(), 4) + ".svg"); - std::ofstream stream(filename.c_str()); + std::ofstream stream(filename); /* GridOutFlags::XFig flags; flags.color_by = GridOutFlags::XFig::level_subdomain_id; diff --git a/tests/mpi/mg_06.cc b/tests/mpi/mg_06.cc index 8ba227f22b..a057992d3a 100644 --- a/tests/mpi/mg_06.cc +++ b/tests/mpi/mg_06.cc @@ -62,7 +62,7 @@ output(parallel::distributed::Triangulation &tr) const std::string filename = ("mg_06/mesh." + Utilities::int_to_string(tr.locally_owned_subdomain(), 4) + ".svg"); - std::ofstream stream(filename.c_str()); + std::ofstream stream(filename); /* GridOutFlags::XFig flags; flags.color_by = GridOutFlags::XFig::level_subdomain_id; diff --git a/tests/mpi/muelu_periodicity.cc b/tests/mpi/muelu_periodicity.cc index 7a6b65d088..e230334417 100644 --- a/tests/mpi/muelu_periodicity.cc +++ b/tests/mpi/muelu_periodicity.cc @@ -685,7 +685,7 @@ namespace Step22 << Utilities::int_to_string(triangulation.locally_owned_subdomain(), 2) << ".vtu"; - std::ofstream output(filename.str().c_str()); + std::ofstream output(filename.str()); data_out.write_vtu(output); if (Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) == 0) @@ -700,7 +700,7 @@ namespace Step22 const std::string pvtu_filename = ("solution-" + Utilities::int_to_string(refinement_cycle, 2) + ".pvtu"); - std::ofstream pvtu_output(pvtu_filename.c_str()); + std::ofstream pvtu_output(pvtu_filename); data_out.write_pvtu_record(pvtu_output, filenames); } } diff --git a/tests/mpi/no_flux_constraints_02.cc b/tests/mpi/no_flux_constraints_02.cc index 8186d701b1..bb51670c3d 100644 --- a/tests/mpi/no_flux_constraints_02.cc +++ b/tests/mpi/no_flux_constraints_02.cc @@ -130,7 +130,7 @@ test() { // write the constraintmatrix to a file on each cpu std::string fname = base + "cm_" + Utilities::int_to_string(myid) + ".dot"; - std::ofstream file(fname.c_str()); + std::ofstream file(fname); constraints.print(file); } MPI_Barrier(MPI_COMM_WORLD); @@ -143,7 +143,7 @@ test() (std::string("cat ") + base + "cm_?.dot|sort -n|uniq >" + base + "cm") .c_str()); { - std::ifstream file((base + "cm").c_str()); + std::ifstream file(base + "cm"); std::stringstream ss; ss << file.rdbuf(); std::string str = ss.str(); diff --git a/tests/mpi/no_flux_constraints_03.cc b/tests/mpi/no_flux_constraints_03.cc index 1868f1a3bb..199c48d9c8 100644 --- a/tests/mpi/no_flux_constraints_03.cc +++ b/tests/mpi/no_flux_constraints_03.cc @@ -103,7 +103,7 @@ test() { // write the constraintmatrix to a file on each cpu std::string fname = base + "cm_" + Utilities::int_to_string(myid) + ".dot"; - std::ofstream file(fname.c_str()); + std::ofstream file(fname); constraints.print(file); } MPI_Barrier(MPI_COMM_WORLD); @@ -116,7 +116,7 @@ test() "cm_*.dot | sort -n | uniq > " + base + "cm") .c_str()); { - std::ifstream file((base + "cm").c_str()); + std::ifstream file(base + "cm"); std::stringstream ss; ss << file.rdbuf(); std::string str = ss.str(); diff --git a/tests/mpi/p4est_2d_constraintmatrix_04.cc b/tests/mpi/p4est_2d_constraintmatrix_04.cc index 66943440cf..e6f26faaa7 100644 --- a/tests/mpi/p4est_2d_constraintmatrix_04.cc +++ b/tests/mpi/p4est_2d_constraintmatrix_04.cc @@ -283,7 +283,7 @@ test() const std::string filename = ("solution." + Utilities::int_to_string(tr.locally_owned_subdomain(), 4) + ".d2"); - std::ofstream output(filename.c_str()); + std::ofstream output(filename); data_out.write_deal_II_intermediate(output); tr.reset_manifold(0); diff --git a/tests/mpi/p4est_3d_constraintmatrix_03.cc b/tests/mpi/p4est_3d_constraintmatrix_03.cc index 8f1d67e90b..ad352dc419 100644 --- a/tests/mpi/p4est_3d_constraintmatrix_03.cc +++ b/tests/mpi/p4est_3d_constraintmatrix_03.cc @@ -283,7 +283,7 @@ test() const std::string filename = ("solution." + Utilities::int_to_string(tr.locally_owned_subdomain(), 4) + ".vtu"); - std::ofstream output(filename.c_str()); + std::ofstream output(filename); data_out.write_vtu(output); tr.reset_manifold(0); diff --git a/tests/mpi/periodicity_01.cc b/tests/mpi/periodicity_01.cc index 30f90c3be8..47e0ae9261 100644 --- a/tests/mpi/periodicity_01.cc +++ b/tests/mpi/periodicity_01.cc @@ -488,7 +488,7 @@ namespace Step40 const std::string filename = ("solution-" + Utilities::int_to_string(cycle, 2) + "." + Utilities::int_to_string(triangulation.locally_owned_subdomain(), 4)); - std::ofstream output((filename + ".vtu").c_str()); + std::ofstream output(filename + ".vtu"); data_out.write_vtu(output); if (Utilities::MPI::this_mpi_process(mpi_communicator) == 0) @@ -500,7 +500,7 @@ namespace Step40 filenames.push_back("solution-" + Utilities::int_to_string(cycle, 2) + "." + Utilities::int_to_string(i, 4) + ".vtu"); - std::ofstream pvtu_output((filename + ".pvtu").c_str()); + std::ofstream pvtu_output(filename + ".pvtu"); data_out.write_pvtu_record(pvtu_output, filenames); } } diff --git a/tests/mpi/periodicity_02.cc b/tests/mpi/periodicity_02.cc index 370d8c0a95..6dd9bbeb04 100644 --- a/tests/mpi/periodicity_02.cc +++ b/tests/mpi/periodicity_02.cc @@ -703,7 +703,7 @@ namespace Step22 << Utilities::int_to_string(triangulation.locally_owned_subdomain(), 2) << ".vtu"; - std::ofstream output(filename.str().c_str()); + std::ofstream output(filename.str()); data_out.write_vtu(output); if (Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) == 0) @@ -718,7 +718,7 @@ namespace Step22 const std::string pvtu_filename = ("solution-" + Utilities::int_to_string(refinement_cycle, 2) + ".pvtu"); - std::ofstream pvtu_output(pvtu_filename.c_str()); + std::ofstream pvtu_output(pvtu_filename); data_out.write_pvtu_record(pvtu_output, filenames); } } diff --git a/tests/mpi/periodicity_03.cc b/tests/mpi/periodicity_03.cc index 314132dfec..7f7226e2e3 100644 --- a/tests/mpi/periodicity_03.cc +++ b/tests/mpi/periodicity_03.cc @@ -786,7 +786,7 @@ namespace Step22 << Utilities::int_to_string(triangulation.locally_owned_subdomain(), 2) << ".vtu"; - std::ofstream output(filename.str().c_str()); + std::ofstream output(filename.str()); data_out.write_vtu(output); if (Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) == 0) @@ -801,7 +801,7 @@ namespace Step22 const std::string pvtu_filename = ("solution-" + Utilities::int_to_string(refinement_cycle, 2) + ".pvtu"); - std::ofstream pvtu_output(pvtu_filename.c_str()); + std::ofstream pvtu_output(pvtu_filename); data_out.write_pvtu_record(pvtu_output, filenames); } } diff --git a/tests/mpi/step-37.cc b/tests/mpi/step-37.cc index 5309203dd3..e1989a87f4 100644 --- a/tests/mpi/step-37.cc +++ b/tests/mpi/step-37.cc @@ -479,7 +479,7 @@ namespace Step37 std::string pvtu_filename = "solution-" + Utilities::to_string(cycle) + ".pvtu"; - std::ofstream pvtu_output(pvtu_filename.c_str()); + std::ofstream pvtu_output(pvtu_filename); data_out.write_pvtu_record(pvtu_output, filenames); } @@ -495,7 +495,7 @@ namespace Step37 "grid" + dealii::Utilities::int_to_string(dim) + "_" + dealii::Utilities::int_to_string(cycle); const std::string filename = base_filename + ".gp"; - std::ofstream f(filename.c_str()); + std::ofstream f(filename); f << "set terminal png size 400,410 enhanced font \"Helvetica,8\"" << std::endl diff --git a/tests/multigrid/step-16-02.cc b/tests/multigrid/step-16-02.cc index 1c261864d9..5288d72801 100644 --- a/tests/multigrid/step-16-02.cc +++ b/tests/multigrid/step-16-02.cc @@ -560,7 +560,7 @@ LaplaceProblem::output_results(const unsigned int cycle) const std::ostringstream filename; filename << "solution-" << cycle << ".vtk"; - std::ofstream output(filename.str().c_str()); + std::ofstream output(filename.str()); data_out.write_vtk(output); } diff --git a/tests/multigrid/step-16-07.cc b/tests/multigrid/step-16-07.cc index a88ef577ff..b6d623a06c 100644 --- a/tests/multigrid/step-16-07.cc +++ b/tests/multigrid/step-16-07.cc @@ -539,7 +539,7 @@ LaplaceProblem::output_results(const unsigned int cycle) const std::ostringstream filename; filename << "solution-" << cycle << ".vtk"; - // std::ofstream output (filename.str().c_str()); + // std::ofstream output (filename.str()); // data_out.write_vtk (output); } diff --git a/tests/multigrid/step-16-08.cc b/tests/multigrid/step-16-08.cc index d444a66432..2afe8876fd 100644 --- a/tests/multigrid/step-16-08.cc +++ b/tests/multigrid/step-16-08.cc @@ -547,7 +547,7 @@ LaplaceProblem::output_results(const unsigned int cycle) const std::ostringstream filename; filename << "solution-" << cycle << ".vtk"; - // std::ofstream output (filename.str().c_str()); + // std::ofstream output (filename.str()); // data_out.write_vtk (output); } diff --git a/tests/multigrid/step-16-bdry1.cc b/tests/multigrid/step-16-bdry1.cc index bf5c8e9938..44cab6f837 100644 --- a/tests/multigrid/step-16-bdry1.cc +++ b/tests/multigrid/step-16-bdry1.cc @@ -579,7 +579,7 @@ LaplaceProblem::output_results(const unsigned int cycle) const std::ostringstream filename; filename << "solution-" << cycle << ".vtk"; - std::ofstream output(filename.str().c_str()); + std::ofstream output(filename.str()); data_out.write_vtk(output); } diff --git a/tests/multigrid/step-16.cc b/tests/multigrid/step-16.cc index 543cc22dcd..0541441572 100644 --- a/tests/multigrid/step-16.cc +++ b/tests/multigrid/step-16.cc @@ -540,7 +540,7 @@ LaplaceProblem::output_results(const unsigned int cycle) const std::ostringstream filename; filename << "solution-" << cycle << ".vtk"; - // std::ofstream output (filename.str().c_str()); + // std::ofstream output (filename.str()); // data_out.write_vtk (output); } diff --git a/tests/multigrid/step-39-02.cc b/tests/multigrid/step-39-02.cc index 2679e83ded..914ccd85f0 100644 --- a/tests/multigrid/step-39-02.cc +++ b/tests/multigrid/step-39-02.cc @@ -737,7 +737,7 @@ namespace Step39 filename += ".gnuplot"; deallog << "Writing solution to <" << filename << ">..." << std::endl << std::endl; - std::ofstream gnuplot_output(filename.c_str()); + std::ofstream gnuplot_output(filename); DataOut data_out; data_out.attach_dof_handler(dof_handler); diff --git a/tests/multigrid/step-39-02a.cc b/tests/multigrid/step-39-02a.cc index 4f650b1a64..95810f3bc2 100644 --- a/tests/multigrid/step-39-02a.cc +++ b/tests/multigrid/step-39-02a.cc @@ -744,7 +744,7 @@ namespace Step39 filename += ".gnuplot"; deallog << "Writing solution to <" << filename << ">..." << std::endl << std::endl; - std::ofstream gnuplot_output(filename.c_str()); + std::ofstream gnuplot_output(filename); DataOut data_out; data_out.attach_dof_handler(dof_handler); diff --git a/tests/multigrid/step-39-03.cc b/tests/multigrid/step-39-03.cc index 6f242fc345..462667e7a5 100644 --- a/tests/multigrid/step-39-03.cc +++ b/tests/multigrid/step-39-03.cc @@ -743,7 +743,7 @@ namespace Step39 filename += ".gnuplot"; deallog << "Writing solution to <" << filename << ">..." << std::endl << std::endl; - std::ofstream gnuplot_output(filename.c_str()); + std::ofstream gnuplot_output(filename); DataOut data_out; data_out.attach_dof_handler(dof_handler); diff --git a/tests/multigrid/step-39.cc b/tests/multigrid/step-39.cc index e9ae4679e9..eceed9f6a2 100644 --- a/tests/multigrid/step-39.cc +++ b/tests/multigrid/step-39.cc @@ -725,7 +725,7 @@ namespace Step39 filename += ".gnuplot"; deallog << "Writing solution to <" << filename << ">..." << std::endl << std::endl; - std::ofstream gnuplot_output(filename.c_str()); + std::ofstream gnuplot_output(filename); DataOut data_out; data_out.attach_dof_handler(dof_handler); diff --git a/tests/multigrid/transfer_04.cc b/tests/multigrid/transfer_04.cc index 7ad15818c0..402f8a1966 100644 --- a/tests/multigrid/transfer_04.cc +++ b/tests/multigrid/transfer_04.cc @@ -116,7 +116,7 @@ check_fe(FiniteElement &fe) const std::string filename = ("solution." + Utilities::int_to_string(tr.locally_owned_subdomain(), 4) + ".vtu"); - std::ofstream output(filename.c_str()); + std::ofstream output(filename); data_out.write_vtu(output); } diff --git a/tests/multigrid/transfer_04a.cc b/tests/multigrid/transfer_04a.cc index 02728f133f..108d47f6bd 100644 --- a/tests/multigrid/transfer_04a.cc +++ b/tests/multigrid/transfer_04a.cc @@ -115,7 +115,7 @@ check_fe(FiniteElement &fe) const std::string filename = ("solution." + Utilities::int_to_string(tr.locally_owned_subdomain(), 4) + ".vtu"); - std::ofstream output(filename.c_str()); + std::ofstream output(filename); data_out.write_vtu(output); } diff --git a/tests/multigrid/transfer_04b.cc b/tests/multigrid/transfer_04b.cc index ff4e3e9e03..119ac686e8 100644 --- a/tests/multigrid/transfer_04b.cc +++ b/tests/multigrid/transfer_04b.cc @@ -115,7 +115,7 @@ check_fe(FiniteElement &fe) const std::string filename = ("solution." + Utilities::int_to_string(tr.locally_owned_subdomain(), 4) + ".vtu"); - std::ofstream output(filename.c_str()); + std::ofstream output(filename); data_out.write_vtu(output); } diff --git a/tests/multigrid/transfer_system_adaptive_09.cc b/tests/multigrid/transfer_system_adaptive_09.cc index b11350920b..df0c6db9e4 100644 --- a/tests/multigrid/transfer_system_adaptive_09.cc +++ b/tests/multigrid/transfer_system_adaptive_09.cc @@ -91,7 +91,7 @@ check(const FiniteElement &fe, const unsigned int selected_block) std::ostringstream out_filename; out_filename << "gitter.eps"; - // std::ofstream grid_output (out_filename.str().c_str()); + // std::ofstream grid_output (out_filename.str()); // GridOut grid_out; // grid_out.write_eps (tr, grid_output); diff --git a/tests/numerics/error_estimator_02.cc b/tests/numerics/error_estimator_02.cc index 13b40c5f01..766bad2223 100644 --- a/tests/numerics/error_estimator_02.cc +++ b/tests/numerics/error_estimator_02.cc @@ -250,7 +250,7 @@ output(const std::string name, data_out.add_data_vector(error, std::string("error")); data_out.build_patches(); - std::ofstream output(name.c_str()); + std::ofstream output(name); data_out.write_vtu(output); } diff --git a/tests/numerics/error_estimator_02_complex.cc b/tests/numerics/error_estimator_02_complex.cc index 980df3601c..6038041289 100644 --- a/tests/numerics/error_estimator_02_complex.cc +++ b/tests/numerics/error_estimator_02_complex.cc @@ -195,7 +195,7 @@ output(const std::string name, data_out.add_data_vector(error, std::string("error")); data_out.build_patches(); - std::ofstream output(name.c_str()); + std::ofstream output(name); data_out.write_vtu(output); } diff --git a/tests/numerics/no_flux_12.cc b/tests/numerics/no_flux_12.cc index c23ce514fe..aa5db1ab50 100644 --- a/tests/numerics/no_flux_12.cc +++ b/tests/numerics/no_flux_12.cc @@ -87,7 +87,7 @@ run() tria.reset_manifold(0); /* std::string filename = "Mesh.eps"; - std::ofstream output (filename.c_str()); + std::ofstream output (filename); GridOut grid_out; grid_out.write_eps (tria, output); */ diff --git a/tests/numerics/point_value_history_01.cc b/tests/numerics/point_value_history_01.cc index 39a6aeec75..d507c1245a 100644 --- a/tests/numerics/point_value_history_01.cc +++ b/tests/numerics/point_value_history_01.cc @@ -249,7 +249,7 @@ TestPointValueHistory::run() { deallog << "Copying output file " << filenames[i] << std::endl; - std::ifstream in(filenames[i].c_str()); + std::ifstream in(filenames[i]); AssertThrow(in, ExcIO()); std::string s; diff --git a/tests/numerics/point_value_history_02.cc b/tests/numerics/point_value_history_02.cc index 8d3095b49b..df0c791d69 100644 --- a/tests/numerics/point_value_history_02.cc +++ b/tests/numerics/point_value_history_02.cc @@ -389,7 +389,7 @@ TestPointValueHistory::run() { deallog << "Copying output file " << filenames[i] << std::endl; - std::ifstream in(filenames[i].c_str()); + std::ifstream in(filenames[i]); AssertThrow(in, ExcIO()); std::string s; @@ -430,7 +430,7 @@ TestPointValueHistory::output_results(unsigned int step, std::ostringstream filename; filename << "solution-" << Utilities::int_to_string(step, 2) << ".gpl"; - std::ofstream output(filename.str().c_str()); + std::ofstream output(filename.str()); data_out.write_gnuplot(output); } diff --git a/tests/numerics/point_value_history_03.cc b/tests/numerics/point_value_history_03.cc index 69283f11de..599996774d 100644 --- a/tests/numerics/point_value_history_03.cc +++ b/tests/numerics/point_value_history_03.cc @@ -348,7 +348,7 @@ TestPointValueHistory::run() { deallog << "Copying output file " << filenames[i] << std::endl; - std::ifstream in(filenames[i].c_str()); + std::ifstream in(filenames[i]); AssertThrow(in, ExcIO()); std::string s; @@ -378,7 +378,7 @@ TestPointValueHistory::output_results(unsigned int step, std::ostringstream filename; filename << "solution-" << Utilities::int_to_string(step, 2) << ".gpl"; - std::ofstream output(filename.str().c_str()); + std::ofstream output(filename.str()); data_out.write_gnuplot(output); } diff --git a/tests/optimization/step-44.h b/tests/optimization/step-44.h index 92a6758703..fcbc1d6efc 100644 --- a/tests/optimization/step-44.h +++ b/tests/optimization/step-44.h @@ -2235,7 +2235,7 @@ namespace Step44 data_out.build_patches(q_mapping, degree); std::ostringstream filename; filename << "solution-" << dim << "d-" << time.get_timestep() << ".vtk"; - std::ofstream output(filename.str().c_str()); + std::ofstream output(filename.str()); data_out.write_vtk(output); } } // namespace Step44 diff --git a/tests/parameter_handler/parameter_acceptor_05.cc b/tests/parameter_handler/parameter_acceptor_05.cc index f9d1c392dd..f0145191b2 100644 --- a/tests/parameter_handler/parameter_acceptor_05.cc +++ b/tests/parameter_handler/parameter_acceptor_05.cc @@ -71,7 +71,7 @@ main() SOURCE_DIR "/parameter_acceptor_parameters/parameter_acceptor_05.prm", output_name); ParameterAcceptor::prm.log_parameters(deallog); - std::ifstream file(output_name.c_str()); + std::ifstream file(output_name); std::string str; deallog << "reading " << output_name << std::endl; diff --git a/tests/parameter_handler/parameter_acceptor_06.cc b/tests/parameter_handler/parameter_acceptor_06.cc index 1c46852ca0..78a6b190ba 100644 --- a/tests/parameter_handler/parameter_acceptor_06.cc +++ b/tests/parameter_handler/parameter_acceptor_06.cc @@ -71,7 +71,7 @@ main() SOURCE_DIR "/parameter_acceptor_parameters/parameter_acceptor_05.prm", output_name); ParameterAcceptor::prm.log_parameters(deallog); - std::ifstream file(output_name.c_str()); + std::ifstream file(output_name); std::string str; deallog << "reading " << output_name << std::endl; diff --git a/tests/physics/step-18-rotation_matrix.cc b/tests/physics/step-18-rotation_matrix.cc index a55fbca894..8e8b26c2b7 100644 --- a/tests/physics/step-18-rotation_matrix.cc +++ b/tests/physics/step-18-rotation_matrix.cc @@ -548,7 +548,7 @@ namespace Step18 "solution-" + Utilities::int_to_string(timestep_no, 4) + "." + Utilities::int_to_string(this_mpi_process, 3) + ".vtu"; AssertThrow(n_mpi_processes < 1000, ExcNotImplemented()); - std::ofstream output(filename.c_str()); + std::ofstream output(filename); data_out.write_vtu(output); if (this_mpi_process == 0) { @@ -559,12 +559,12 @@ namespace Step18 Utilities::int_to_string(i, 3) + ".vtu"); const std::string visit_filename = ("solution-" + Utilities::int_to_string(timestep_no, 4) + ".visit"); - std::ofstream visit_output(visit_filename.c_str()); + std::ofstream visit_output(visit_filename); DataOutBase::write_visit_record(visit_output, filenames); const std::string pvtu_filename = ("solution-" + Utilities::int_to_string(timestep_no, 4) + ".pvtu"); - std::ofstream pvtu_output(pvtu_filename.c_str()); + std::ofstream pvtu_output(pvtu_filename); data_out.write_pvtu_record(pvtu_output, filenames); static std::vector> times_and_names; times_and_names.push_back( diff --git a/tests/physics/step-18.cc b/tests/physics/step-18.cc index 55f21962ea..1c32432cf1 100644 --- a/tests/physics/step-18.cc +++ b/tests/physics/step-18.cc @@ -564,7 +564,7 @@ namespace Step18 "solution-" + Utilities::int_to_string(timestep_no, 4) + "." + Utilities::int_to_string(this_mpi_process, 3) + ".vtu"; AssertThrow(n_mpi_processes < 1000, ExcNotImplemented()); - std::ofstream output(filename.c_str()); + std::ofstream output(filename); data_out.write_vtu(output); if (this_mpi_process == 0) { @@ -575,12 +575,12 @@ namespace Step18 Utilities::int_to_string(i, 3) + ".vtu"); const std::string visit_filename = ("solution-" + Utilities::int_to_string(timestep_no, 4) + ".visit"); - std::ofstream visit_output(visit_filename.c_str()); + std::ofstream visit_output(visit_filename); DataOutBase::write_visit_record(visit_output, filenames); const std::string pvtu_filename = ("solution-" + Utilities::int_to_string(timestep_no, 4) + ".pvtu"); - std::ofstream pvtu_output(pvtu_filename.c_str()); + std::ofstream pvtu_output(pvtu_filename); data_out.write_pvtu_record(pvtu_output, filenames); static std::vector> times_and_names; times_and_names.push_back( diff --git a/tests/physics/step-44-dgp_monomial.cc b/tests/physics/step-44-dgp_monomial.cc index 8554ff36c5..73313d9a6a 100644 --- a/tests/physics/step-44-dgp_monomial.cc +++ b/tests/physics/step-44-dgp_monomial.cc @@ -2083,7 +2083,7 @@ namespace Step44 data_out.build_patches(q_mapping, degree); std::ostringstream filename; filename << "solution-" << dim << "d-" << time.get_timestep() << ".vtk"; - std::ofstream output(filename.str().c_str()); + std::ofstream output(filename.str()); data_out.write_vtk(output); } } // namespace Step44 diff --git a/tests/physics/step-44-standard_tensors-material_push_forward.cc b/tests/physics/step-44-standard_tensors-material_push_forward.cc index 0b89710bd2..9fe9a7875a 100644 --- a/tests/physics/step-44-standard_tensors-material_push_forward.cc +++ b/tests/physics/step-44-standard_tensors-material_push_forward.cc @@ -2269,7 +2269,7 @@ namespace Step44 data_out.build_patches(q_mapping, degree); std::ostringstream filename; filename << "solution-" << dim << "d-" << time.get_timestep() << ".vtk"; - std::ofstream output(filename.str().c_str()); + std::ofstream output(filename.str()); data_out.write_vtk(output); } } // namespace Step44 diff --git a/tests/physics/step-44-standard_tensors-spatial.cc b/tests/physics/step-44-standard_tensors-spatial.cc index 3f81437fee..477ab91d99 100644 --- a/tests/physics/step-44-standard_tensors-spatial.cc +++ b/tests/physics/step-44-standard_tensors-spatial.cc @@ -2069,7 +2069,7 @@ namespace Step44 data_out.build_patches(q_mapping, degree); std::ostringstream filename; filename << "solution-" << dim << "d-" << time.get_timestep() << ".vtk"; - std::ofstream output(filename.str().c_str()); + std::ofstream output(filename.str()); data_out.write_vtk(output); } } // namespace Step44 diff --git a/tests/physics/step-44.cc b/tests/physics/step-44.cc index e99dce27dc..6678628f7a 100644 --- a/tests/physics/step-44.cc +++ b/tests/physics/step-44.cc @@ -2084,7 +2084,7 @@ namespace Step44 data_out.build_patches(q_mapping, degree); std::ostringstream filename; filename << "solution-" << dim << "d-" << time.get_timestep() << ".vtk"; - std::ofstream output(filename.str().c_str()); + std::ofstream output(filename.str()); data_out.write_vtk(output); } } // namespace Step44 diff --git a/tests/quick_tests/lapack.cc b/tests/quick_tests/lapack.cc index cd2dc6e288..b8b87f6959 100644 --- a/tests/quick_tests/lapack.cc +++ b/tests/quick_tests/lapack.cc @@ -96,7 +96,7 @@ int main() { const std::string logname = "output"; - std::ofstream logfile(logname.c_str()); + std::ofstream logfile(logname); logfile.precision(3); deallog.attach(logfile); diff --git a/tests/sharedtria/tria_01.cc b/tests/sharedtria/tria_01.cc index d469018607..a5b36dcdd8 100644 --- a/tests/sharedtria/tria_01.cc +++ b/tests/sharedtria/tria_01.cc @@ -48,7 +48,7 @@ write_mesh(const parallel::shared::Triangulation &tria, const std::string filename = (filename_ + Utilities::int_to_string(tria.locally_owned_subdomain(), 4)); { - std::ofstream output((filename + ".vtu").c_str()); + std::ofstream output(filename + ".vtu"); data_out.write_vtu(output); } } diff --git a/tests/sharedtria/tria_02.cc b/tests/sharedtria/tria_02.cc index f13e687b12..878a067d1b 100644 --- a/tests/sharedtria/tria_02.cc +++ b/tests/sharedtria/tria_02.cc @@ -51,7 +51,7 @@ write_mesh(const parallel::shared::Triangulation &tria, const std::string filename = (filename_ + Utilities::int_to_string(tria.locally_owned_subdomain(), 4)); { - std::ofstream output((filename + ".vtu").c_str()); + std::ofstream output(filename + ".vtu"); data_out.write_vtu(output); } } diff --git a/tests/simplex/data_out_write_hdf5_01.cc b/tests/simplex/data_out_write_hdf5_01.cc index f513ea6d7c..1ad023ebd2 100644 --- a/tests/simplex/data_out_write_hdf5_01.cc +++ b/tests/simplex/data_out_write_hdf5_01.cc @@ -106,10 +106,10 @@ test(const FiniteElement &fe, const unsigned int n_components) // Sadly hdf5 is binary and we can not use hd5dump because it might // not be in the path. At least we can make sure that both the xdmf and // the h5 file are created. - std::ifstream h5((output_basename + ".h5").c_str()); + std::ifstream h5(output_basename + ".h5"); AssertThrow(h5.good(), ExcIO()); - std::ifstream xdmf((output_basename + ".xdmf").c_str()); + std::ifstream xdmf(output_basename + ".xdmf"); AssertThrow(h5.good(), ExcIO()); deallog << "Files " << output_basename + ".h5" diff --git a/tests/simplex/data_out_write_hdf5_02.cc b/tests/simplex/data_out_write_hdf5_02.cc index 8bcc16475f..c16bc4edb0 100644 --- a/tests/simplex/data_out_write_hdf5_02.cc +++ b/tests/simplex/data_out_write_hdf5_02.cc @@ -129,10 +129,10 @@ test(const FiniteElement &fe, const unsigned int n_components) // files are created. if (Utilities::MPI::this_mpi_process(comm) == 0) { - std::ifstream h5((output_basename + ".h5").c_str()); + std::ifstream h5(output_basename + ".h5"); AssertThrow(h5.good(), ExcIO()); - std::ifstream xdmf((output_basename + ".xdmf").c_str()); + std::ifstream xdmf(output_basename + ".xdmf"); AssertThrow(h5.good(), ExcIO()); deallog << "Files " << output_basename + ".h5" diff --git a/tests/simplex/poisson_02.cc b/tests/simplex/poisson_02.cc index f8f3b77832..c97e0e090f 100644 --- a/tests/simplex/poisson_02.cc +++ b/tests/simplex/poisson_02.cc @@ -522,7 +522,7 @@ DGHeat::output_results(unsigned int it) const deallog << " Writing solution to <" << fname << '>' << std::endl; - std::ofstream output(fname.c_str()); + std::ofstream output(fname); if (false) { diff --git a/tests/symengine/sd_common_tests/step-44-sd-quadrature_level.h b/tests/symengine/sd_common_tests/step-44-sd-quadrature_level.h index df86d60d61..d53d5c1af9 100644 --- a/tests/symengine/sd_common_tests/step-44-sd-quadrature_level.h +++ b/tests/symengine/sd_common_tests/step-44-sd-quadrature_level.h @@ -2034,7 +2034,7 @@ namespace Step44 data_out.build_patches(q_mapping, degree); std::ostringstream filename; filename << "solution-" << dim << "d-" << time.get_timestep() << ".vtk"; - std::ofstream output(filename.str().c_str()); + std::ofstream output(filename.str()); data_out.write_vtk(output); } } // namespace Step44 diff --git a/tests/trilinos/solver_control_06.cc b/tests/trilinos/solver_control_06.cc index d406393f8b..1ed7def214 100644 --- a/tests/trilinos/solver_control_06.cc +++ b/tests/trilinos/solver_control_06.cc @@ -467,7 +467,7 @@ Test_Solver_Output::output(unsigned int cycle) const std::string filename = ("solution-" + Utilities::int_to_string(cycle, 2) + "." + Utilities::int_to_string(triangulation.locally_owned_subdomain(), 4)); - std::ofstream output((filename + ".vtu").c_str()); + std::ofstream output(filename + ".vtu"); data_out.write_vtu(output); if (Utilities::MPI::this_mpi_process(mpi_comm) == 0)