22#ifndef EXADG_POISSON_OVERSET_GRIDS_SOLVER_H_
23#define EXADG_POISSON_OVERSET_GRIDS_SOLVER_H_
26#include <exadg/poisson/overset_grids/driver.h>
27#include <exadg/poisson/overset_grids/user_interface/declare_get_application.h>
28#include <exadg/utilities/general_parameters.h>
33create_input_file(std::string
const & input_file)
35 dealii::ParameterHandler prm;
38 general.add_parameters(prm);
42 unsigned int const Dim = 2;
43 typedef double Number;
44 Poisson::OversetGrids::get_application_overset_grids<Dim, 1, Number>(input_file, MPI_COMM_WORLD)
45 ->add_parameters(prm);
47 prm.print_parameters(input_file,
48 dealii::ParameterHandler::Short |
49 dealii::ParameterHandler::KeepDeclarationOrder);
52template<
int dim,
int n_components,
typename Number>
54run(std::string
const & input_file, MPI_Comm
const & mpi_comm)
56 std::shared_ptr<Poisson::OversetGrids::ApplicationBase<dim, n_components, Number>> application =
57 Poisson::OversetGrids::get_application_overset_grids<dim, n_components, Number>(input_file,
60 std::shared_ptr<Poisson::OversetGrids::Driver<dim, n_components, Number>> driver =
61 std::make_shared<Poisson::OversetGrids::Driver<dim, n_components, Number>>(mpi_comm,
71main(
int argc,
char ** argv)
73 dealii::Utilities::MPI::MPI_InitFinalize mpi(argc, argv, 1);
75 MPI_Comm mpi_comm(MPI_COMM_WORLD);
77 std::string input_file;
81 if(dealii::Utilities::MPI::this_mpi_process(mpi_comm) == 0)
83 std::cout <<
"To run the program, use: ./solver input_file" << std::endl
84 <<
"To setup the input file, use: ./solver input_file --help" << std::endl;
91 input_file = std::string(argv[1]);
93 if(argc == 3 and std::string(argv[2]) ==
"--help")
95 if(dealii::Utilities::MPI::this_mpi_process(mpi_comm) == 0)
96 ExaDG::create_input_file(input_file);
104 if(general.dim == 2 and general.precision ==
"float")
105 ExaDG::run<2, 1, float>(input_file, mpi_comm);
106 else if(general.dim == 2 and general.precision ==
"double")
107 ExaDG::run<2, 1, double>(input_file, mpi_comm);
108 else if(general.dim == 3 and general.precision ==
"float")
109 ExaDG::run<3, 1, float>(input_file, mpi_comm);
110 else if(general.dim == 3 and general.precision ==
"double")
111 ExaDG::run<3, 1, double>(input_file, mpi_comm);
114 dealii::ExcMessage(
"Only dim = 2|3 and precision = float|double implemented."));
Definition general_parameters.h:34