22#ifndef INCLUDE_EXADG_POISSON_SOLVER_H_
23#define INCLUDE_EXADG_POISSON_SOLVER_H_
28#include <exadg/poisson/driver.h>
31#include <exadg/grid/grid_data.h>
32#include <exadg/operators/resolution_parameters.h>
33#include <exadg/utilities/general_parameters.h>
36#include <exadg/poisson/user_interface/declare_get_application.h>
41create_input_file(std::string
const & input_file)
43 dealii::ParameterHandler prm;
46 general.add_parameters(prm);
49 spatial.add_parameters(prm);
53 unsigned int const Dim = 2;
54 typedef double Number;
55 Poisson::get_application<Dim, 1, Number>(input_file, MPI_COMM_WORLD)->add_parameters(prm);
57 prm.print_parameters(input_file,
58 dealii::ParameterHandler::Short |
59 dealii::ParameterHandler::KeepDeclarationOrder);
62template<
int dim,
typename Number>
64run(std::vector<SolverResult> & results,
65 std::string
const & input_file,
66 unsigned int const degree,
67 unsigned int const refine_space,
68 MPI_Comm
const & mpi_comm,
74 std::shared_ptr<Poisson::ApplicationBase<dim, 1, Number>> application =
75 Poisson::get_application<dim, 1, Number>(input_file, mpi_comm);
77 application->set_parameters_convergence_study(degree, refine_space);
79 std::shared_ptr<Poisson::Driver<dim, Number>> driver =
80 std::make_shared<Poisson::Driver<dim, Number>>(mpi_comm, application, is_test,
false);
86 SolverResult result = driver->print_performance_results(timer.wall_time());
87 results.push_back(result);
92main(
int argc,
char ** argv)
94 dealii::Utilities::MPI::MPI_InitFinalize mpi(argc, argv, 1);
96 MPI_Comm mpi_comm(MPI_COMM_WORLD);
98 std::string input_file;
102 if(dealii::Utilities::MPI::this_mpi_process(mpi_comm) == 0)
104 std::cout <<
"To run the program, use: ./solver input_file" << std::endl
105 <<
"To setup the input file, use: ./solver input_file --help" << std::endl;
112 input_file = std::string(argv[1]);
114 if(argc == 3 and std::string(argv[2]) ==
"--help")
116 if(dealii::Utilities::MPI::this_mpi_process(mpi_comm) == 0)
117 ExaDG::create_input_file(input_file);
126 std::vector<ExaDG::SolverResult> results;
129 for(
unsigned int degree = spatial.degree_min; degree <= spatial.degree_max; ++degree)
132 for(
unsigned int refine_space = spatial.refine_space_min;
133 refine_space <= spatial.refine_space_max;
136 if(general.dim == 2 and general.precision ==
"float")
138 ExaDG::run<2, float>(results, input_file, degree, refine_space, mpi_comm, general.is_test);
140 else if(general.dim == 2 and general.precision ==
"double")
142 ExaDG::run<2, double>(results, input_file, degree, refine_space, mpi_comm, general.is_test);
144 else if(general.dim == 3 and general.precision ==
"float")
146 ExaDG::run<3, float>(results, input_file, degree, refine_space, mpi_comm, general.is_test);
148 else if(general.dim == 3 and general.precision ==
"double")
150 ExaDG::run<3, double>(results, input_file, degree, refine_space, mpi_comm, general.is_test);
155 dealii::ExcMessage(
"Only dim = 2|3 and precision = float|double implemented."));
160 if(not(general.is_test))
161 print_results(results, mpi_comm);
Definition general_parameters.h:32
Definition print_solver_results.h:238
Definition resolution_parameters.h:32