#include #include #include int main() { char fn[FILENAME_MAX]; FILE *fin, *fout; double (*pos)[3], (*forces)[3]; double rij[3], d, d2, d3, ene, cut2=1000.0; unsigned i, j, k, nbodies=DIM; sprintf(fn, "positions.xyz.%u", nbodies); fin = fopen(fn, "r"); if (fin == NULL) { perror(fn); exit(-1); } pos = calloc(nbodies, sizeof(*pos)); forces = calloc(nbodies, sizeof(*forces)); if (pos == NULL || forces == NULL) { fprintf(stderr, "Not enough memory!\n"); exit(-2); } for(i=0; i