22#ifndef INCLUDE_EXADG_POISSON_OVERSET_GRIDS_SOLVER_H_
23#define INCLUDE_EXADG_POISSON_OVERSET_GRIDS_SOLVER_H_
28#include <exadg/poisson/overset_grids/driver.h>
31#include <exadg/utilities/general_parameters.h>
34#include <exadg/poisson/overset_grids/user_interface/declare_get_application.h>
39create_input_file(std::string
const & input_file)
41 dealii::ParameterHandler prm;
44 general.add_parameters(prm);
48 unsigned int const Dim = 2;
49 typedef double Number;
50 Poisson::OversetGrids::get_application_overset_grids<Dim, 1, Number>(input_file, MPI_COMM_WORLD)
51 ->add_parameters(prm);
53 prm.print_parameters(input_file,
54 dealii::ParameterHandler::Short |
55 dealii::ParameterHandler::KeepDeclarationOrder);
58template<
int dim,
int n_components,
typename Number>
60run(std::string
const & input_file, MPI_Comm
const & mpi_comm)
62 std::shared_ptr<Poisson::OversetGrids::ApplicationBase<dim, n_components, Number>> application =
63 Poisson::OversetGrids::get_application_overset_grids<dim, n_components, Number>(input_file,
66 std::shared_ptr<Poisson::OversetGrids::Driver<dim, n_components, Number>> driver =
67 std::make_shared<Poisson::OversetGrids::Driver<dim, n_components, Number>>(mpi_comm,
77main(
int argc,
char ** argv)
79 dealii::Utilities::MPI::MPI_InitFinalize mpi(argc, argv, 1);
81 MPI_Comm mpi_comm(MPI_COMM_WORLD);
83 std::string input_file;
87 if(dealii::Utilities::MPI::this_mpi_process(mpi_comm) == 0)
89 std::cout <<
"To run the program, use: ./solver input_file" << std::endl
90 <<
"To setup the input file, use: ./solver input_file --help" << std::endl;
97 input_file = std::string(argv[1]);
99 if(argc == 3 and std::string(argv[2]) ==
"--help")
101 if(dealii::Utilities::MPI::this_mpi_process(mpi_comm) == 0)
102 ExaDG::create_input_file(input_file);
110 if(general.dim == 2 and general.precision ==
"float")
111 ExaDG::run<2, 1, float>(input_file, mpi_comm);
112 else if(general.dim == 2 and general.precision ==
"double")
113 ExaDG::run<2, 1, double>(input_file, mpi_comm);
114 else if(general.dim == 3 and general.precision ==
"float")
115 ExaDG::run<3, 1, float>(input_file, mpi_comm);
116 else if(general.dim == 3 and general.precision ==
"double")
117 ExaDG::run<3, 1, double>(input_file, mpi_comm);
120 dealii::ExcMessage(
"Only dim = 2|3 and precision = float|double implemented."));
Definition general_parameters.h:32