Dear community,
I have found a miscalculated stress tensor when running LAMMPS (version: 17 Apr 2024) using KOKKOS. After running an Isotropic compression of an FCC granular sample (see Ref. 1 for more information about the input file and system details), I obtained unphysical differences for the diagonal stress components and high values of the off-diagonal ones. The diagonal component must be almost equal, and the off-diagonal ones must be nearly zero.
By delving into the file pair_gran_hooke_history_kokkos.cpp, I identified that the problem is related to the force input in procedures ev_tally_xyz_atom and ev_tally_xyz in PairGranHookeHistoryKokkos::operator(). Both receive the accumulated forces fx_i, fy_i, and fz_i as input, following the code notation; therefore, there is an overaccumulation of stresses. I have addressed the issue using the pair forces fx, fy, and fz, and the outcome results are the expected ones. This is because the stress for every pair force must be computed before the summation is correctly done. This bug does not affect the force calculations but the resulting stress and barostat simulations. Can anyone look at it to see if what I am commenting is right?
Cheers,
Dariel Hernandez
1 - Salomon, J., O’Sullivan, C., & Patino-Ramirez, F. (2024). On data benchmarking and verification of discrete granular simulations. Data in Brief , 53 , 110252.
Data: Validation and Benchmark Dataset for Discrete Element Method Simulations