Loading...
Searching...
No Matches
spce_ccl.hpp
Go to the documentation of this file.
1/*
2** This file is part of eOn.
3**
4** SPDX-License-Identifier: BSD-3-Clause
5**
6** Copyright (c) 2010--present, eOn Development Team
7** All rights reserved.
8**
9** Repo:
10** https://github.com/TheochemUI/eOn
11*/
12#pragma once
13#include "ccl.hpp"
20
21namespace forcefields {
36class SpceCcl : public Ccl {
37public:
38 SpceCcl();
39 SpceCcl(double cutoff, double switchingWidth);
40
53 void computeHH_O_(const int nAtoms, const double R[], double F[], double &U,
54 const double b[]);
55
69 void computeHH_O_(const int nAtoms, const double R[], double F[], double &U,
70 const double b[], const bool fixed[]);
71
72 char const *getName() const;
73
74protected:
78 struct Water {
79 Water(double const rh1[], double const rh2[], double const ro[],
80 double const rc[], double fh1[], double fh2[], double fo[])
81 : rh1_(rh1),
82 rh2_(rh2),
83 ro_(ro),
84 rc_(rc),
85 fh1_(fh1),
86 fh2_(fh2),
87 fo_(fo) {}
88 Water(Water const &w, double fh1[], double fh2[], double fo[])
89 : rh1_(w.rh1_),
90 rh2_(w.rh2_),
91 ro_(w.ro_),
92 rc_(w.rc_),
93 fh1_(fh1),
94 fh2_(fh2),
95 fo_(fo) {}
96 void addForces(Water const &w) {
97 for (int a = 0; a < 3; ++a) {
98 fh1_[a] += w.fh1_[a];
99 fh2_[a] += w.fh2_[a];
100 fo_[a] += w.fo_[a];
101 };
102 }
103 const double *const rh1_;
104 const double *const rh2_;
105 const double *const ro_;
106 const double *const rc_;
107 double *const fh1_;
108 double *const fh2_;
109 double *const fo_;
110 };
111
117 void intramolecular(Water &water, double &U);
118
126 void lennardJonesWithCutoff(Water &w1, Water &w2, double &U);
127
136 void coulombWithCutoff(Water &w1, Water &w2, double &U);
137
146 void coulombFull(Water &w1, Water &w2, double &U);
147
149 static const double roh_;
151 static const double theta_;
153 static const double rhh_;
155 static const double charge_;
157 static const double charge2_;
160 static const double A_;
163 static const double B_;
165 static const double sigma_;
167 static const double epsilon_;
170 static double const polarisationEnergy_;
171
172private:
183 void initialiseRho(Vector3 const &v, Rho &r);
184
202 template <int H, int O>
203 void computeTemplate(const int nMolecules, const double (*const rh1)[H * 3],
204 const double (*const rh2)[H * 3],
205 const double (*const ro)[O * 3],
206 double (*const fh1)[H * 3], double (*const fh2)[H * 3],
207 double (*const fo)[O * 3], double &energy,
208 double const b[], bool const (*const xh1)[H] = 0,
209 bool const (*const xh2)[H] = 0,
210 bool const (*const xo)[O] = 0);
211};
212} // namespace forcefields
Potential CCL Table II for intramolecular interactions in water.
static const double A_
Lennard-Jones.
Definition spce_ccl.hpp:160
void initialiseRho(Vector3 const &v, Rho &r)
Initialise Rho.
Definition spce_ccl.cpp:148
static const double roh_
Distance OH.
Definition spce_ccl.hpp:149
void coulombWithCutoff(Water &w1, Water &w2, double &U)
Interactions between two molecules.
Definition spce_ccl.cpp:104
void intramolecular(Water &water, double &U)
Interactions within a molecules.
Definition spce_ccl.cpp:159
static const double charge_
Charge on one hydrogen.
Definition spce_ccl.hpp:155
void lennardJonesWithCutoff(Water &w1, Water &w2, double &U)
Interactions between two molecules.
Definition spce_ccl.cpp:86
char const * getName() const
Name of the potential.
Definition spce_ccl.cpp:84
static const double theta_
Angle HOH.
Definition spce_ccl.hpp:151
static const double rhh_
Distance HH.
Definition spce_ccl.hpp:153
static const double charge2_
Square of # charge_.
Definition spce_ccl.hpp:157
static const double sigma_
Lennard-Jones. See PotentialBase::lennardJones() for definition.
Definition spce_ccl.hpp:165
void coulombFull(Water &w1, Water &w2, double &U)
Interactions between two molecules.
Definition spce_ccl.cpp:133
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 spce_ccl.cpp:175
static double const polarisationEnergy_
Polarisation correction.
Definition spce_ccl.hpp:170
static const double epsilon_
Lennard-Jones. See PotentialBase::lennardJones() for definition.
Definition spce_ccl.hpp:167
void computeHH_O_(const int nAtoms, const double R[], double F[], double &U, const double b[])
Compute the forces and the energy.
Definition spce_ccl.cpp:62
static const double B_
Lennard-Jones.
Definition spce_ccl.hpp:163
parameter in paper.
Definition ccl.hpp:36
Pointers to molecule of water.
Definition spce_ccl.hpp:78
const double *const rh1_
Definition spce_ccl.hpp:103
void addForces(Water const &w)
Definition spce_ccl.hpp:96
const double *const ro_
Definition spce_ccl.hpp:105
const double *const rc_
Definition spce_ccl.hpp:106
Water(Water const &w, double fh1[], double fh2[], double fo[])
Definition spce_ccl.hpp:88
const double *const rh2_
Definition spce_ccl.hpp:104
Water(double const rh1[], double const rh2[], double const ro[], double const rc[], double fh1[], double fh2[], double fo[])
Definition spce_ccl.hpp:79