Can timestep be set as a variable?

Dear everyone,

Can I define a variable and use it as the argument of the timestep command? That is does LAMMPS supports something like ' timestep ${v}'?

In my case, after the fix dt/reset command, I want to use timesteps which increase linearly from a small value to the default value. I am not very sure whether a sudden increase of timestep would lead to the unexpected results.

Thanks in advance!

Regards,

Liu

Dear everyone,

Can I define a variable and use it as the argument of the timestep
command? That is does LAMMPS supports something like ’ timestep ${v}’?

this will expand the current value of $v at the time the timestep command is issued and will use exactly that value. the timestep command has no provisions for adjusting the length of timestep dynamically during a run.

In my case, after the fix dt/reset command, I want to use timesteps
which increase linearly from a small value to the default value. I am
not very sure whether a sudden increase of timestep would lead to the
unexpected results.

i am confused. fix dt/reset will modify the value of timestep used internally based on heuristics to use as large a value as possible.
if you want some different behavior, you will have to write your own fix that implements the functionality you are looking for.

or you have to do a loop where you do short runs and change the timestep regularly in between, as the expansion of ${v} will change, if it is defined to be a function of the timestep for example.

axel.