-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommon.h
More file actions
27 lines (23 loc) · 653 Bytes
/
Copy pathcommon.h
File metadata and controls
27 lines (23 loc) · 653 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
#ifndef __COMMON_H__
#define __COMMON_H__
// Program Constants
#define nsteps 1000
#define savefreq 10
#define density 0.0005
#define mass 0.01
#define cutoff 0.01
#define min_r (cutoff / 100)
#define dt 0.0005
// Particle Data Structure
typedef struct particle_t {
double x; // Position X
double y; // Position Y
double vx; // Velocity X
double vy; // Velocity Y
double ax; // Acceleration X
double ay; // Acceleration Y
} particle_t;
// Simulation routine
void init_simulation(particle_t* parts, int num_parts, double size);
void simulate_one_step(particle_t* parts, int num_parts, double size);
#endif