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), rh2_(rh2), ro_(ro), rc_(rc), fh1_(fh1), fh2_(fh2),
82 fo_(fo) {}
83 Water(Water const &w, double fh1[], double fh2[], double fo[])
84 : rh1_(w.rh1_), rh2_(w.rh2_), ro_(w.ro_), rc_(w.rc_), fh1_(fh1),
85 fh2_(fh2), fo_(fo) {}
86 void addForces(Water const &w) {
87 for (int a = 0; a < 3; ++a) {
88 fh1_[a] += w.fh1_[a];
89 fh2_[a] += w.fh2_[a];
90 fo_[a] += w.fo_[a];
91 };
92 }
93 const double *const rh1_;
94 const double *const rh2_;
95 const double *const ro_;
96 const double *const rc_;
97 double *const fh1_;
98 double *const fh2_;
99 double *const fo_;
100 };
101
107 void intramolecular(Water &water, double &U);
108
116 void lennardJonesWithCutoff(Water &w1, Water &w2, double &U);
117
126 void coulombWithCutoff(Water &w1, Water &w2, double &U);
127
136 void coulombFull(Water &w1, Water &w2, double &U);
137
139 static const double roh_;
141 static const double theta_;
143 static const double rhh_;
145 static const double charge_;
147 static const double charge2_;
150 static const double A_;
153 static const double B_;
155 static const double sigma_;
157 static const double epsilon_;
160 static double const polarisationEnergy_;
161
162private:
173 void initialiseRho(Vector3 const &v, Rho &r);
174
192 template <int H, int O>
193 void computeTemplate(const int nMolecules, const double (*const rh1)[H * 3],
194 const double (*const rh2)[H * 3],
195 const double (*const ro)[O * 3],
196 double (*const fh1)[H * 3], double (*const fh2)[H * 3],
197 double (*const fo)[O * 3], double &energy,
198 double const b[], bool const (*const xh1)[H] = 0,
199 bool const (*const xh2)[H] = 0,
200 bool const (*const xo)[O] = 0);
201};
202} // namespace forcefields
Potential CCL Table II for intramolecular interactions in water.
static const double A_
Lennard-Jones.
Definition spce_ccl.hpp:150
void initialiseRho(Vector3 const &v, Rho &r)
Initialise Rho.
Definition spce_ccl.cpp:148
static const double roh_
Distance OH.
Definition spce_ccl.hpp:139
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:145
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:141
static const double rhh_
Distance HH.
Definition spce_ccl.hpp:143
static const double charge2_
Square of # charge_.
Definition spce_ccl.hpp:147
static const double sigma_
Lennard-Jones. See PotentialBase::lennardJones() for definition.
Definition spce_ccl.hpp:155
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:160
static const double epsilon_
Lennard-Jones. See PotentialBase::lennardJones() for definition.
Definition spce_ccl.hpp:157
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:153
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:93
void addForces(Water const &w)
Definition spce_ccl.hpp:86
const double *const ro_
Definition spce_ccl.hpp:95
const double *const rc_
Definition spce_ccl.hpp:96
Water(Water const &w, double fh1[], double fh2[], double fo[])
Definition spce_ccl.hpp:83
const double *const rh2_
Definition spce_ccl.hpp:94
Water(double const rh1[], double const rh2[], double const ro[], double const rc[], double fh1[], double fh2[], double fo[])
Definition spce_ccl.hpp:79