forked from stewartboogert/bdsim
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbdsim.cc
More file actions
64 lines (58 loc) · 1.66 KB
/
Copy pathbdsim.cc
File metadata and controls
64 lines (58 loc) · 1.66 KB
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
59
60
61
62
63
64
/*
Beam Delivery Simulation (BDSIM) Copyright (C) Royal Holloway,
University of London 2001 - 2024.
This file is part of BDSIM.
BDSIM is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
by the Free Software Foundation version 3 of the License.
BDSIM is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with BDSIM. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* @file bdsim.cc
*
* \mainpage
* BDSIM © 2001-@CURRENT_YEAR@
* Reference: Computer Physics Communications, 252, 107200 (2020)
* https://doi.org/10.1016/j.cpc.2020.107200
* https://arxiv.org/abs/1808.10745
* Website: https://bdsim-collaboration.github.io/web/
*
* version @BDSIM_VERSION@
*/
#include "BDSIMClass.hh"
#include "BDSException.hh"
#include <iostream>
int main(int argc, char** argv)
{
BDSIM* bds = nullptr;
try
{
bds = new BDSIM(argc, argv);
if (!bds->Initialised())
{
if (bds->InitialisationResult() == 1)
{std::cout << "Intialisation failed" << std::endl; return 1;}
}
else
{bds->BeamOn();}
delete bds;
}
catch (const BDSException& exception)
{
std::cerr << std::endl << exception.what() << std::endl;
delete bds;
exit(1);
}
catch (const std::exception& exception)
{
std::cerr << std::endl << exception.what() << std::endl;
delete bds;
exit(1);
}
return 0;
}