-
Notifications
You must be signed in to change notification settings - Fork 12
/
examples.cpp
35 lines (31 loc) · 1.1 KB
/
examples.cpp
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
#include "examples.h"
#include "system.h"
#include "particle.h"
#include "Integrators/eulercromer.h"
#include "Integrators/velocityverlet.h"
#include "Potentials/newtoniangravity.h"
#include "Potentials/nopotential.h"
#include "InitialConditions/twobody.h"
#include "InitialConditions/threebody.h"
#include <iostream>
#include <cmath>
void Examples::twoBodyProblem() {
double G = 1.0;
System* twoBodySystem = new System();
twoBodySystem->setIntegrator (new VelocityVerlet(twoBodySystem));
twoBodySystem->setPotential (new NewtonianGravity(G));
twoBodySystem->setInitialCondition (new TwoBody());
twoBodySystem->setFileWriting (true);
twoBodySystem->removeLinearMomentum ();
twoBodySystem->integrate (5000);
}
void Examples::threeBodyProblem() {
/*
* This is where you should set up a three-body problem, using the
* InitialCondition::ThreeBody class as System's InitialCondition.
*
* You should start by considering the two-body case in
* Examples::twoBodyProblem, before continuing with this more complicated
* case.
*/
}