Dear all,
I’m doing a MD with two types of atoms, and I want to implement energy minimization for atom B with every timestep move of atom A. I don’t know how to achieve this, can you give me some suggestions?
Thanks,
Zhou
That’s a bizarre setup, but here you go:
group ga type 1
group gb type 2
variable i steps 1e4
label hybrid
# Run a MD only on atoms A
fix 1 gb setforce 0.0 0.0 0.0
run 10 post no
# Run a minimization only on atoms B
unfix 1
fix 2 ga setforce 0.0 0.0 0.0
minimize 0.01 0.001 100 1000
unfix 2
next i
jump SELF hybrid
It makes no sense in terms of physics and it is impossible to do with LAMMPS.
The main problem is conceptually. With minimization, you don’t have a time line, that is the step size can be different for every atom and an atom’s velocity has no impact on it, while with MD there is a progress in time coupled to the progress of atoms based on their velocities.
So you can either alternate between minimization steps and MD steps as shown by @hothello or you have to do simulated annealing instead of energy minimization where you remove energy from a group of atoms by applying friction.
At any rate, you will have some heavy explaining to do why such a setup is meaningful and the results from it of value.
1 Like