Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- n = 1;
- while(n <= Nc){
- fscanf(voisins,"%d%d%f%f%f%f",&i,&j,&r[0],&r[1],&r[2],&d);
- V = 0.0;E = 0.0;F = 0.0;
- for(p = 0;p < 3;p++){
- V += (D/pow(d,3.0))*(spin[3*i-3+p]-w[p])*spin[3*j-3+p];
- E += (spin[3*i-3+p]-w[p])*r[p];
- F += spin[3*j-3+p]*r[p];
- }
- G = -3*(D/pow(d,5.0))*E*F;
- dU += (V+G);
- n++;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement