                cudaMemcpyDeviceToHost);
   }
 
-  CUFREE(vars->gpu_rT11);
-  CUFREE(vars->gpu_rT12);
-  CUFREE(vars->gpu_rT13);
-  CUFREE(vars->gpu_rT22);
-  CUFREE(vars->gpu_rT23);
-  CUFREE(vars->gpu_rT33);
+  if(electrostatic) {
+    CUFREE(vars->gpu_rT11);
+    CUFREE(vars->gpu_rT12);
+    CUFREE(vars->gpu_rT13);
+    CUFREE(vars->gpu_rT22);
+    CUFREE(vars->gpu_rT23);
+    CUFREE(vars->gpu_rT33);
+  }
   CUFREE(vars->gpu_vT11);
   CUFREE(vars->gpu_vT12);
   CUFREE(vars->gpu_vT13);

  CUMALLOC((void**) &gpu_particleKind, particleKind.size() * sizeof(int));
  CUMALLOC((void**) &gpu_particleMol, particleMol.size() * sizeof(int));
  CUMALLOC((void**) &gpu_final_value, sizeof(double));
  CUMALLOC((void**) &vars->gpu_rT11, energyVectorLen * sizeof(double));
  CUMALLOC((void**) &vars->gpu_rT12, energyVectorLen * sizeof(double));
  CUMALLOC((void**) &vars->gpu_rT13, energyVectorLen * sizeof(double));
  CUMALLOC((void**) &vars->gpu_rT22, energyVectorLen * sizeof(double));
  CUMALLOC((void**) &vars->gpu_rT23, energyVectorLen * sizeof(double));
  CUMALLOC((void**) &vars->gpu_rT33, energyVectorLen * sizeof(double));
  CUMALLOC((void**) &vars->gpu_vT11, energyVectorLen * sizeof(double));
  CUMALLOC((void**) &vars->gpu_vT12, energyVectorLen * sizeof(double));
  CUMALLOC((void**) &vars->gpu_vT13, energyVectorLen * sizeof(double));

  gpu_LJEn[threadID] = 0.0;
  double cutoff = fmax(gpu_rCut[0], gpu_rCutCoulomb[box]);

  int currentCell = blockIdx.x / NUMBER_OF_NEIGHBOR_CELL;
  int nCellIndex = blockIdx.x;
  int neighborCell = gpu_neighborList[nCellIndex];

