2 * ising.c - visualization of ising spins in an N x N lattice
6 * author: hackbard@hackdaworld.dyndns.org
20 int main(int argc, char **argv)
23 int max_x,x_c,max_y,y_c;
33 /* we will parse argv later ... */
37 d2_lattice_init(&argc,argv,&d2_l,max_x,max_y);
39 atom=(unsigned char *)(malloc(max_x*max_y*sizeof(unsigned char)));
43 /* begin at T=0 M=1 situation */
44 memset(atom,0,max_x*max_y*sizeof(unsigned char));
48 beta=1.0/T; /* k_B = 1 */
49 /* do N*N itterations, we will need more */
50 for(i=0;i<max_x*max_y;i++)
53 for(x_c=0;x_c<max_x-1;x_c++)
55 for(y_c=0;y_c<max_y-1;y_c++)
58 // delta_e+=(-1*(int)(atom
64 d2_lattice_draw(&d2_l,0,0,0,NULL);