puts("-y <value> \t # y lattice sites");
puts("-s <value> \t spin interaction strength");
puts("-r \t run in interactive mode (still in work)");
+ puts("-d <value> \t refresh display rate");
return 1;
}
double delta_e;
int runfree=0;
double max_T;
+ int dr=1;
/* random stuff*/
srand(time(0));
case 'r':
runfree=1;
break;
+ case 'd':
+ dr=atoi(argv[++i]);
+ break;
default:
usage();
return -1;
/* begin at T=0 M=1 situation */
memset(atom,0,max_x*max_y*sizeof(unsigned char));
- max_T=1.3*s;
+ max_T=3.0*s;
for(T=.05;T<max_T;T+=.05)
{
}
}
+ if(i%dr==0)
+ {
sprintf(t_text," temp: %.3f",T);
arg_v[1]=t_text;
sprintf(b_text," beta: %.3f",beta);
sprintf(m_text," magnetization: %.3f",1.0-2.0*M/(max_x*max_y));
arg_v[6]=m_text;
d2_lattice_draw(&d2_l,0,0,6,arg_v);
+ }
}
if(of_fd) dprintf(of_fd,"%f %f\n",T,1.0-2.0*M/(max_x*max_y));
}
}
+ if(i%dr==0)
+ {
sprintf(t_text," temp = %.3f",T);
arg_v[1]=t_text;
sprintf(b_text," beta = %.3f",beta);
sprintf(m_text," magnetization: %.3f",1.0-2.0*M/(max_x*max_y));
arg_v[6]=m_text;
d2_lattice_draw(&d2_l,0,0,6,arg_v);
+ }
}
if(of_fd) dprintf(of_fd,"%f %f\n",T,1.0-2.0*M/(max_x*max_y));