Dear all,
I am going to use compute centroid/stress/atom command. I found this in the manual: Note that the stress for each atom is due to its interaction with all other atoms in the simulation, not just with other atoms in the group. So, I wonder how can I just calculate the interaction with other atoms in the group.
My pair style is hybrid (lj/cut and lj/charmm/coul/charmm). There are three kinds of atoms in the box:
1-1 lj/charmm/coul/charmm
1-2 lj/cut
1-3 lj/cut
2-2 lj/cut
3-3 lj/cut
Then: group A type 2 3.
I only want to calculate the pair interaction of group A (2-2 and 3-3). I have read some source codes of compute_centroid_stress_atom. And I found:
if (force->pair->centroidstressflag == CENTROID_AVAIL) {
double **cvatom = force->pair->cvatom;
for (i = 0; i < npair; i++)
for (j = 0; j < 9; j++)
stress[i][j] += cvatom[i][j];
}
Then, I only found the zero accumulators of cvatom in pair.cpp:
if (cvflag_atom && alloc) {
n = atom->nlocal;
if (force->newton) n += atom->nghost;
for (i = 0; i < n; i++) {
cvatom[i][0] = 0.0;
…
but I don’t find how cvatom is calculated. Also, I don’t find cvatom in pair_lj_cut.cpp.
This is my first attempt to modify the LAMMPS code. I would like to know where and how to achieve this feature. As the final goal is to calculate the auto autocorrelation function of heat flux, I think it’s the best way to change the source code, rather than pre- or post-processing
Thank you so much for your help.
[
2296804970
签名由 网易邮箱大师 定制