102 std::tuple<int, int, std::string, std::string>
206 const std::string &input_parameter_file,
207 const std::string &output_parameter_file);
217 template <
typename Class>
220 const std::string &input_parameter_file,
221 const std::string &output_parameter_file)
225 input_parameter_file,
226 output_parameter_file) == -1)
234 # define RUN_CODIM_NO_ONE(Class, dim, spacedim, in_file, out_file) \
235 if (dim == 2 && spacedim == 3) \
236 Runner::run<Class<2, 3>>(argv, in_file, out_file);
238 # define RUN_CODIM(Class, dim, spacedim, in_file, out_file) \
239 if (dim == 1 && spacedim == 2) \
240 Runner::run<Class<1, 2>>(argv, in_file, out_file); \
242 RUN_CODIM_NO_ONE(Class, dim, spacedim, in_file, out_file)
244 # define RUN_DIM_NO_ONE(Class, dim, spacedim, in_file, out_file) \
245 if (dim == 2 && spacedim == 2) \
246 Runner::run<Class<2>>(argv, in_file, out_file); \
247 else if (dim == 3 && spacedim == 3) \
248 Runner::run<Class<3>>(argv, in_file, out_file);
250 # define RUN_DIM(Class, dim, spacedim, in_file, out_file) \
251 if (dim == 1 && spacedim == 1) \
252 Runner::run<Class<1>>(argv, in_file, out_file); \
254 RUN_DIM_NO_ONE(Class, dim, spacedim, in_file, out_file)
257 # define STANDARD_CATCH() \
258 catch (std::exception & exc) \
260 std::cerr << std::endl \
262 << "----------------------------------------------------" \
264 std::cerr << "Exception on processing: " << std::endl \
265 << exc.what() << std::endl \
266 << "Aborting!" << std::endl \
267 << "----------------------------------------------------" \
273 std::cerr << std::endl \
275 << "----------------------------------------------------" \
277 std::cerr << "Unknown exception!" << std::endl \
278 << "Aborting!" << std::endl \
279 << "----------------------------------------------------" \
291 #define RUNNER_DIM(Class, argc, argv) \
294 dealii::Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, \
297 const auto [dim, spacedim, in_file, out_file] = \
298 Runner::get_dimensions_and_parameter_files(argv); \
299 RUN_DIM(Class, dim, spacedim, in_file, out_file) \
300 else AssertThrow(false, \
301 dealii::ExcImpossibleInDimSpacedim(dim, spacedim)); \
309 #define RUNNER_DIM_NO_ONE(Class, argc, argv) \
312 dealii::Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, \
315 const auto [dim, spacedim, in_file, out_file] = \
316 Runner::get_dimensions_and_parameter_files(argv); \
317 RUN_DIM_NO_ONE(Class, dim, spacedim, in_file, out_file) \
318 else AssertThrow(false, \
319 dealii::ExcImpossibleInDimSpacedim(dim, spacedim)); \
328 #define RUNNER(Class, argc, argv) \
331 dealii::Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, \
334 const auto [dim, spacedim, in_file, out_file] = \
335 Runner::get_dimensions_and_parameter_files(argv); \
336 RUN_DIM(Class, dim, spacedim, in_file, out_file) \
342 out_file) else AssertThrow(false, \
343 dealii::ExcImpossibleInDimSpacedim( \
354 #define RUNNER_NO_ONE(Class, argc, argv) \
357 dealii::Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, \
360 const auto [dim, spacedim, in_file, out_file] = \
361 Runner::get_dimensions_and_parameter_files(argv); \
362 RUN_DIM_NO_ONE(Class, dim, spacedim, in_file, out_file) \
363 else RUN_CODIM_NO_ONE( \
368 out_file) else AssertThrow(false, \
369 dealii::ExcImpossibleInDimSpacedim( \
381 #define RUNNER_CODIM(Class, argc, argv) \
384 dealii::Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, \
387 const auto [dim, spacedim, in_file, out_file] = \
388 Runner::get_dimensions_and_parameter_files(argv); \
389 RUN_DIM_NO_ONE(Class, dim, spacedim, in_file, out_file) \
395 out_file) else AssertThrow(false, \
396 dealii::ExcImpossibleInDimSpacedim( \
Gather some functions and classes typically used in the main() of the FSI-suite applications.
int setup_parameters_from_cli(char **argv, const std::string &input_parameter_file, const std::string &output_parameter_file)
Setup the ParameterAcceptor::prm according to the parameters specified in the parameter file,...
void run(char **argv, const std::string &input_parameter_file, const std::string &output_parameter_file)
Setup parameters from the command line, and call the Class::run() method.
std::tuple< int, int, std::string, std::string > get_dimensions_and_parameter_files(char **argv)
Parse from the command line the parameter file names (both input and output) and the running dimensio...