-
Notifications
You must be signed in to change notification settings - Fork 0
/
allvars.h
executable file
·70 lines (58 loc) · 1.84 KB
/
allvars.h
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/**************************************************************************************************
MACROS
**************************************************************************************************/
//General Macros
#define NMAX1 100
#define NMAX2 1000
#define MY_FREE(ptr) free(ptr); ptr = NULL;
//Macros for Parameters
#define LBOX 0 //Length of the Simulation
#define NPAR 1 //Number of Particles
#define EPSS 2 //Epsilon softening
#define TMAX 3 //Integration time
#define TSTP 4 //Time step
#define SSTP 5 //Snapshot step
//Macros of Physical constants
#define GC 1 //Cavendish Constant
//Other macros
#define X 0 //X coordinate
#define Y 1 //Y coordinate
#define Z 2 //Z coordinate
/**************************************************************************************************
STRUCTURES
**************************************************************************************************/
struct particle
{
//Mass
double m;
//Position
double r[3];
//Velocity
double v[3];
//Acceleration
double a[3];
//Potential
double ep;
//Type of particle
int typ;
//Interacting particles
int int_typ;
//Printable particle
int print;
};
/**************************************************************************************************
GLOBALS
**************************************************************************************************/
//Parameters
double p[NMAX1];
//Structures
struct particle *part;
/**************************************************************************************************
HEADERS
**************************************************************************************************/
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include "proto.h"