]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Read input file name from the command line.
authorWolfgang Bangerth <bangerth@colostate.edu>
Tue, 9 Jul 2024 21:14:26 +0000 (15:14 -0600)
committerWolfgang Bangerth <bangerth@colostate.edu>
Wed, 17 Jul 2024 17:58:35 +0000 (11:58 -0600)
examples/step-86/step-86.cc

index 4dd5daac1ac390ea7678f71ece3839200f10eae2..cc54612330877641631ceaffcbd521c80d0f1d8d 100644 (file)
@@ -1115,8 +1115,10 @@ int main(int argc, char **argv)
 
       Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1);
       HeatEquation<2>                  heat_equation_solver(MPI_COMM_WORLD);
-      ParameterAcceptor::initialize("heat_equation.prm",
-                                    "heat_equation_used.prm");
+
+      const std::string input_filename =
+        (argc > 1 ? argv[1] : "heat_equation.prm");
+      ParameterAcceptor::initialize(input_filename, "heat_equation_used.prm");
       heat_equation_solver.run();
     }
   catch (std::exception &exc)

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.