Loading...
Searching...
No Matches
forcefields::Ccl Class Reference

Quartic intramolecular potential for water. More...

#include <ccl.hpp>

Inheritance diagram for forcefields::Ccl:

Classes

struct  Rho
 \( \rho \) parameter in paper. More...
struct  Dtheta
 \( \Delta \theta \) parameter in paper. More...

Public Member Functions

 Ccl ()
void computeHH_O_ (const int nAtoms, const double R[], double F[], double &U, const double b[])
 Compute the forces and the energy.
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).
char const * getName () const
 Name of the potential.
Public Member Functions inherited from forcefields::PotentialBase
 PotentialBase ()
 Non bond interaction cutoff.
 PotentialBase (double cutoff, double switchingWidth)
virtual ~PotentialBase ()
double getCutoff () const
void setCutoff (double cutoff)
double getSwitchingWidth () const
 Width of the switching zone.
void setSwitchingWidth (double width)

Protected Member Functions

 Ccl (double cutoff, double switchingWidth)
 Constructor with cutoff for derived classes.
void intramolecular (double const rh1[], double const rh2[], double const ro[], double fh1[], double fh2[], double fo[], double &energy)
 Interactions inside one molecules.
void initialiseRho (Vector3 const &v, Rho &r)
 Initialise Rho.
void initialiseDtheta (Vector3 const &v1, Vector3 const &v2, Dtheta &dth, double const thetaEquilibrium)
 Initialise Dtheta.
void intramolecular (Rho const &ro1, Rho const &ro2, Dtheta const &dth, double &energy, double fh1[], double fh2[], double fo[])
 Compute intramolecular energy and forces.
Protected Member Functions inherited from forcefields::PotentialBase
void restrainAngle (double const r1[], double const r2[], double const r3[], double f1[], double f2[], double f3[], double &u, const double k, const double aeq)
 Angular quadratic restraints.
void calculateCentre (double const r1[], double const r2[], double rc[])
 Calculate centre of two points.
void calculateCentre (double const r1[], double const r2[], double const r3[], double rc[])
 Calculate centre of three points.
void calculateWeightedCentre (double const w1, double const w2, double const w3, double const r1[], double const r2[], double const r3[], double rc[])
 Calculate barycentre.
void coulombWithCutoff (const double r1[], const double r2[], double f1[], double f2[], double &u, double const qq)
 Coulomb interaction with single charge based cutoff.
void coulomb (const double r1[], const double r2[], double f1[], double f2[], double &u, double const qq)
 Compute Coulomb interaction between two charges.
void coulomb (double distance, double &force, double &energy, double const qq)
 Compute Coulomb interaction between two charges.
void spreadForce (double f1[], double f2[], double const fc[])
 Spread force on centre to other points.
void spreadForce (double f1[], double f2[], double f3[], double const fc[])
 Spread force on centre to other points.
void spreadWeightedForce (double const w1, double const w2, double const w3, double f1[], double f2[], double f3[], double const fc[])
 Spread force on barycentre to atoms.
template<int N, class R, class F>
void addForces (ChargeGroup< N, R, F > const &g1, ChargeGroup< N, R, F > &g2)
 Increment forces.
template<int N, class R, class F>
void switching (ChargeGroup< N, R, F > &g1, ChargeGroup< N, R, F > &g2, double &energy, double cutoff, double switchingWidth)
void computePt (int const nAtoms, double positions[], double forces[], double &energy, double const periods[], bool const fixed[])
 Potential for Platinum.
void restrainLength (const double R1[], const double R2[], double F1[], double F2[], double &u, const double k, const double r0)
 Compute quadratic restraints between two atoms.
void lennardJones (double const distance, double &force, double &energy, double const epsilon, double const sigma)
 Lennard-Jones 12-6 between two atoms.
void lennardJones (const double R1[], const double R2[], double F1[], double F2[], double &E, double const epsilon, double const sigma)
 Lennard-Jones 12-6 between two atoms.
void lennardJonesWithCutoff (double const r1[], double const r2[], double f1[], double f2[], double &energy, double const epsilon, double const sigma)
 Lennard Jones 12-6 Potential with cutoff.
void switching (double const distance, double &force, double &energy)
 Smooth cutoff switch off.
void switching (double const r1[], double const r2[], double f1[], double f2[], double &energy)
 Smooth cutoff switch off.
double applyPeriodicity1 (double r, int const axis)
 Minimum image representation.
void applyPeriodicity1 (double r[])
 Minimum image representation.
void distance (const double x[], const double y[], double z[], double &z1, double &z2)
 Distance vector, norm and norm square.
void distance (const double x[], const double y[], double z[], double &z1)
 Distance.
void distance (const double x[], const double y[], double z[])
 Distance vector, norm.
void distance (const double x[], const double y[], double &z1)
 Distance.
void distance (const double x[], const double y[], Vector3 &z)
 Distance vector, norm and norm square.
void setPeriodicity (const double periods[])
 Set periodicity.
double unBreak1 (double const r, double const ref, int const axis)
 Undo the separation of two atoms created by the periodic boundaries.
void unBreak1 (double r[], double const ref[])
 Undo the separation of two atoms created by the periodic boundaries.

Static Protected Attributes

static double const re_ = re_
 Distance OH at equilibrium.
static double const thetae_ = thetae_
 Distance OH at equilibrium.
static const double ONE_OVER_4_PI_EPSILON0
static const double EPSILON_PT = 0.68165797577788501
 Platinum Lennard-Jones.
static const double SIGMA_PT = 2.54

Private Member Functions

template<int H, int O>
void computeTemplate (const int nMolecules, const double(*const rh1)[H *3], const double(*const rh2)[H *3], const double(*const ro)[O *3], double(*const fh1)[H *3], double(*const fh2)[H *3], double(*const fo)[O *3], double &energy, double const b[], bool const (*const xh1)[H]=0, bool const (*const xh2)[H]=0, bool const (*const xo)[O]=0)
 Compute forces and energy.
void ro_2 (Rho const &ro1, Rho const &ro2, double &energy, double &d1, double &d2)
 Energy and derivatives for Term 1.
void ro1_ro2 (Rho const &s1, Rho const &s2, double &energy, double &d1, double &d2)
void ro_theta (Rho const &s1, Rho const &s2, Dtheta const &s3, double &energy, double &d1, double &d2, double &d3)
void theta_2 (Dtheta const &s3, double &energy, double &d3)
 Energy and derivatives for Term 4.
void ro_3 (Rho const &s1, Rho const &s2, double &energy, double &d1, double &d2)
void ro_ro1_ro2 (Rho const &s1, Rho const &s2, double &energy, double &d1, double &d2)
void ro_2_theta (Rho const &s1, Rho const &s2, Dtheta const &s3, double &energy, double &d1, double &d2, double &d3)
void ro1_ro2_theta (Rho const &s1, Rho const &s2, Dtheta const &s3, double &energy, double &d1, double &d2, double &d3)
void ro_theta_2 (Rho const &s1, Rho const &s2, Dtheta const &s3, double &energy, double &d1, double &d2, double &d3)
void theta_3 (Dtheta const &s3, double &energy, double &d3)
void ro_4 (Rho const &s1, Rho const &s2, double &energy, double &d1, double &d2)
void ro1_ro2_ro_2 (Rho const &s1, Rho const &s2, double &energy, double &d1, double &d2)
void ro1_2_ro2_2 (Rho const &s1, Rho const &s2, double &energy, double &d1, double &d2)
void ro_3_theta (Rho const &s1, Rho const &s2, Dtheta const &s3, double &energy, double &d1, double &d2, double &d3)
void ro_ro1_ro2_theta (Rho const &s1, Rho const &s2, Dtheta const &s3, double &energy, double &d1, double &d2, double &d3)
void ro_2_theta_2 (Rho const &s1, Rho const &s2, Dtheta const &s3, double &energy, double &d1, double &d2, double &d3)
void ro1_ro2_theta_2 (Rho const &s1, Rho const &s2, Dtheta const &s3, double &energy, double &d1, double &d2, double &d3)
void theta_4 (Dtheta const &s3, double &energy, double &d3)

Additional Inherited Members

static double applyPeriodicity0 (double r, double const period)
 Minimum image representation.
static void applyPeriodicity0 (double r[], double const periods[])
 Minimum image representation.
Static Protected Member Functions inherited from forcefields::PotentialBase
static void divide (double v[], double const divisor)
 Divide vector.
static double * crossProduct (const double v[], const double w[], double e[])
 Cross product.
static double dotProduct (double const v[], double const w[])
 Dot product.
static void multiply (double v[], double const factor)
 Multiply vector.
static double norm (double const v[])
 Norm of 3D vector.
static void normalise (double v[])
 Normalise 3D vector \( \frac{\mathbf v}{ |\mathbf v|} \).
static double isoscelesBase (double length, double angle)
 Calculate the base of an isosceles triangle.
static double epsilon (double const A, double const B)
 Conversion for Lennard-Jones.
static double sigma (double const A, double const B)
 Conversion for Lennard-Jones.
static double smithKongEpsilon (double sigma1, double epsilon1, double sigma2, double epsilon2)
 Smith and Kong combination rules.
static double smithKongSigma (double sigma1, double epsilon1, double sigma2, double epsilon2)
 Smith and Kong combination rules.
static double unBreak0 (double const r, double const ref, double const period)
 Undo the separation of two atoms created by the periodic boundaries.
static void unBreak0 (double r[], double const ref[], double const periods[])
 Undo the separation of two atoms created by the periodic boundaries.
Protected Attributes inherited from forcefields::PotentialBase
double cutoff_
double periods_ [3]
double switchingWidth_

Detailed Description

Quartic intramolecular potential for water.

This is a potential to intramolecular interaction in water published by Carney, Curtiss and Langhoff. The functions and parameters for the potential are in Table II of the publication.

References

Improved Potential Functions for Bent AB2 Molecules: Water and Ozone. GD Carney, LA Curtiss, SR Langhoff, J. Mol. Spectroscopy 1976, vol. 61, p. 371-381

Definition at line 22 of file ccl.hpp.

Constructor & Destructor Documentation

◆ Ccl() [1/2]

forcefields::Ccl::Ccl ( )
inline

Definition at line 24 of file ccl.hpp.

24{}

◆ Ccl() [2/2]

forcefields::Ccl::Ccl ( double cutoff,
double switchingWidth )
protected

Constructor with cutoff for derived classes.

Ccl does not use any cutoff (bond interaction only). The constructor is for derived class that may require it.

Definition at line 167 of file ccl.cpp.

168 : PotentialBase(cutoff, switchingWidth) {}
PotentialBase()
Non bond interaction cutoff.

Member Function Documentation

◆ computeHH_O_() [1/2]

void forcefields::Ccl::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.

Parameters
[in]nAtomsNumber of Atoms.
[in]Rcoordinates.
[out]FForces.
[out]UPotential energy.
[in]bPeriodic boundaries.
Warning
Be careful with the order of the atoms.

Definition at line 125 of file ccl.cpp.

126 {
127 computeHH_O_(nAtoms, R, F, U, b, 0);
128}
void computeHH_O_(const int nAtoms, const double R[], double F[], double &U, const double b[])
Compute the forces and the energy.
Definition ccl.cpp:125

◆ computeHH_O_() [2/2]

void forcefields::Ccl::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
[in]nAtomsNumber of Atoms.
[in]Rcoordinates.
[out]FForces.
[out]UPotential energy.
[in]bPeriodic boundaries.
[in]fixedThe 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.

Definition at line 143 of file ccl.cpp.

144 {
145 int const nMolecules = nAtoms / 3;
146 const double (*const rh1)[6] = reinterpret_cast<const double (*)[6]>(R);
147 const double (*const rh2)[6] = reinterpret_cast<const double (*)[6]>(&R[3]);
148 const double (*const ro)[3] =
149 reinterpret_cast<const double (*)[3]>(&R[nMolecules * 6]);
150 double (*const fh1)[6] = reinterpret_cast<double (*)[6]>(F);
151 double (*const fh2)[6] = reinterpret_cast<double (*)[6]>(&F[3]);
152 double (*const fo)[3] = reinterpret_cast<double (*)[3]>(&F[nMolecules * 6]);
153 bool const(*const xh1)[2] = reinterpret_cast<bool const(*)[2]>(fixed);
154 bool const(*const xh2)[2] = reinterpret_cast<bool const(*)[2]>(&fixed[1]);
155 bool const(*const xo)[1] =
156 reinterpret_cast<bool const(*)[1]>(&fixed[nMolecules * 2]);
157 computeTemplate(nMolecules, rh1, rh2, ro, fh1, fh2, fo, U, b, xh1, xh2, xo);
158}
void computeTemplate(const int nMolecules, const double(*const rh1)[H *3], const double(*const rh2)[H *3], const double(*const ro)[O *3], double(*const fh1)[H *3], double(*const fh2)[H *3], double(*const fo)[O *3], double &energy, double const b[], bool const (*const xh1)[H]=0, bool const (*const xh2)[H]=0, bool const (*const xo)[O]=0)
Compute forces and energy.
Definition ccl.cpp:318

◆ computeTemplate()

template<int H, int O>
void forcefields::Ccl::computeTemplate ( const int nMolecules,
const double(*) rh1[H *3],
const double(*) rh2[H *3],
const double(*) ro[O *3],
double(*) fh1[H *3],
double(*) fh2[H *3],
double(*) fo[O *3],
double & energy,
double const b[],
bool const (*) xh1[H] = 0,
bool const (*) xh2[H] = 0,
bool const (*) xo[O] = 0 )
private

Compute forces and energy.

The function calculates and returns the energy and forces applied on each atom. The function has preconditions with which the user must comply before calling this function. The periodic boundaries must set with (setPeriodicity()). The content of and arrays fh1 , fh2 , fo must be zero for all elements.
Arrays ending in h1 are for the hydrogen one of the molecules and those ending in h2 for hydrogen 2.

Parameters
[in]nMoleculesNumber of molecules.
[in]rh1, rh2, roPositions of hydrogens and oxygens.
[in,out]fh1, fh2, foForces on hydrogens and oxygens.
[in,out]energyPotential energy.
[in]bPeriodic boundaries.
[in]xh1, xh2, xoTell which atoms are fixed and which are movable. This parameter are optional. When provided, interaction between fixed atoms are skipped. The three arrays xh1, xh2, xo must be provided for the optimisation to work.
Warning
Remember the preconditions.

Definition at line 318 of file ccl.cpp.

324 {
325 for (int i = 0; i < nMolecules; ++i) {
326 for (int a = 0; a < 3; a++) {
327 fh1[i][a] = 0.0;
328 fh2[i][a] = 0.0;
329 fo[i][a] = 0.0;
330 };
331 };
332 energy = 0.0;
334
335 for (int i = nMolecules - 1; i >= 0; --i) {
336 bool const areFixed = xh1[i][0] and xh2[i][0] and xo[i][0];
337 if (not areFixed) {
338 intramolecular(rh1[i], rh2[i], ro[i], fh1[i], fh2[i], fo[i], energy);
339 };
340 };
341 assert(not std::isnan(energy) and not std::isinf(energy));
342}
void intramolecular(double const rh1[], double const rh2[], double const ro[], double fh1[], double fh2[], double fo[], double &energy)
Interactions inside one molecules.
Definition ccl.cpp:233
void setPeriodicity(const double periods[])
Set periodicity.

◆ getName()

char const * forcefields::Ccl::getName ( ) const

Name of the potential.

Definition at line 161 of file ccl.cpp.

161{ return "Ccl"; }

◆ initialiseDtheta()

void forcefields::Ccl::initialiseDtheta ( Vector3 const & v1,
Vector3 const & v2,
Dtheta & dth,
double const thetaEquilibrium )
protected

Initialise Dtheta.

Definition at line 204 of file ccl.cpp.

205 {
206 double const cos_theta = dotProduct(v1.v, v2.v) / v1._1 / v2._1;
207 double const theta = std::acos(cos_theta);
208 dth._1 = theta - thetaEquilibrium;
209 dth._2 = dth._1 * dth._1;
210 dth._3 = dth._2 * dth._1;
211 double const d_theta = -1.0 / std::sqrt(1.0 - cos_theta * cos_theta);
212 for (int k = 0; k < 3; ++k) {
213 dth.n1[k] = 0.0;
214 dth.n2[k] = 0.0;
215 for (int j = 0; j < 3; ++j) {
216 dth.n1[k] -= v2.v[j] / v2._1 / v1._1 * v1.v[j] * v1.v[k] / v1._2;
217 dth.n2[k] -= v1.v[j] / v1._1 / v2._1 * v2.v[j] * v2.v[k] / v2._2;
218 };
219 dth.n1[k] += v2.v[k] / v2._1 / v1._1;
220 dth.n2[k] += v1.v[k] / v1._1 / v2._1;
221 dth.n1[k] *= d_theta;
222 dth.n2[k] *= d_theta;
223 };
224}
static double dotProduct(double const v[], double const w[])
Dot product.

◆ initialiseRho()

void forcefields::Ccl::initialiseRho ( Vector3 const & v,
Rho & r )
protected

Initialise Rho.

Definition at line 194 of file ccl.cpp.

194 {
195 ro._1 = (v._1 - re_) / v._1;
196 ro._2 = ro._1 * ro._1;
197 ro._3 = ro._2 * ro._1;
198 double const d = re_ / v._2 / v._1;
199 for (int i = 0; i < 3; ++i)
200 ro.n[i] = v.v[i] * d;
201}
static double const re_
Distance OH at equilibrium.
Definition ccl.hpp:56

◆ intramolecular() [1/2]

void forcefields::Ccl::intramolecular ( double const rh1[],
double const rh2[],
double const ro[],
double fh1[],
double fh2[],
double fo[],
double & energy )
protected

Interactions inside one molecules.

Parameters
[in]rh1, rh2, roPositions of H1, H2, O.
[in,out]fh1, fh2, foForces on atoms.
[in,out]energy
Note
The function is for one molecules so rh1[3], rh2[3], etc... energy, fh1, etc, are incremented.

Definition at line 233 of file ccl.cpp.

235 {
236 Vector3 v1, v2;
237 distance(rh1, ro, v1);
238 distance(rh2, ro, v2);
239 // ------prepare _
240 Rho ro1, ro2;
241 initialiseRho(v1, ro1);
242 initialiseRho(v2, ro2);
243
244 // ------- prepare Delta theta
245 Dtheta dth;
246 initialiseDtheta(v1, v2, dth, thetae_);
247 intramolecular(ro1, ro2, dth, energy, fh1, fh2, fo);
248}
void initialiseRho(Vector3 const &v, Rho &r)
Initialise Rho.
Definition ccl.cpp:194
static double const thetae_
Distance OH at equilibrium.
Definition ccl.hpp:57
void initialiseDtheta(Vector3 const &v1, Vector3 const &v2, Dtheta &dth, double const thetaEquilibrium)
Initialise Dtheta.
Definition ccl.cpp:204
void distance(const double x[], const double y[], double z[], double &z1, double &z2)
Distance vector, norm and norm square.
parameter in paper.
Definition ccl.hpp:43
parameter in paper.
Definition ccl.hpp:36

◆ intramolecular() [2/2]

void forcefields::Ccl::intramolecular ( Rho const & ro1,
Rho const & ro2,
Dtheta const & dth,
double & energy,
double fh1[],
double fh2[],
double fo[] )
protected

Compute intramolecular energy and forces.

Parameters
[in]ro1, ro2, dthPotential coordinates properly initialised.
[in,out]energyAdd the energy.
[in,out]fh1, fh2, foAdd the forces on atoms.

Definition at line 255 of file ccl.cpp.

257 {
258 double d1 = 0, d2 = 0,
259 d3 = 0; // d1=d(E)/d(rho1), d2=d(E)/d(rho2), d(E)/d(theta)
260
261 // -------- quadratic interaction
262 ro_2(ro1, ro2, energy, d1, d2);
263 ro1_ro2(ro1, ro2, energy, d1, d2);
264 ro_theta(ro1, ro2, dth, energy, d1, d2, d3);
265 theta_2(dth, energy, d3);
266 //*/
267
268 // -------- Cubic interaction
269 ro_3(ro1, ro2, energy, d1, d2);
270 ro_ro1_ro2(ro1, ro2, energy, d1, d2);
271 ro_2_theta(ro1, ro2, dth, energy, d1, d2, d3);
272 ro1_ro2_theta(ro1, ro2, dth, energy, d1, d2, d3);
273 ro_theta_2(ro1, ro2, dth, energy, d1, d2, d3);
274 theta_3(dth, energy, d3);
275 //*/
276
277 // --------------------------------------------- Quartic
278 // -------------------------------------
279 ro_4(ro1, ro2, energy, d1, d2);
280 ro1_ro2_ro_2(ro1, ro2, energy, d1, d2);
281 ro1_2_ro2_2(ro1, ro2, energy, d1, d2);
282
283 ro_3_theta(ro1, ro2, dth, energy, d1, d2, d3);
284 ro_ro1_ro2_theta(ro1, ro2, dth, energy, d1, d2, d3);
285
286 ro_2_theta_2(ro1, ro2, dth, energy, d1, d2, d3);
287 ro1_ro2_theta_2(ro1, ro2, dth, energy, d1, d2, d3);
288
289 // ro_theta_3 = 0
290 theta_4(dth, energy, d3);
291 //*/
292 for (int i = 0; i < 3; ++i) {
293 fh1[i] -= d1 * ro1.n[i] + d3 * dth.n1[i];
294 fh2[i] -= d2 * ro2.n[i] + d3 * dth.n2[i];
295 fo[i] += d1 * ro1.n[i] + d2 * ro2.n[i] + d3 * dth.n1[i] + d3 * dth.n2[i];
296 };
297}
void ro_ro1_ro2_theta(Rho const &s1, Rho const &s2, Dtheta const &s3, double &energy, double &d1, double &d2, double &d3)
Definition ccl.cpp:470
void ro_3(Rho const &s1, Rho const &s2, double &energy, double &d1, double &d2)
Definition ccl.cpp:395
void ro_3_theta(Rho const &s1, Rho const &s2, Dtheta const &s3, double &energy, double &d1, double &d2, double &d3)
Definition ccl.cpp:462
void ro_2_theta_2(Rho const &s1, Rho const &s2, Dtheta const &s3, double &energy, double &d1, double &d2, double &d3)
Definition ccl.cpp:482
void theta_4(Dtheta const &s3, double &energy, double &d3)
Definition ccl.cpp:499
void ro_theta(Rho const &s1, Rho const &s2, Dtheta const &s3, double &energy, double &d1, double &d2, double &d3)
Definition ccl.cpp:370
void ro1_ro2_theta(Rho const &s1, Rho const &s2, Dtheta const &s3, double &energy, double &d1, double &d2, double &d3)
Definition ccl.cpp:417
void ro_ro1_ro2(Rho const &s1, Rho const &s2, double &energy, double &d1, double &d2)
Definition ccl.cpp:402
void ro_2(Rho const &ro1, Rho const &ro2, double &energy, double &d1, double &d2)
Energy and derivatives for Term 1.
Definition ccl.cpp:356
void ro1_ro2_ro_2(Rho const &s1, Rho const &s2, double &energy, double &d1, double &d2)
Definition ccl.cpp:448
void ro_2_theta(Rho const &s1, Rho const &s2, Dtheta const &s3, double &energy, double &d1, double &d2, double &d3)
Definition ccl.cpp:409
void ro1_ro2(Rho const &s1, Rho const &s2, double &energy, double &d1, double &d2)
Definition ccl.cpp:363
void theta_2(Dtheta const &s3, double &energy, double &d3)
Energy and derivatives for Term 4.
Definition ccl.cpp:387
void theta_3(Dtheta const &s3, double &energy, double &d3)
Definition ccl.cpp:433
void ro_4(Rho const &s1, Rho const &s2, double &energy, double &d1, double &d2)
Definition ccl.cpp:441
void ro1_ro2_theta_2(Rho const &s1, Rho const &s2, Dtheta const &s3, double &energy, double &d1, double &d2, double &d3)
Definition ccl.cpp:490
void ro1_2_ro2_2(Rho const &s1, Rho const &s2, double &energy, double &d1, double &d2)
Definition ccl.cpp:455
void ro_theta_2(Rho const &s1, Rho const &s2, Dtheta const &s3, double &energy, double &d1, double &d2, double &d3)
Definition ccl.cpp:425

◆ ro1_2_ro2_2()

void forcefields::Ccl::ro1_2_ro2_2 ( Rho const & s1,
Rho const & s2,
double & energy,
double & d1,
double & d2 )
private

Definition at line 455 of file ccl.cpp.

456 {
457 energy += ro1_2_ro2_2_ * re2_ * ro1._2 * ro2._2;
458 d1 += ro1_2_ro2_2_ * re2_ * 2.0 * ro1._1 * ro2._2; // dE/drho1
459 d2 += ro1_2_ro2_2_ * re2_ * 2.0 * ro1._2 * ro2._1; // dE/drho2
460}

◆ ro1_ro2()

void forcefields::Ccl::ro1_ro2 ( Rho const & s1,
Rho const & s2,
double & energy,
double & d1,
double & d2 )
private

Definition at line 363 of file ccl.cpp.

364 {
365 energy += ro1_ro2_ * re2_ * ro1._1 * ro2._1;
366 d1 += ro1_ro2_ * re2_ * ro2._1;
367 d2 += ro1_ro2_ * re2_ * ro1._1;
368}

◆ ro1_ro2_ro_2()

void forcefields::Ccl::ro1_ro2_ro_2 ( Rho const & s1,
Rho const & s2,
double & energy,
double & d1,
double & d2 )
private

Definition at line 448 of file ccl.cpp.

449 {
450 energy += ro1_ro2_ro_2_ * re2_ * ro1._1 * ro2._1 * (ro1._2 + ro2._2);
451 d1 += ro1_ro2_ro_2_ * re2_ * (3.0 * ro2._1 * ro1._2 + ro2._3); // dE/drho1
452 d2 += ro1_ro2_ro_2_ * re2_ * (3.0 * ro1._1 * ro2._2 + ro1._3); // dE/drho2
453}

◆ ro1_ro2_theta()

void forcefields::Ccl::ro1_ro2_theta ( Rho const & s1,
Rho const & s2,
Dtheta const & s3,
double & energy,
double & d1,
double & d2,
double & d3 )
private

Definition at line 417 of file ccl.cpp.

418 {
419 energy += ro1_ro2_theta_ * re2_ * ro1._1 * ro2._1 * dth._1;
420 d1 += ro1_ro2_theta_ * re2_ * ro2._1 * dth._1; // dE/drho1
421 d2 += ro1_ro2_theta_ * re2_ * ro1._1 * dth._1; // dE/drho2
422 d3 += ro1_ro2_theta_ * re2_ * ro1._1 * ro2._1; // dE/d(theta)
423}

◆ ro1_ro2_theta_2()

void forcefields::Ccl::ro1_ro2_theta_2 ( Rho const & s1,
Rho const & s2,
Dtheta const & s3,
double & energy,
double & d1,
double & d2,
double & d3 )
private

Definition at line 490 of file ccl.cpp.

491 {
492 energy += ro1_ro2_theta_2_ * re2_ * ro1._1 * ro2._1 * dth._2;
493 d1 += ro1_ro2_theta_2_ * re2_ * ro2._1 * dth._2; // dE/drho1
494 d2 += ro1_ro2_theta_2_ * re2_ * ro1._1 * dth._2; // dE/drho2
495 d3 += ro1_ro2_theta_2_ * re2_ * ro1._1 * ro2._1 * 2.0 * dth._1; // dE/d(theta)
496}

◆ ro_2()

void forcefields::Ccl::ro_2 ( Rho const & ro1,
Rho const & ro2,
double & energy,
double & d1,
double & d2 )
private

Energy and derivatives for Term 1.

Compute energy for term : \( r_e^2(\rho_1^2+\rho_2^2)/2 \) and derivatives: \( \frac{dE}{d\rho_1} \) and \( \frac{dE}{d\rho_2} \). We remind that \(\rho_1=\frac{r_1-r_{eq}}{\rho_1} \).

Parameters
[in]ro1, ro2Two sets containing parameters rho and rho^2.
[in,out]energyEnergy. Add energy to e.
[in,out]d1, d2Derivatives. Add derivatives to parameters d1 and d2.

Definition at line 356 of file ccl.cpp.

357 {
358 energy += ro_2_ * re2_ * (ro1._2 + ro2._2) / 2.0;
359 d1 += ro_2_ * re2_ * ro1._1;
360 d2 += ro_2_ * re2_ * ro2._1;
361}

◆ ro_2_theta()

void forcefields::Ccl::ro_2_theta ( Rho const & s1,
Rho const & s2,
Dtheta const & s3,
double & energy,
double & d1,
double & d2,
double & d3 )
private

Definition at line 409 of file ccl.cpp.

410 {
411 energy += ro_2_theta_ * re2_ * (ro1._2 + ro2._2) * dth._1;
412 d1 += ro_2_theta_ * re2_ * 2.0 * ro1._1 * dth._1; // dE/drho1
413 d2 += ro_2_theta_ * re2_ * 2.0 * ro2._1 * dth._1; // dE/drho2
414 d3 += ro_2_theta_ * re2_ * (ro1._2 + ro2._2); // dE/d(theta)
415}

◆ ro_2_theta_2()

void forcefields::Ccl::ro_2_theta_2 ( Rho const & s1,
Rho const & s2,
Dtheta const & s3,
double & energy,
double & d1,
double & d2,
double & d3 )
private

Definition at line 482 of file ccl.cpp.

483 {
484 energy += ro_2_theta_2_ * re2_ * (ro1._2 + ro2._2) * dth._2;
485 d1 += ro_2_theta_2_ * re2_ * 2.0 * ro1._1 * dth._2; // dE/drho1
486 d2 += ro_2_theta_2_ * re2_ * 2.0 * ro2._1 * dth._2; // dE/drho2
487 d3 += ro_2_theta_2_ * re2_ * 2.0 * (ro1._2 + ro2._2) * dth._1; // dE/d(theta)
488}

◆ ro_3()

void forcefields::Ccl::ro_3 ( Rho const & s1,
Rho const & s2,
double & energy,
double & d1,
double & d2 )
private

Definition at line 395 of file ccl.cpp.

396 {
397 energy += ro_3_ * re2_ * (ro1._3 + ro2._3);
398 d1 += 3.0 * ro_3_ * re2_ * ro1._2;
399 d2 += 3.0 * ro_3_ * re2_ * ro2._2;
400}

◆ ro_3_theta()

void forcefields::Ccl::ro_3_theta ( Rho const & s1,
Rho const & s2,
Dtheta const & s3,
double & energy,
double & d1,
double & d2,
double & d3 )
private

Definition at line 462 of file ccl.cpp.

463 {
464 energy += ro_3_theta_ * re2_ * (ro1._3 + ro2._3) * dth._1;
465 d1 += ro_3_theta_ * re2_ * 3.0 * ro1._2 * dth._1; // dE/drho1
466 d2 += ro_3_theta_ * re2_ * 3.0 * ro2._2 * dth._1; // dE/drho2
467 d3 += ro_3_theta_ * re2_ * (ro1._3 + ro2._3); // dE/d(theta)
468}

◆ ro_4()

void forcefields::Ccl::ro_4 ( Rho const & s1,
Rho const & s2,
double & energy,
double & d1,
double & d2 )
private

Definition at line 441 of file ccl.cpp.

442 {
443 energy += ro_4_ * re2_ * (ro1._2 * ro1._2 + ro2._2 * ro2._2);
444 d1 += ro_4_ * re2_ * 4.0 * ro1._3; // dE/drho1
445 d2 += ro_4_ * re2_ * 4.0 * ro2._3; // dE/drho2
446}

◆ ro_ro1_ro2()

void forcefields::Ccl::ro_ro1_ro2 ( Rho const & s1,
Rho const & s2,
double & energy,
double & d1,
double & d2 )
private

Definition at line 402 of file ccl.cpp.

403 {
404 energy += ro_ro1_ro2_ * re2_ * (ro1._1 + ro2._1) * ro1._1 * ro2._1;
405 d1 += ro_ro1_ro2_ * re2_ * (2.0 * ro1._1 * ro2._1 + ro2._2);
406 d2 += ro_ro1_ro2_ * re2_ * (2.0 * ro1._1 * ro2._1 + ro1._2);
407}

◆ ro_ro1_ro2_theta()

void forcefields::Ccl::ro_ro1_ro2_theta ( Rho const & s1,
Rho const & s2,
Dtheta const & s3,
double & energy,
double & d1,
double & d2,
double & d3 )
private

Definition at line 470 of file ccl.cpp.

471 {
472 energy +=
473 ro_ro1_ro2_theta_ * re2_ * (ro1._1 + ro2._1) * ro1._1 * ro2._1 * dth._1;
474 d1 += ro_ro1_ro2_theta_ * re2_ * (2.0 * ro1._1 * ro2._1 + ro2._2) *
475 dth._1; // dE/drho1
476 d2 += ro_ro1_ro2_theta_ * re2_ * (2.0 * ro1._1 * ro2._1 + ro1._2) *
477 dth._1; // dE/drho2
478 d3 += ro_ro1_ro2_theta_ * re2_ * (ro1._1 + ro2._1) * ro1._1 *
479 ro2._1; // dE/d(theta)
480}

◆ ro_theta()

void forcefields::Ccl::ro_theta ( Rho const & s1,
Rho const & s2,
Dtheta const & s3,
double & energy,
double & d1,
double & d2,
double & d3 )
private

Definition at line 370 of file ccl.cpp.

371 {
372 energy += ro_theta_ * re2_ * (ro1._1 + ro2._1) * dth._1;
373 d1 += ro_theta_ * re2_ * dth._1; // dE/drho1
374 d2 += ro_theta_ * re2_ * dth._1; // dE/drho2
375 d3 += ro_theta_ * re2_ * (ro1._1 + ro2._1); // dE/d(theta)
376}

◆ ro_theta_2()

void forcefields::Ccl::ro_theta_2 ( Rho const & s1,
Rho const & s2,
Dtheta const & s3,
double & energy,
double & d1,
double & d2,
double & d3 )
private

Definition at line 425 of file ccl.cpp.

426 {
427 energy += ro_theta_2_ * re2_ * (ro1._1 + ro2._1) * dth._2;
428 d1 += ro_theta_2_ * re2_ * dth._2; // dE/drho1
429 d2 += ro_theta_2_ * re2_ * dth._2; // dE/drho2
430 d3 += ro_theta_2_ * re2_ * (ro1._1 + ro2._1) * 2.0 * dth._1; // dE/d(theta)
431}

◆ theta_2()

void forcefields::Ccl::theta_2 ( Dtheta const & dth,
double & energy,
double & d3 )
private

Energy and derivatives for Term 4.

Compute energy for term : \( (r_e\Delta \theta)^2 \) and derivatives: \(\frac{dE}{d\theta} \).

Parameters
[in]dthTwo sets containing parameters \( (\Delta \theta)^2\) and \( \Delta \theta \).
[in,out]energyEnergy. Add energy to e.
[in,out]d3Derivatives. Add derivatives to parameters d3.
Note
Parameter d3 is a moment of force.

Definition at line 387 of file ccl.cpp.

387 {
388 energy += theta_2_ * re2_ * dth._2 / 2.0;
389 d3 += theta_2_ * re2_ * dth._1; // dE/d(theta)= - moment
390}

◆ theta_3()

void forcefields::Ccl::theta_3 ( Dtheta const & s3,
double & energy,
double & d3 )
private

Definition at line 433 of file ccl.cpp.

433 {
434 energy += thetat_3_ * re2_ * dth._3;
435 d3 += thetat_3_ * re2_ * 3.0 * dth._2; // dE/d(theta)
436}

◆ theta_4()

void forcefields::Ccl::theta_4 ( Dtheta const & s3,
double & energy,
double & d3 )
private

Definition at line 499 of file ccl.cpp.

499 {
500 energy += theta_4_ * re2_ * dth._2 * dth._2;
501 d3 += theta_4_ * re2_ * 4.0 * dth._3; // dE/d(theta)
502}

Member Data Documentation

◆ re_

double const forcefields::Ccl::re_ = re_
staticprotected

Distance OH at equilibrium.

Definition at line 56 of file ccl.hpp.

◆ thetae_

double const forcefields::Ccl::thetae_ = thetae_
staticprotected

Distance OH at equilibrium.

Definition at line 57 of file ccl.hpp.


The documentation for this class was generated from the following files:
  • /home/runner/work/eOn/eOn/include/eon/potentials/Water/ccl.hpp
  • /home/runner/work/eOn/eOn/client/potentials/Water/ccl.cpp