forked from Jim-Hawkins/gravity-simulator
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsim_soa.hpp
More file actions
37 lines (32 loc) · 929 Bytes
/
sim_soa.hpp
File metadata and controls
37 lines (32 loc) · 929 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
//
// Created by mariwogr on 10/10/21.
//
#ifndef GRAVITY_SIMULATOR_SIM_SOA_HPP
#define GRAVITY_SIMULATOR_SIM_SOA_HPP
struct parameters {
int num_objects;
int num_iterations;
int random_seed;
double size_enclosure;
double time_step;
};
struct set {
double * x;
double * y;
double * z;
double * vx;
double * vy;
double * vz;
double * m;
bool * active;
};
double accel_calc(double m, double F);
int check_bounce(set objects, int obj, double size);
int check_collision(set objects, int i, int j);
int collision_objects(set objects,int i, int j);
int gravitational_force(int num_objects, set objects, double time_step);
void gravitational_force_calc(set objects, int i, int j, double *force);
int parser(int argc, char* argv[]);
int print_error_args(int argc, char* argv[]);
int write_config(int id, parameters system_data, set params);
#endif //GRAVITY_SIMULATOR_SIM_SOA_HPP