-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCluster.h
More file actions
executable file
·50 lines (33 loc) · 824 Bytes
/
Copy pathCluster.h
File metadata and controls
executable file
·50 lines (33 loc) · 824 Bytes
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
#include <iostream>
using namespace std;
#include <vector>
#include <cmath>
#include <numeric>
#include <cstdlib>
#include "Star.h"
#ifndef __Cluster_h
#define __Cluster_h
class Cluster : public Star {
public:
vector<Star> s;
mpreal eps2;
mpreal time, dt, dt_last;
Cluster() : Star() {}
Cluster(vector<double> data);
Cluster(vector<mpreal> data);
vector<double> get_data_double();
vector<mpreal> get_data();
void calcAcceleration_dt();
void calcAcceleration();
void updatePositions(mpreal dt);
void updateVelocities(mpreal dt);
void step(mpreal &dt);
vector<mpreal> energies();
friend ostream & operator << (ostream &so, Cluster &cl) {
for (vector<Star>::iterator si = cl.s.begin(); si != cl.s.end(); ++si) {
so << *si;
}
return so;
}
};
#endif