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);
    62         const int max_dim = PHILIP_DIM;
    63         const int max_nstate = 5;
    65         if(all_parameters.
run_type == PHiLiP::Parameters::AllParameters::RunType::flow_simulation) {
    67             run_error = flow_solver->run();
    68             pcout << 
"Flow simulation complete with run error code: " << run_error << std::endl;
    70         else if(all_parameters.
run_type == PHiLiP::Parameters::AllParameters::RunType::integration_test) {
    72             run_error = test->run_test();
    73             pcout << 
"Finished integration test with run error code: " << run_error << std::endl;
    76     catch (std::exception &exc)
    78         std::cerr << std::endl << std::endl
    79                   << 
"----------------------------------------------------"    81                   << 
"Exception on processing: " << std::endl
    82                   << exc.what() << std::endl
    83                   << 
"Aborting!" << std::endl
    84                   << 
"----------------------------------------------------"    91         std::cerr << std::endl
    93                   << 
"----------------------------------------------------"    95                   << 
"Unknown exception!" << std::endl
    96                   << 
"Aborting!" << std::endl
    97                   << 
"----------------------------------------------------"   102     pcout << 
"End of program" << std::endl;
 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 nstate> 
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,nstate>) 
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. 
void parse_parameters(dealii::ParameterHandler &prm)
Retrieve parameters from dealii::ParameterHandler. 
static void declare_parameters(dealii::ParameterHandler &prm)
Declare parameters that can be set as inputs and set up the default options.