-
Notifications
You must be signed in to change notification settings - Fork 1
/
defs.h
111 lines (91 loc) · 3.81 KB
/
defs.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
#ifndef __DEFS__
#define __DEFS__
#include "pup.h"
#define HYDROGEN_MASS (1.67 * pow( 10.0,-24)) // in g
#define VDW_A (1.1328 * pow(10.0, -133)) // in (g m^2/s^2) m^12
#define VDW_B (2.23224 * pow(10.0, -76)) // in (g m^2/s^2) m^6
#define ENERGY_VAR (1.0 * pow(10.0,-5))
//average of next two should be what you want as your atom density
//this should comply with the PERDIM parameter; for KAWAY 1 1 1, the maximum number
//of particles can be 10*10*10 = 1000 - 10 comes from PERDIM parameter, which is
//currently set to be 10, using a GAP of 3; as KWAYness increases, the maximum
//number of particles decreases - for 2 1 1, it is 500, for 2 2 1 it is 250; you
//can set them to have lower values but not higher; alternatively a host of
//paramters including PTP_CUT_OFF, PERDIM, GAP can be set to suitable values to
#define PARTICLES_PER_CELL_START 100
#define PARTICLES_PER_CELL_END 250
#define DEFAULT_DELTA 1 // in femtoseconds
#define DEFAULT_FIRST_LDB 20
#define DEFAULT_LDB_PERIOD 20
#define DEFAULT_FT_PERIOD 100000
#define KAWAY_X 2
#define KAWAY_Y 2
#define KAWAY_Z 1
#define NBRS_X (2*KAWAY_X+1)
#define NBRS_Y (2*KAWAY_Y+1)
#define NBRS_Z (2*KAWAY_Z+1)
#define NUM_NEIGHBORS (NBRS_X * NBRS_Y * NBRS_Z)
#define CELLARRAY_DIM_X 3
#define CELLARRAY_DIM_Y 3
#define CELLARRAY_DIM_Z 3
#define PTP_CUT_OFF 26 // cut off for atom to atom interactions
#define CELL_MARGIN 4 // constant diff between cutoff and cell size
#define CELL_SIZE_X (PTP_CUT_OFF + CELL_MARGIN)/KAWAY_X
#define CELL_SIZE_Y (PTP_CUT_OFF + CELL_MARGIN)/KAWAY_Y
#define CELL_SIZE_Z (PTP_CUT_OFF + CELL_MARGIN)/KAWAY_Z
//variables to control initial uniform placement of atoms;
//atoms should not be too close at startup for a stable system;
//PERDIM * GAP should be less than (PTPCUTOFF+CELL_MARGIN);
//max particles per cell should not be greater thatn PERDIM^3 for 1 AWAY;
#define PERDIM 10
#define GAP 3
#define CELL_ORIGIN_X 0
#define CELL_ORIGIN_Y 0
#define CELL_ORIGIN_Z 0
#define MIGRATE_STEPCOUNT 20
#define DEFAULT_FINALSTEPCOUNT 1001
#define MAX_VELOCITY .1 //in A/fs
#define WRAP_X(a) (((a) + cellArrayDimX) % cellArrayDimX)
#define WRAP_Y(a) (((a) + cellArrayDimY) % cellArrayDimY)
#define WRAP_Z(a) (((a) + cellArrayDimZ) % cellArrayDimZ)
struct vec3 {
double x, y, z;
vec3(double d = 0.0) : x(d), y(d), z(d) { }
vec3(double x_, double y_, double z_) : x(x_), y(y_), z(z_) { }
inline vec3& operator += (const vec3 &rhs) {
x += rhs.x; y += rhs.y; z += rhs.z;
return *this;
}
inline vec3& operator -= (const vec3 &rhs) {
return *this += (rhs * -1.0);
}
inline vec3 operator* (const double d) const {
return vec3(d*x, d*y, d*z);
}
inline vec3 operator- (const vec3& rhs) const {
return vec3(x - rhs.x, y - rhs.y, z - rhs.z);
}
};
inline double dot(const vec3& a, const vec3& b) {
return a.x*b.x + a.y*b.y + a.z*b.z;
}
PUPbytes(vec3)
//class for keeping track of the properties for a particle
struct Particle {
double mass;
// Position, acceleration, velocity
vec3 pos,acc,vel;
};
PUPbytes(Particle);
#include "leanmd.decl.h"
extern /* readonly */ CProxy_Main mainProxy;
extern /* readonly */ CProxy_Cell cellArray;
extern /* readonly */ CProxy_Compute computeArray;
extern /* readonly */ int cellArrayDimX;
extern /* readonly */ int cellArrayDimY;
extern /* readonly */ int cellArrayDimZ;
extern /* readonly */ int finalStepCount;
extern /* readonly */ int checkptStrategy;
extern /* readonly */ std::string logs;
extern /* readonly */ int bFactor;
#endif