"ewall[m+1] += fwall; " in the code of lammps

Hello everyone,

I am reading the codes of lammps.
I am confused with line 75 (ewall[m+1] += fwall;) of fix_wall_lj126.cpp.
Anybody knows what does it used for?

Thanks in advance.

Ewall is a length 4 array that stores the energy of
the wall interaction (loc 0) and the force on the
wall (locs 1-3). The line in question is adding
the force on the wall due to one particle to the
appropriate dimension m (1-3).


Hello Steve,

Thanks so much for your kindly reply.

Why stores the force on the wall (locs1-3)? When can we use these
force on the wall (locs1-3)?

When one rescales the temperature of systems, one only uses the information
of all particles in the system, right?



Many fixes store quantities, so that you can access, output them.
See the fix wall doc page and section 4.15 of the manual.


Hi Steve,
thanks so much!