forked from jusperino/md_2017
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathobserver.hpp
More file actions
58 lines (49 loc) · 1.07 KB
/
observer.hpp
File metadata and controls
58 lines (49 loc) · 1.07 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
#ifndef _OBSERVER_HPP
#define _OBSERVER_HPP
#include "world.hpp"
#include <iostream>
#include <fstream>
/**
* @brief an observer for the timediscretization
*/
class Observer {
public:
/**
* @brief constructor
*
* opens and creates the files written during observation
*
* @param _W
*/
Observer(World& _W);
/**
* @brief destructor
*
* closes the files written during the obervation
*/
~Observer();
/**
* @brief notify the observer that the world has changed
*/
void notify();
/**
* @brief output statistics like kinetic, potential and total energy
*/
void output_statistics();
/**
* @brief output the coordinates of the particles
*/
void output_coordinates();
protected:
/// The world we are observing
World &W;
/// Statistics filestream
std::ofstream statistics;
/// coordiantes filestream
std::ofstream coordinates;
private:
/// Disabled Constructor
Observer();
};
#endif // _OBSERVER_HPP
// vim:set et sts=4 ts=4 sw=4 ai ci cin: