--- trunk/dp/dp.c 2003/07/09 22:14:06 586 +++ trunk/dp/dp.c 2003/07/10 15:42:41 587 @@ -1,7 +1,7 @@ #include #include #include -#define max_sites 10000 +#define max_sites 15000 #define MYSEED 8973247 int nsites, xlat, ylat; @@ -15,94 +15,102 @@ int main() int main() { - void getmag(); - double eneri(double xi, double yi, double zi, double phii, double thetai, int i, int jb); - double toterg(); - void adjust(); - void mcmove(); - void store(FILE *outFile); + void getmag(); + double eneri(double xi, double yi, double zi, double phii, double thetai, int i, int jb); + double toterg(); + void adjust(); + void mcmove(); + void store(FILE *outFile); + + double twopi, nnd, myran, kb; + double ent; + int icycl, ncycl, imove, nmoves, nsamp; + int nx, ny, which, i, j; + + FILE *outFile; + outFile=fopen("dp_file","w"); + + srand48(MYSEED); + + // These two parameters set the size of the system: - double twopi, nnd, myran, kb; - double ent; - int icycl, ncycl, imove, nmoves, nsamp; - int nx, ny, which, i, j; - - FILE *outFile; - outFile=fopen("dp_file","w"); - - srand48(MYSEED); - - domsizex = 231.0; - domsizey = 231.0; - nnd = 7.0; - strength = 10.0; - ncycl = 100000000; - nmoves = 100; - nsamp = 200; - twopi = 2.0 * M_PI; - dtheta = 0.1; - kb = 0.0019872198; - beta = 1.0 / (kb * 300.0); - z0 = 0.0; - deltaz = 0.1; - deltaphi = 0.1; - kz = kb; - ktheta = kb; - theta0 = M_PI / 2.0; + nnd = 7.0; + ny = 100; - nx = (int) (2.5 * domsizey / sqrt(3.0) / nnd) + 1; - ny = (int) (domsizex / nnd) + 1; + // we want the domains to be roughly square: - which = 0; - xlat = 0; - for(i=1;i<=nx;i++) - { - if ((i*sqrt(3.0)*nnd)(domsizex/2.0)) dx = dx - domsizex*copysign(1.0,dx)*(double)(int)(fabs(dx /domsizex)+0.5); - dy = y[j]-yi; - if(fabs(dy)>(domsizey/2.0)) dy = dy - domsizey*copysign(1.0,dy)*(double)(int)(fabs(dy /domsizey)+0.5); - dz = z[j]-zi; - - r2 = dx*dx+dy*dy+dz*dz; - r = sqrt(r2); - if(r(domsizex/2.0)) dx = dx - domsizex*copysign(1.0,dx)*(double)(int)(fabs(dx /domsizex)+0.5); + dy = y[j]-yi; + if(fabs(dy)>(domsizey/2.0)) dy = dy - domsizey*copysign(1.0,dy)*(double)(int)(fabs(dy /domsizey)+0.5); + dz = z[j]-zi; + + r2 = dx*dx+dy*dy+dz*dz; + r = sqrt(r2); + if(r