fix addforce with minimization

Dear lammps users:

I am doing a static tension simulation, and want to achieve unloading by using the “fix addforce” command. At every step I unload 1% of the total stress—v_groupallzz and then perform energy minimization via the “minimie” command. The manual said that the energy keyword is required and -Grad(E)=F, so I define the energy as v_energy2.

Part of my code is:

Compute dis all displace/atom

Variable atomdis equal c_dis[3]

Variable j loop 100

Variable forcedown equal “v_groupallzz-v_groupallzz/100*v_j”

Variable energy2 equal -v_atomdis*v_forcedown

Fix relax mobile addforce 0 0 v_forcedown energy v_energy2

Minimize 1e-25 1e-25 5000 10000

Next j

Jump ……

LAMMPS reports the following error message:

Error: variable for fix addforce is invalid style.

I have two questions:

  1. In every step the added force is a constant vector, and do I need to define the energy keyword? Since the manual said the energy keyword is not allowed If the added force is constant.

  2. V_atomdis is an atom style variable, so v_energy2 is an atom style variable. Then why the variable for fix addforce is invalid style?

Any help will really be appreciated. Thank you in advance.

Ann

Dear lammps users:

I am doing a static tension simulation, and want to achieve unloading by using the “fix addforce” command. At every step I unload 1% of the total stress—v_groupallzz and then perform energy minimization via the “minimie” command. The manual said that the energy keyword is required and -Grad(E)=F, so I define the energy as v_energy2.

Part of my code is:

Compute dis all displace/atom

Variable atomdis equal c_dis[3]

Variable j loop 100

Variable forcedown equal “v_groupallzz-v_groupallzz/100*v_j”

Variable energy2 equal -v_atomdis*v_forcedown

Fix relax mobile addforce 0 0 v_forcedown energy v_energy2

Minimize 1e-25 1e-25 5000 10000

Next j

Jump ……

LAMMPS reports the following error message:

Error: variable for fix addforce is invalid style.

I have two questions:

  1. In every step the added force is a constant vector, and do I need to define the energy keyword? Since the manual said the energy keyword is not allowed If the added force is constant.

  2. V_atomdis is an atom style variable, so v_energy2 is an atom style variable. Then why the variable for fix addforce is invalid style?

incorrect. energy2 is defined as an equal style variable. hence the error message.

axel.