-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathvext.c
51 lines (44 loc) · 1.03 KB
/
vext.c
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
#include "headdefs.h"
// Set up the external potential
void SetVext(){
int loop;
int i,j,k;
real rr;
/*I set here the hard wall potential as a test.
* The hard wall is put at the bottom of the simulation box.*/
//Hard Wall
for(loop=0;loop<VProd(Pts);loop++){
if(loop%Pts.z == 0 ) Vext[loop] = 100.0;
else Vext[loop] = 0.0;
}
/*
// LJ 12-6 Wall
for(k=0;k<Pts.z;k++){
rr = Sqr(k*Delta.z);
for(j=0;j<Pts.y;j++){
for(i=0;i<Pts.x;i++){
if(rr>0.0){
Vext[k+Pts.z*(j+Pts.y*i)] = 8.0 * Atom[0].epslion * (pow(Atom[0].sigma, 12)/pow(rr, 6) - pow(Atom[0].sigma, 6)/pow(rr, 3));
}
else if(rr == 0.0){
Vext[k+Pts.z*(j+Pts.y*i)] = 1000.0;
}
}
}
}
*/
/*
// No Vext
for(loop=0;loop<VProd(Pts);loop++) Vext[loop] = 0.0;
*/
printf("Setting the external potential is done\n");
return;
}
void SetInitialDensity(){
int loop;
for(loop=0;loop<VProd(Pts);loop++){
Density[loop] = 1.0*Atom[0].density;
}
printf("Setting the initial density is done\n");
return;
}