.. index:: pair: class; forcefields::Tip4p .. _doxid-classforcefields_1_1_tip4p: class forcefields::Tip4p ======================== .. toctree:: :hidden: struct_forcefields_Tip4p_Water.rst 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 :ref:`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). :ref:`More...` .. ref-code-block:: cpp :class: doxyrest-overview-code-block class Tip4p: public :ref:`forcefields::Ccl` { public: // structs struct :ref:`Water`; // construction :target:`Tip4p`(); :target:`Tip4p`(double cutoff, double switchingWidth); :target:`~Tip4p`(); // methods void :ref:`computeHH_O_`(const int nAtoms, const double R[], double F[], double& U, const double b[]); void :ref:`computeHH_O_`(const int nAtoms, const double R[], double F[], double& U, const double b[], const bool fixed[]); static char const* :ref:`getName`(); }; Inherited Members ----------------- .. ref-code-block:: cpp :class: doxyrest-overview-inherited-code-block public: // structs template struct :ref:`ChargeGroup`; struct :ref:`Vector3`; struct :ref:`Dtheta`; struct :ref:`Rho`; // methods double :ref:`getSwitchingWidth`() const; void :ref:`setSwitchingWidth`(double width); double :ref:`getCutoff`() const; void :ref:`setCutoff`(double cutoff); static double :ref:`applyPeriodicity0`(double r, double const period); static void :ref:`applyPeriodicity0`(double r[], double const periods[]); void :ref:`computeHH_O_`(const int nAtoms, const double R[], double F[], double& U, const double b[]); void :ref:`computeHH_O_`(const int nAtoms, const double R[], double F[], double& U, const double b[], const bool fixed[]); char const* :ref:`getName`() const; .. _details-classforcefields_1_1_tip4p: 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 :ref:`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). .. _doxid-classforcefields_1_1_tip4p_1tip4p_references: References ~~~~~~~~~~ :target:`doxid-classforcefields_1_1_tip4p_1abascal2005` 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 ------- .. index:: pair: function; computeHH_O_ .. _doxid-classforcefields_1_1_tip4p_1a02d1db71a3235c3ecc2c84bf28928d76: .. ref-code-block:: cpp :class: doxyrest-title-code-block 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. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - nAtoms - Number of :ref:`Atoms `. * - R - coordinates. * - F - Forces. * - U - Potential energy. * - b - Periodic boundaries. .. index:: pair: function; computeHH_O_ .. _doxid-classforcefields_1_1_tip4p_1affc216d83cc6f8812e2306aec624cc4f: .. ref-code-block:: cpp :class: doxyrest-title-code-block 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. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - nAtoms - Number of :ref:`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. .. rubric:: See also: Check compute() for the order of the atoms. .. index:: pair: function; getName .. _doxid-classforcefields_1_1_tip4p_1a950c9829272d653914cd141834038351: .. ref-code-block:: cpp :class: doxyrest-title-code-block static char const* getName() Name of the potential.