22#ifndef INCLUDE_EXADG_AERO_ACOUSTIC_SOLVER_H_
23#define INCLUDE_EXADG_AERO_ACOUSTIC_SOLVER_H_
26#include <deal.II/base/parameter_handler.h>
29#include <exadg/aero_acoustic/driver.h>
30#include <exadg/aero_acoustic/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);
46 unsigned int const Dim = 2;
47 using Number = double;
49 auto app = AeroAcoustic::get_application<Dim, Number>(input_file, MPI_COMM_WORLD);
50 app->add_parameters(prm);
52 prm.print_parameters(input_file,
53 dealii::ParameterHandler::Short |
54 dealii::ParameterHandler::KeepDeclarationOrder);
57template<
int dim,
typename Number>
59run(std::string
const & input_file, MPI_Comm
const & mpi_comm,
bool const is_test)
64 auto application = AeroAcoustic::get_application<dim, Number>(input_file, mpi_comm);
66 auto driver = std::make_shared<AeroAcoustic::Driver<dim, Number>>(mpi_comm, application, is_test);
73 driver->print_performance_results(timer.wall_time());
78main(
int argc,
char ** argv)
80 dealii::Utilities::MPI::MPI_InitFinalize mpi(argc, argv, 1);
82 MPI_Comm mpi_comm(MPI_COMM_WORLD);
84 std::string input_file;
88 if(dealii::Utilities::MPI::this_mpi_process(mpi_comm) == 0)
91 std::cout <<
"To run the program, use: ./solver input_file" << std::endl
92 <<
"To setup the input file, use: ./solver input_file --help" << std::endl;
100 input_file = std::string(argv[1]);
102 if(argc == 3 and std::string(argv[2]) ==
"--help")
104 if(dealii::Utilities::MPI::this_mpi_process(mpi_comm) == 0)
105 ExaDG::create_input_file(input_file);
114 if(general.dim == 2 and general.precision ==
"float")
116 ExaDG::run<2, float>(input_file, mpi_comm, general.is_test);
118 else if(general.dim == 2 and general.precision ==
"double")
120 ExaDG::run<2, double>(input_file, mpi_comm, general.is_test);
122 else if(general.dim == 3 and general.precision ==
"float")
124 ExaDG::run<3, float>(input_file, mpi_comm, general.is_test);
126 else if(general.dim == 3 and general.precision ==
"double")
128 ExaDG::run<3, double>(input_file, mpi_comm, general.is_test);
133 dealii::ExcMessage(
"Only dim = 2|3 and precision=float|double implemented."));
Definition general_parameters.h:32