class forcefields::Tip4p¶
Overview¶
TIP4P forcefield with fexible molecules and group based cutoff. The function computing the forces and energy is compute(). Parameters for the forcefield were taken from Abascal et al.. The parameters are those of TIP4P (original version). TIP4P is a potential for constrained molecules of water. In this implementation quadratic restraints were added to bonds OH and HH inside molecules of water. So the potential can be used without constraints. The potential has a cutoff for long range interaction. The cutoff can be changed by setCutoff(). There is also and switching zone at the edge of the cutoff to cut off the interactions smoothly. The width of this switching zone is controlled by setSwitchingWidth().
The unit system for this potential is eV (electron volt), Angstrom, e (e charge). More…
class Tip4p: public forcefields::Ccl {
public:
// structs
struct Water;
// construction
Tip4p();
Tip4p(double cutoff, double switchingWidth);
~Tip4p();
// methods
void computeHH_O_(const int nAtoms, const double R[], double F[], double& U, const double b[]);
void computeHH_O_(const int nAtoms, const double R[], double F[], double& U, const double b[], const bool fixed[]);
static char const* getName();
};
Inherited Members¶
public:
// structs
template <int N, class R = double(*const)[N], class F = double(*const)[N]>
struct ChargeGroup;
struct Vector3;
struct Dtheta;
struct Rho;
// methods
double getSwitchingWidth() const;
void setSwitchingWidth(double width);
double getCutoff() const;
void setCutoff(double cutoff);
static double applyPeriodicity0(double r, double const period);
static void applyPeriodicity0(double r[], double const periods[]);
void computeHH_O_(const int nAtoms, const double R[], double F[], double& U, const double b[]);
void computeHH_O_(const int nAtoms, const double R[], double F[], double& U, const double b[], const bool fixed[]);
char const* getName() const;
Detailed Documentation¶
TIP4P forcefield with fexible molecules and group based cutoff. The function computing the forces and energy is compute(). Parameters for the forcefield were taken from Abascal et al.. The parameters are those of TIP4P (original version). TIP4P is a potential for constrained molecules of water. In this implementation quadratic restraints were added to bonds OH and HH inside molecules of water. So the potential can be used without constraints. The potential has a cutoff for long range interaction. The cutoff can be changed by setCutoff(). There is also and switching zone at the edge of the cutoff to cut off the interactions smoothly. The width of this switching zone is controlled by setSwitchingWidth().
The unit system for this potential is eV (electron volt), Angstrom, e (e charge).
References¶
A general purpose model for the condensed phases of water: TIP4P/2005, J.L.F. Abascal and C. Vega, J. Chem. Phys. (2005) vol. 123, p. 234505.
Methods¶
void computeHH_O_(const int nAtoms, const double R[], double F[], double& U, const double b[])
Compute the forces and the energy. The order of the atoms is very important. For this function the order is H1, H1, H2, H2, etc … , O1, O2, etc … The numbers are for the molecules. The suffix HH_O_ is to reminds the ordering of the atoms. It indicates the position of the atoms of the first molecule, while the underscore marks the locations of other atoms.
Warning
Be careful with the order of the atoms.
Parameters:
nAtoms |
Number of Atoms. |
R |
coordinates. |
F |
Forces. |
U |
Potential energy. |
b |
Periodic boundaries. |
void computeHH_O_(const int nAtoms, const double R[], double F[], double& U, const double b[], const bool fixed[])
Compute the forces and the energy (with fixed atom optimisation). In a simulation, some atoms may be fixed (not allowed to move). Computing the interaction between two fixed atoms is useless. When the potential knows which atoms are fixed, it can avoid these useless computations.
Parameters:
nAtoms |
Number of Atoms. |
R |
coordinates. |
F |
Forces. |
U |
Potential energy. |
b |
Periodic boundaries. |
fixed |
The length of the array must be equal to nAtoms in compute(). True when atom is fixed, false otherwise. |
See also:
Check compute() for the order of the atoms.
static char const* getName()
Name of the potential.