forked from chaos-polymtl/lethe
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdem_2d.cc
58 lines (51 loc) · 1.52 KB
/
dem_2d.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#include "core/dem_properties.h"
#include "dem/dem.h"
using namespace dealii;
int
main(int argc, char *argv[])
{
try
{
Utilities::MPI::MPI_InitFinalize mpi_initialization(
argc, argv, numbers::invalid_unsigned_int);
if (argc != 2)
{
std::cout << "Usage:" << argv[0] << " input_file" << std::endl;
std::exit(1);
}
ParameterHandler prm;
DEMSolverParameters<2> dem_parameters;
dem_parameters.declare(prm);
// Parsing of the file
prm.parse_input(argv[1]);
dem_parameters.parse(prm);
DEMSolver<2> problem_2d(dem_parameters);
problem_2d.solve();
}
catch (std::exception &exc)
{
std::cerr << std::endl
<< std::endl
<< "----------------------------------------------------"
<< std::endl;
std::cerr << "Exception on processing: " << std::endl
<< exc.what() << std::endl
<< "Aborting!" << std::endl
<< "----------------------------------------------------"
<< std::endl;
return 1;
}
catch (...)
{
std::cerr << std::endl
<< std::endl
<< "----------------------------------------------------"
<< std::endl;
std::cerr << "Unknown exception!" << std::endl
<< "Aborting!" << std::endl
<< "----------------------------------------------------"
<< std::endl;
return 1;
}
return 0;
}