- /* derivative with respect to x direction */
- scale_dim(moldyn,scale,TRUE,0,0);
- scale_atoms(moldyn,scale,TRUE,0,0);
- dv=0.00000000000001*moldyn->dim.x*moldyn->dim.y*moldyn->dim.z;
- link_cell_shutdown(moldyn);
- link_cell_init(moldyn,QUIET);
- potential_force_calc(moldyn);
- tp->x=(moldyn->energy-u)/dv;
- p=tp->x*tp->x;
-
- /* restore atomic configuration + dim */
- memcpy(moldyn->atom,store,moldyn->count*sizeof(t_atom));
- moldyn->dim=dim;
-
- /* derivative with respect to y direction */
- scale_dim(moldyn,scale,0,TRUE,0);
- scale_atoms(moldyn,scale,0,TRUE,0);
- dv=0.00000000000001*moldyn->dim.y*moldyn->dim.x*moldyn->dim.z;
+ /* scale up dimension and atom positions */
+ scale_dim(moldyn,SCALE_UP,scale,TRUE,TRUE,TRUE);
+ scale_atoms(moldyn,SCALE_UP,scale,TRUE,TRUE,TRUE);