1 #include <deal.II/base/utilities.h> 3 #include <deal.II/base/logstream.h> 4 #include <deal.II/base/parameter_handler.h> 10 #include "testing/tests.h" 11 #include "flow_solver/flow_solver_factory.h" 12 #include "parameters/all_parameters.h" 14 #include "global_counter.hpp" 16 int main (
int argc,
char *argv[])
28 dealii::Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1);
29 const int n_mpi = dealii::Utilities::MPI::n_mpi_processes(MPI_COMM_WORLD);
30 const int mpi_rank = dealii::Utilities::MPI::this_mpi_process(MPI_COMM_WORLD);
31 if (n_mpi==1 || mpi_rank==0) {
32 dealii::deallog.depth_console(99);
34 dealii::deallog.depth_console(0);
37 dealii::ConditionalOStream pcout(std::cout, mpi_rank==0);
38 pcout <<
"Starting program with " << n_mpi <<
" processors..." << std::endl;
39 if ((PHILIP_DIM==1) && !(n_mpi==1)) {
40 std::cout <<
"********************************************************" << std::endl;
41 std::cout <<
"Can't use mpirun -np X, where X>1, for 1D." << std::endl
42 <<
"Currently using " << n_mpi <<
" processors." << std::endl
43 <<
"Aborting..." << std::endl;
44 std::cout <<
"********************************************************" << std::endl;
51 dealii::ParameterHandler parameter_handler;
53 PHiLiP::Parameters::parse_command_line (argc, argv, parameter_handler);
57 pcout <<
"Reading input..." << std::endl;
60 AssertDimension(all_parameters.
dimension, PHILIP_DIM);
63 const int max_dim = PHILIP_DIM;
64 const int max_species = PHILIP_SPECIES;
65 const int max_nstate = PHILIP_DIM+PHILIP_SPECIES+1;
67 if(all_parameters.
run_type == PHiLiP::Parameters::AllParameters::RunType::flow_simulation) {
69 run_error = flow_solver->run();
70 pcout <<
"Flow simulation complete with run error code: " << run_error << std::endl;
72 else if(all_parameters.
run_type == PHiLiP::Parameters::AllParameters::RunType::integration_test) {
74 run_error = test->run_test();
75 pcout <<
"Finished integration test with run error code: " << run_error << std::endl;
78 catch (std::exception &exc)
80 std::cerr << std::endl << std::endl
81 <<
"----------------------------------------------------" 83 <<
"Exception on processing: " << std::endl
84 << exc.what() << std::endl
85 <<
"Aborting!" << std::endl
86 <<
"----------------------------------------------------" 93 std::cerr << std::endl
95 <<
"----------------------------------------------------" 97 <<
"Unknown exception!" << std::endl
98 <<
"Aborting!" << std::endl
99 <<
"----------------------------------------------------" 104 pcout <<
"End of program" << std::endl;
unsigned int number_of_species
Number of species. Note that it has to match the CMake variable NUMBER_OF_SPECIES.
unsigned int dimension
Number of dimensions. Note that it has to match the executable PHiLiP_xD.
Main parameter class that contains the various other sub-parameter classes.
RunType run_type
Selected RunType from the input file.
static std::unique_ptr< FlowSolverBase > create_flow_solver(const Parameters::AllParameters *const parameters_input, const dealii::ParameterHandler ¶meter_handler_input)
Recursive factory that will create FlowSolverBase (i.e. FlowSolver<dim,nspecies,nstate>) ...
void parse_parameters(dealii::ParameterHandler &prm)
Retrieve parameters from dealii::ParameterHandler.
static std::unique_ptr< TestsBase > create_test(const Parameters::AllParameters *const parameters_input, dealii::ParameterHandler ¶meter_handler_input)
Recursive factory that will create TestBase<int dim, int nspecies, int nstate>
static void declare_parameters(dealii::ParameterHandler &prm)
Declare parameters that can be set as inputs and set up the default options.