-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathSimulation.h
More file actions
35 lines (31 loc) · 1.21 KB
/
Copy pathSimulation.h
File metadata and controls
35 lines (31 loc) · 1.21 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
#ifndef SIMULATION_H
#define SIMULATION_H
class Simulation {
public:
Chain chain;
std::vector<Wall*> walls;
double time;
double dt;
Simulation();
void initChain(int, double, double = 1.0e5, double = 0.5, double = 2.0e5);
void addTrailofWalls(std::vector<Vector>);
void addSphericalBoundary(double, double, double);
void clearWalls();
void writeWallsToFile(const char *);
void writeChainToFile(const char *);
void saveChainBackup(const char *);
void loadChainBackup(const char *);
void writeChainToFile(int);
void step(int);
private:
double lengthOfVector(Vector);
double distanceOfPoints(Vector, Vector);
Vector relativeVector(Vector, Vector);
double scalarproduct(Vector, Vector);
std::vector<Vector> addSTDVectorVectors( std::vector<Vector>, std::vector<Vector>);
std::vector<Vector> productSTDVectorVectorScalar( std::vector<Vector>, double);
std::vector<Vector> getInternalForces(Chain); // returns std:vector of accelerations; input is chain
std::vector<Vector> getWallForces(Chain, std::vector<Wall*>); // returns std:vector of accelerations; input is chain and walls
std::vector<Vector> getExternalForces(Chain, double); // returns std:vector of accelerations; input is chain and time
};
#endif