Long range Coulomb interactions implemented from Deserno and Holm, J.Chem.Phys. 109, 7678, 1998. The idea of the method is to accurately include periodic boundary conditions in Coulomb potential calculation,and allow particles to interact with infinite amount of simulation box images. This is done by separation of Coulomb potential into short-range pairwise part and long-range part. Short-range part force is:
The long-range part calculation requires mapping pariticle charges to a mesh, calculating energy and electric field at mesh points assuming large number of periodic images through Fourier space. Then forces on particles are calculated through:
where \(q_i, q_j\) are charges of particles \(i,j\), \(r_{ij}\) is the distance between particles \(i,j\), \(\alpha\) is splitting parameter, \({\bf r}_{\rm p}\) is coordinates of mesh points, \(W({\bf r})\) is charge assignment function and \(r_{\rm cut}\) is cutoff distance.
FixChargeEwald reports root mean square (RMS) force error from analytical approximation.
Adding Fix
FixChargeEwald(state=..., handle=...,group_handle=...)
Arguments
Setting parameters from within the Python environment is done with setParameters.
setParameters(szx=...,szy=...,szz=..., r_cut=..., interpolation_order=...)
setParameters(sz=..., r_cut=..., interpolation_order=...)
Arguments
It is possible to set required RMS error instead of mesh size with setError
setError(error=..., r_cut=..., interpolation_order=...)
Arguments
It is possible to avoid updating long-range part every timestep with setLongRangeInterval
setLongRangeInterval(interval=...)
Arguments
Adding the fix
#adding charge fix
charge=FixChargeEwald(state, "charge", "all")
Setting parameters in python
#64 grid points in each dimension, cutoff of rCut-1
#interpolating charge to three mesh points
charge.setParameters(64, state.rCut-1, 3);
#alternatively, one could let DASH determinine the
#grid discretization by setting an error tolerance
#(1e-2 here)
#charge.setError(1e-2)
Activating the fix
#Activate fix
state.activateFix(charge)