Hello,

I am creating a class based on the fix_wall_region class.

There is something i do not understand in this class.

After calculating the Energy contribution and resulting force of a

wall-atom interaction, the resulting scalar force is multiplied by the

vector separating the wall and the atom. (Lines 235-241 of

fix_wall_region.cpp)

ewall[0] += eng;

fx = fwall * region->contact[m].delx;

fy = fwall * region->contact[m].dely;

fz = fwall * region->contact[m].delz;

f[i][0] += fx;

f[i][1] += fy;

f[i][2] += fz;

Where region->contact[m].delx , y or z are the components of the

shortest vector between the atom and a wall (if I have correctly

understood the region class).

I understand the conversion from a scalar force to a vectorial form of

the force.

However, the scalar expression of the force should be multiplied with a

normed vector and not with a distance.

In the latter case we calculate an energy and not the force itself.

Can someone explain me why the scalar force is multiplied by a distance ?

Thanks in advance.