22#ifndef INCLUDE_EXADG_FLUID_STRUCTURE_INTERACTION_SOLVER_H_
23#define INCLUDE_EXADG_FLUID_STRUCTURE_INTERACTION_SOLVER_H_
26#include <deal.II/base/parameter_handler.h>
29#include <exadg/fluid_structure_interaction/driver.h>
30#include <exadg/fluid_structure_interaction/user_interface/declare_get_application.h>
31#include <exadg/utilities/enum_patterns.h>
32#include <exadg/utilities/general_parameters.h>
37create_input_file(std::string
const & input_file)
39 dealii::ParameterHandler prm;
42 general.add_parameters(prm);
45 fsi_data.add_parameters(prm);
49 unsigned int const Dim = 2;
50 typedef double Number;
52 FSI::get_application<Dim, Number>(input_file, MPI_COMM_WORLD)->add_parameters(prm);
54 prm.print_parameters(input_file,
55 dealii::ParameterHandler::Short |
56 dealii::ParameterHandler::KeepDeclarationOrder);
59template<
int dim,
typename Number>
61run(std::string
const & input_file, MPI_Comm
const & mpi_comm,
bool const is_test)
66 std::shared_ptr<FSI::ApplicationBase<dim, Number>> application =
67 FSI::get_application<dim, Number>(input_file, mpi_comm);
69 std::shared_ptr<FSI::Driver<dim, Number>> driver =
70 std::make_shared<FSI::Driver<dim, Number>>(input_file, mpi_comm, application, is_test);
77 driver->print_performance_results(timer.wall_time());
82main(
int argc,
char ** argv)
84 dealii::Utilities::MPI::MPI_InitFinalize mpi(argc, argv, 1);
86 MPI_Comm mpi_comm(MPI_COMM_WORLD);
88 std::string input_file;
92 if(dealii::Utilities::MPI::this_mpi_process(mpi_comm) == 0)
95 std::cout <<
"To run the program, use: ./solver input_file" << std::endl
96 <<
"To setup the input file, use: ./solver input_file --help" << std::endl;
104 input_file = std::string(argv[1]);
106 if(argc == 3 and std::string(argv[2]) ==
"--help")
108 if(dealii::Utilities::MPI::this_mpi_process(mpi_comm) == 0)
109 ExaDG::create_input_file(input_file);
118 if(general.dim == 2 and general.precision ==
"float")
120 ExaDG::run<2, float>(input_file, mpi_comm, general.is_test);
122 else if(general.dim == 2 and general.precision ==
"double")
124 ExaDG::run<2, double>(input_file, mpi_comm, general.is_test);
126 else if(general.dim == 3 and general.precision ==
"float")
128 ExaDG::run<3, float>(input_file, mpi_comm, general.is_test);
130 else if(general.dim == 3 and general.precision ==
"double")
132 ExaDG::run<3, double>(input_file, mpi_comm, general.is_test);
137 dealii::ExcMessage(
"Only dim = 2|3 and precision=float|double implemented."));
Definition parameters.h:47
Definition general_parameters.h:32