-
-int link_cell_init(t_moldyn *moldyn,u8 vol) {
-
- t_linkcell *lc;
- int i;
-
- lc=&(moldyn->lc);
-
- /* partitioning the md cell */
- lc->nx=moldyn->dim.x/moldyn->cutoff;
- lc->x=moldyn->dim.x/lc->nx;
- lc->ny=moldyn->dim.y/moldyn->cutoff;
- lc->y=moldyn->dim.y/lc->ny;
- lc->nz=moldyn->dim.z/moldyn->cutoff;
- lc->z=moldyn->dim.z/lc->nz;
-
- lc->cells=lc->nx*lc->ny*lc->nz;
- lc->subcell=malloc(lc->cells*sizeof(t_list));
-
- if(lc->cells<27)
- printf("[moldyn] FATAL: less then 27 subcells!\n");
-
- if(vol) {
- printf("[moldyn] initializing 'dynamic' linked cells (%d)\n",
- lc->cells);
- printf(" x: %d x %f A\n",lc->nx,lc->x);
- printf(" y: %d x %f A\n",lc->ny,lc->y);
- printf(" z: %d x %f A\n",lc->nz,lc->z);
- }
-
- for(i=0;i<lc->cells;i++)
- list_init_f(&(lc->subcell[i]));
-
- link_cell_update(moldyn);
-
- return 0;
-}
-
-int link_cell_update(t_moldyn *moldyn) {
-
- int count,i,j,k;
- int nx,ny;
- t_atom *atom;
- t_linkcell *lc;
- double x,y,z;
-
- atom=moldyn->atom;
- lc=&(moldyn->lc);
-
- nx=lc->nx;
- ny=lc->ny;
-
- x=moldyn->dim.x/2;
- y=moldyn->dim.y/2;
- z=moldyn->dim.z/2;
-
- for(i=0;i<lc->cells;i++)