Applies an external potential to a group of atoms to mimic confinement in a harmonic well.
where \(\mathbf{k}=(k_x,k_y,k_z), \mathbf{r}_0=(r_{x0},r_{y0},r_{z0})\) are Vector parameters that must be set to define the harmonic well. As the parameters are vectors, one- and two-dimensional harmonic potentials may be created by setting some of the spring coefficients to zero.
The harmonic potentials are defined directly within the python input script as a Fix using its constructor.
FixExternalHarmonic(state,handle,groupHandle,k,r0)
Arguments
Adding and activating the fix
#Add Fix for external harmonic potential
UextHarm = FixExternalHarmonic(state,handle='Uharm',groupHandle='all',
k = Vector(1.0,0.0,0.5), r0 = Vector(0.0,0.0,1.0))
#Activate fix
state.activateFix(UextHarmt)