-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
68 lines (53 loc) · 1.96 KB
/
Copy pathmain.cpp
File metadata and controls
68 lines (53 loc) · 1.96 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
65
66
#include <iostream>
#include <string>
#include "langevin.h"
#include "fileio.h"
int main(
int argc,
char **argv
)
{
/* Instructions */
char header[] = {"\n\n\
----------------------------------------------------------------------\n\
SPBD -- Single Protein Brownian Dynamics\n\
\n\
Kherim Willems (kherim@kher.im)\n\
\n"};
char usage[] = {"\n\n\
----------------------------------------------------------------------\n\
This program performs a 1D brownian dynamics simulation on a\n\
single particle trapped inside a force profile.\n\
Usage:\n\n\
spdb [options] spdb.in\n\n\
where spdb.in is a formatted input file and [options] are:\n\n\
--output-file=<name> Enables output logging to the path\n\
listed in <name>. Uses flat-file format.\n\
--help Display this help information.\n\
--version Display the current SPDB version.\n\
----------------------------------------------------------------------\n\n"};
//std::cout << header;
//std::cout << usage;
bool debug = false;
std::string conf_file("test/test_conf.txt");
// Create new simulation object
langevin_simulation simulation;
std::cout << "Loading configuration file... ";
loadConfiguration(conf_file, simulation.conf);
if (debug)
{
std::cout << "done.\n";
printConfiguration(simulation.conf);
}
std::cout << "Reserving memory space... ";
unsigned long long output_elements =
int((simulation.conf.steps/simulation.conf.saveFreq)+1);
simulation.out.positionVector.reserve(output_elements);
simulation.out.timeVector.reserve(output_elements);
std::cout << "done.\n";
computeLangevinTrajectory(simulation);
std::cout << "Writing data to disk (" << simulation.conf.trajectoryOutputFile <<")... ";
writeSimulationResultsToFile(simulation);
std::cout << "done.\n";
return 0;
}