# Doubth with fix aveforce

Hello,

I have a small doubt with how fix aveforce works. So basically I want to
impose an average force to all the atoms in a sliding wall in a certain
direction so I do:

fix set_pressure_fix_l lower_g aveforce NULL NULL \{required\_wall\_force\} fix set\_pressure\_fix\_u upper\_g aveforce NULL NULL (-v_required_wall_force)

Does the average computed at time t take into account the force added
in time step t-1? Or the average force is only calculated from the
interaction energy of the atoms and then the force is added every
timestep?

I guess the second statement is what is happening but wanted to make
sure.

Regards,

Eduardo

- MSc student at Imperial College London

Hello,

I have a small doubt with how fix aveforce works. So basically I want to
impose an average force to all the atoms in a sliding wall in a certain
direction so I do:

fix set_pressure_fix_l lower_g aveforce NULL NULL \{required\_wall\_force\} fix set\_pressure\_fix\_u upper\_g aveforce NULL NULL (-v_required_wall_force)

Does the average computed at time t take into account the force added
in time step t-1?

No.

Or the average force is only calculated from the
interaction energy of the atoms and then the force is added every
timestep?

not quite sure what you mean by this.

fix aveforce does what it says it does: it averages the
(instantaneous) force in each selected dimension and optionally adds
an additional external term to it.

I guess the second statement is what is happening but wanted to make
sure.

guessing is never a good idea for these kind of issues. if you want to
be certain, set up a (simple) test system and output all relevant
properties with fix aveforce turned off and on and see for yourself.

axel.