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]

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 172 of file ccl.cpp.

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

Member Function Documentation

◆ computeHH_O_() [1/2]

void 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 130 of file ccl.cpp.

131 {
132 computeHH_O_(nAtoms, R, F, U, b, 0);
133}
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:130

◆ computeHH_O_() [2/2]

void 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 148 of file ccl.cpp.

149 {
150 int const nMolecules = nAtoms / 3;
151 const double (*const rh1)[6] = reinterpret_cast<const double (*)[6]>(R);
152 const double (*const rh2)[6] = reinterpret_cast<const double (*)[6]>(&R[3]);
153 const double (*const ro)[3] =
154 reinterpret_cast<const double (*)[3]>(&R[nMolecules * 6]);
155 double (*const fh1)[6] = reinterpret_cast<double (*)[6]>(F);
156 double (*const fh2)[6] = reinterpret_cast<double (*)[6]>(&F[3]);
157 double (*const fo)[3] = reinterpret_cast<double (*)[3]>(&F[nMolecules * 6]);
158 bool const(*const xh1)[2] = reinterpret_cast<bool const(*)[2]>(fixed);
159 bool const(*const xh2)[2] = reinterpret_cast<bool const(*)[2]>(&fixed[1]);
160 bool const(*const xo)[1] =
161 reinterpret_cast<bool const(*)[1]>(&fixed[nMolecules * 2]);
162 computeTemplate(nMolecules, rh1, rh2, ro, fh1, fh2, fo, U, b, xh1, xh2, xo);
163}
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:323

◆ computeTemplate()

template<int H, int O>
void 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 323 of file ccl.cpp.

329 {
330 for (int i = 0; i < nMolecules; ++i) {
331 for (int a = 0; a < 3; a++) {
332 fh1[i][a] = 0.0;
333 fh2[i][a] = 0.0;
334 fo[i][a] = 0.0;
335 };
336 };
337 energy = 0.0;
339
340 for (int i = nMolecules - 1; i >= 0; --i) {
341 bool const areFixed = xh1[i][0] and xh2[i][0] and xo[i][0];
342 if (not areFixed) {
343 intramolecular(rh1[i], rh2[i], ro[i], fh1[i], fh2[i], fo[i], energy);
344 };
345 };
346 assert(not std::isnan(energy) and not std::isinf(energy));
347}
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:238
void setPeriodicity(const double periods[])
Set periodicity.

◆ getName()

char const * Ccl::getName ( ) const

Name of the potential.

Definition at line 166 of file ccl.cpp.

166{ return "Ccl"; }

◆ initialiseDtheta()

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

Initialise Dtheta.

Definition at line 209 of file ccl.cpp.

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

◆ initialiseRho()

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

Initialise Rho.

Definition at line 199 of file ccl.cpp.

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

◆ intramolecular() [1/2]

void 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 238 of file ccl.cpp.

240 {
241 Vector3 v1, v2;
242 distance(rh1, ro, v1);
243 distance(rh2, ro, v2);
244 // ------prepare _
245 Rho ro1, ro2;
246 initialiseRho(v1, ro1);
247 initialiseRho(v2, ro2);
248
249 // ------- prepare Delta theta
250 Dtheta dth;
251 initialiseDtheta(v1, v2, dth, thetae_);
252 intramolecular(ro1, ro2, dth, energy, fh1, fh2, fo);
253}
static double const thetae_
Distance OH at equilibrium.
Definition ccl.hpp:57
void initialiseRho(Vector3 const &v, Rho &r)
Initialise Rho.
Definition ccl.cpp:199
void initialiseDtheta(Vector3 const &v1, Vector3 const &v2, Dtheta &dth, double const thetaEquilibrium)
Initialise Dtheta.
Definition ccl.cpp:209
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 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 260 of file ccl.cpp.

262 {
263 double d1 = 0, d2 = 0,
264 d3 = 0; // d1=d(E)/d(rho1), d2=d(E)/d(rho2), d(E)/d(theta)
265
266 // -------- quadratic interaction
267 ro_2(ro1, ro2, energy, d1, d2);
268 ro1_ro2(ro1, ro2, energy, d1, d2);
269 ro_theta(ro1, ro2, dth, energy, d1, d2, d3);
270 theta_2(dth, energy, d3);
271 //*/
272
273 // -------- Cubic interaction
274 ro_3(ro1, ro2, energy, d1, d2);
275 ro_ro1_ro2(ro1, ro2, energy, d1, d2);
276 ro_2_theta(ro1, ro2, dth, energy, d1, d2, d3);
277 ro1_ro2_theta(ro1, ro2, dth, energy, d1, d2, d3);
278 ro_theta_2(ro1, ro2, dth, energy, d1, d2, d3);
279 theta_3(dth, energy, d3);
280 //*/
281
282 // --------------------------------------------- Quartic
283 // -------------------------------------
284 ro_4(ro1, ro2, energy, d1, d2);
285 ro1_ro2_ro_2(ro1, ro2, energy, d1, d2);
286 ro1_2_ro2_2(ro1, ro2, energy, d1, d2);
287
288 ro_3_theta(ro1, ro2, dth, energy, d1, d2, d3);
289 ro_ro1_ro2_theta(ro1, ro2, dth, energy, d1, d2, d3);
290
291 ro_2_theta_2(ro1, ro2, dth, energy, d1, d2, d3);
292 ro1_ro2_theta_2(ro1, ro2, dth, energy, d1, d2, d3);
293
294 // ro_theta_3 = 0
295 theta_4(dth, energy, d3);
296 //*/
297 for (int i = 0; i < 3; ++i) {
298 fh1[i] -= d1 * ro1.n[i] + d3 * dth.n1[i];
299 fh2[i] -= d2 * ro2.n[i] + d3 * dth.n2[i];
300 fo[i] += d1 * ro1.n[i] + d2 * ro2.n[i] + d3 * dth.n1[i] + d3 * dth.n2[i];
301 };
302}
void theta_4(Dtheta const &s3, double &energy, double &d3)
Definition ccl.cpp:504
void ro_3(Rho const &s1, Rho const &s2, double &energy, double &d1, double &d2)
Definition ccl.cpp:400
void theta_3(Dtheta const &s3, double &energy, double &d3)
Definition ccl.cpp:438
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:475
void ro_theta(Rho const &s1, Rho const &s2, Dtheta const &s3, double &energy, double &d1, double &d2, double &d3)
Definition ccl.cpp:375
void ro_3_theta(Rho const &s1, Rho const &s2, Dtheta const &s3, double &energy, double &d1, double &d2, double &d3)
Definition ccl.cpp:467
void theta_2(Dtheta const &s3, double &energy, double &d3)
Energy and derivatives for Term 4.
Definition ccl.cpp:392
void ro1_ro2_theta(Rho const &s1, Rho const &s2, Dtheta const &s3, double &energy, double &d1, double &d2, double &d3)
Definition ccl.cpp:422
void ro1_ro2(Rho const &s1, Rho const &s2, double &energy, double &d1, double &d2)
Definition ccl.cpp:368
void ro_2(Rho const &ro1, Rho const &ro2, double &energy, double &d1, double &d2)
Energy and derivatives for Term 1.
Definition ccl.cpp:361
void ro_4(Rho const &s1, Rho const &s2, double &energy, double &d1, double &d2)
Definition ccl.cpp:446
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:487
void ro_2_theta(Rho const &s1, Rho const &s2, Dtheta const &s3, double &energy, double &d1, double &d2, double &d3)
Definition ccl.cpp:414
void ro1_ro2_ro_2(Rho const &s1, Rho const &s2, double &energy, double &d1, double &d2)
Definition ccl.cpp:453
void ro_theta_2(Rho const &s1, Rho const &s2, Dtheta const &s3, double &energy, double &d1, double &d2, double &d3)
Definition ccl.cpp:430
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:495
void ro_ro1_ro2(Rho const &s1, Rho const &s2, double &energy, double &d1, double &d2)
Definition ccl.cpp:407
void ro1_2_ro2_2(Rho const &s1, Rho const &s2, double &energy, double &d1, double &d2)
Definition ccl.cpp:460

◆ ro1_2_ro2_2()

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

Definition at line 460 of file ccl.cpp.

461 {
462 energy += ro1_2_ro2_2_ * re2_ * ro1._2 * ro2._2;
463 d1 += ro1_2_ro2_2_ * re2_ * 2.0 * ro1._1 * ro2._2; // dE/drho1
464 d2 += ro1_2_ro2_2_ * re2_ * 2.0 * ro1._2 * ro2._1; // dE/drho2
465}

◆ ro1_ro2()

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

Definition at line 368 of file ccl.cpp.

369 {
370 energy += ro1_ro2_ * re2_ * ro1._1 * ro2._1;
371 d1 += ro1_ro2_ * re2_ * ro2._1;
372 d2 += ro1_ro2_ * re2_ * ro1._1;
373}

◆ ro1_ro2_ro_2()

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

Definition at line 453 of file ccl.cpp.

454 {
455 energy += ro1_ro2_ro_2_ * re2_ * ro1._1 * ro2._1 * (ro1._2 + ro2._2);
456 d1 += ro1_ro2_ro_2_ * re2_ * (3.0 * ro2._1 * ro1._2 + ro2._3); // dE/drho1
457 d2 += ro1_ro2_ro_2_ * re2_ * (3.0 * ro1._1 * ro2._2 + ro1._3); // dE/drho2
458}

◆ ro1_ro2_theta()

void 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 422 of file ccl.cpp.

423 {
424 energy += ro1_ro2_theta_ * re2_ * ro1._1 * ro2._1 * dth._1;
425 d1 += ro1_ro2_theta_ * re2_ * ro2._1 * dth._1; // dE/drho1
426 d2 += ro1_ro2_theta_ * re2_ * ro1._1 * dth._1; // dE/drho2
427 d3 += ro1_ro2_theta_ * re2_ * ro1._1 * ro2._1; // dE/d(theta)
428}

◆ ro1_ro2_theta_2()

void 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 495 of file ccl.cpp.

496 {
497 energy += ro1_ro2_theta_2_ * re2_ * ro1._1 * ro2._1 * dth._2;
498 d1 += ro1_ro2_theta_2_ * re2_ * ro2._1 * dth._2; // dE/drho1
499 d2 += ro1_ro2_theta_2_ * re2_ * ro1._1 * dth._2; // dE/drho2
500 d3 += ro1_ro2_theta_2_ * re2_ * ro1._1 * ro2._1 * 2.0 * dth._1; // dE/d(theta)
501}

◆ ro_2()

void 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 361 of file ccl.cpp.

362 {
363 energy += ro_2_ * re2_ * (ro1._2 + ro2._2) / 2.0;
364 d1 += ro_2_ * re2_ * ro1._1;
365 d2 += ro_2_ * re2_ * ro2._1;
366}

◆ ro_2_theta()

void 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 414 of file ccl.cpp.

415 {
416 energy += ro_2_theta_ * re2_ * (ro1._2 + ro2._2) * dth._1;
417 d1 += ro_2_theta_ * re2_ * 2.0 * ro1._1 * dth._1; // dE/drho1
418 d2 += ro_2_theta_ * re2_ * 2.0 * ro2._1 * dth._1; // dE/drho2
419 d3 += ro_2_theta_ * re2_ * (ro1._2 + ro2._2); // dE/d(theta)
420}

◆ ro_2_theta_2()

void 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 487 of file ccl.cpp.

488 {
489 energy += ro_2_theta_2_ * re2_ * (ro1._2 + ro2._2) * dth._2;
490 d1 += ro_2_theta_2_ * re2_ * 2.0 * ro1._1 * dth._2; // dE/drho1
491 d2 += ro_2_theta_2_ * re2_ * 2.0 * ro2._1 * dth._2; // dE/drho2
492 d3 += ro_2_theta_2_ * re2_ * 2.0 * (ro1._2 + ro2._2) * dth._1; // dE/d(theta)
493}

◆ ro_3()

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

Definition at line 400 of file ccl.cpp.

401 {
402 energy += ro_3_ * re2_ * (ro1._3 + ro2._3);
403 d1 += 3.0 * ro_3_ * re2_ * ro1._2;
404 d2 += 3.0 * ro_3_ * re2_ * ro2._2;
405}

◆ ro_3_theta()

void 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 467 of file ccl.cpp.

468 {
469 energy += ro_3_theta_ * re2_ * (ro1._3 + ro2._3) * dth._1;
470 d1 += ro_3_theta_ * re2_ * 3.0 * ro1._2 * dth._1; // dE/drho1
471 d2 += ro_3_theta_ * re2_ * 3.0 * ro2._2 * dth._1; // dE/drho2
472 d3 += ro_3_theta_ * re2_ * (ro1._3 + ro2._3); // dE/d(theta)
473}

◆ ro_4()

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

Definition at line 446 of file ccl.cpp.

447 {
448 energy += ro_4_ * re2_ * (ro1._2 * ro1._2 + ro2._2 * ro2._2);
449 d1 += ro_4_ * re2_ * 4.0 * ro1._3; // dE/drho1
450 d2 += ro_4_ * re2_ * 4.0 * ro2._3; // dE/drho2
451}

◆ ro_ro1_ro2()

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

Definition at line 407 of file ccl.cpp.

408 {
409 energy += ro_ro1_ro2_ * re2_ * (ro1._1 + ro2._1) * ro1._1 * ro2._1;
410 d1 += ro_ro1_ro2_ * re2_ * (2.0 * ro1._1 * ro2._1 + ro2._2);
411 d2 += ro_ro1_ro2_ * re2_ * (2.0 * ro1._1 * ro2._1 + ro1._2);
412}

◆ ro_ro1_ro2_theta()

void 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 475 of file ccl.cpp.

476 {
477 energy +=
478 ro_ro1_ro2_theta_ * re2_ * (ro1._1 + ro2._1) * ro1._1 * ro2._1 * dth._1;
479 d1 += ro_ro1_ro2_theta_ * re2_ * (2.0 * ro1._1 * ro2._1 + ro2._2) *
480 dth._1; // dE/drho1
481 d2 += ro_ro1_ro2_theta_ * re2_ * (2.0 * ro1._1 * ro2._1 + ro1._2) *
482 dth._1; // dE/drho2
483 d3 += ro_ro1_ro2_theta_ * re2_ * (ro1._1 + ro2._1) * ro1._1 *
484 ro2._1; // dE/d(theta)
485}

◆ ro_theta()

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

Definition at line 375 of file ccl.cpp.

376 {
377 energy += ro_theta_ * re2_ * (ro1._1 + ro2._1) * dth._1;
378 d1 += ro_theta_ * re2_ * dth._1; // dE/drho1
379 d2 += ro_theta_ * re2_ * dth._1; // dE/drho2
380 d3 += ro_theta_ * re2_ * (ro1._1 + ro2._1); // dE/d(theta)
381}

◆ ro_theta_2()

void 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 430 of file ccl.cpp.

431 {
432 energy += ro_theta_2_ * re2_ * (ro1._1 + ro2._1) * dth._2;
433 d1 += ro_theta_2_ * re2_ * dth._2; // dE/drho1
434 d2 += ro_theta_2_ * re2_ * dth._2; // dE/drho2
435 d3 += ro_theta_2_ * re2_ * (ro1._1 + ro2._1) * 2.0 * dth._1; // dE/d(theta)
436}

◆ theta_2()

void 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 392 of file ccl.cpp.

392 {
393 energy += theta_2_ * re2_ * dth._2 / 2.0;
394 d3 += theta_2_ * re2_ * dth._1; // dE/d(theta)= - moment
395}

◆ theta_3()

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

Definition at line 438 of file ccl.cpp.

438 {
439 energy += thetat_3_ * re2_ * dth._3;
440 d3 += thetat_3_ * re2_ * 3.0 * dth._2; // dE/d(theta)
441}

◆ theta_4()

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

Definition at line 504 of file ccl.cpp.

504 {
505 energy += theta_4_ * re2_ * dth._2 * dth._2;
506 d3 += theta_4_ * re2_ * 4.0 * dth._3; // dE/d(theta)
507}

Member Data Documentation

◆ re_

double const Ccl::re_ = ::re_
staticprotected

Distance OH at equilibrium.

Definition at line 56 of file ccl.hpp.

◆ thetae_

double const 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