Loading...
Searching...
No Matches
zhu_philpott.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 <vector>
22
23namespace forcefields {
24template <class P = zhu_philpott_parameters::Standard>
25class ZhuPhilpott : public SpceCcl, private P {
26public:
28 ZhuPhilpott(double cutoff, double switchingWidth);
29 ZhuPhilpott(ZhuPhilpott const &);
30 void operator=(ZhuPhilpott const &);
32 void computeHH_O_Pt_(const int nWater, const int nPt, const double r[],
33 double f[], double &energy, double const b[],
34 bool const fixed[]);
35 void computeHH_O_(const int nWater, const double r[], double f[],
36 double &energy, double const b[], bool const fixed[]);
37 int nPlatinum() const;
38 void setPlatinum(int nPlatinum, double const positions[]);
39 static char const *getName();
40
41private:
42 template <int H, int O, int H3, int O3>
43 void computeTemplate(const int nWater, const double (*const rh1)[H3],
44 const double (*const rh2)[H3],
45 const double (*const ro)[O3], double (*const fh1)[H3],
46 double (*const fh2)[H3], double (*const fo)[O3],
47 const int nPt, const double rPt[][3], double fPt[][3],
48 double &energy, double const b[],
49 bool const (*const xh1)[H] = 0,
50 bool const (*const xh2)[H] = 0,
51 bool const (*const xo)[O] = 0, bool const *xPt = 0);
52 void interactWithCorePt(Water &water, int const nPt, double const rPt[][3],
53 double fPt[][3], double &energy);
54 void interactionPtO(double const R1[], double const R2[], double F1[],
55 double F2[], double &energy);
56 void interactionPtH(double const R1[], double const R2[], double F1[],
57 double F2[], double &energy);
58 void anisotropic(const double distance[], double force[], double &energy,
59 double const epsilon, double const sigma,
60 double const alpha);
61 void isotropic10(double const distance, double &force, double &energy,
62 double const epsilon, double const sigma, double const C10);
63 void interactWithImage(Water &w1, Water &w2, double &U);
64 void coulombWithCutoff(Water &w1, Water &w2, double &u,
65 double const relativePermittivity);
66 void coulombFull(Water &w1, Water &w2, double &U,
67 double const relativePermittivity);
68 int nPlatinum_{0};
69 std::vector<double> positions_;
70 std::vector<double> forces_;
71};
74} // namespace forcefields
static double sigma(double const A, double const B)
Conversion for Lennard-Jones.
void distance(const double x[], const double y[], double z[], double &z1, double &z2)
Distance vector, norm and norm square.
static double epsilon(double const A, double const B)
Conversion for Lennard-Jones.
Forcefield for water and platinum interactions.
std::vector< double > positions_
void computeHH_O_(const int nWater, const double r[], double f[], double &energy, double const b[], bool const fixed[])
Compute water-platinum interactions, call with water's positions only.
void operator=(ZhuPhilpott const &)
void coulombFull(Water &w1, Water &w2, double &U, double const relativePermittivity)
Coulomb interaction between two molecules with cutoff.
int nPlatinum() const
Number of platinum atoms.
void interactWithCorePt(Water &water, int const nPt, double const rPt[][3], double fPt[][3], double &energy)
Interaction of one molecule of water with the whole platinum.
void anisotropic(const double distance[], double force[], double &energy, double const epsilon, double const sigma, double const alpha)
Anisotropic interaction between water and platinum.
void computeTemplate(const int nWater, const double(*const rh1)[H3], const double(*const rh2)[H3], const double(*const ro)[O3], double(*const fh1)[H3], double(*const fh2)[H3], double(*const fo)[O3], const int nPt, const double rPt[][3], double fPt[][3], double &energy, double const b[], bool const (*const xh1)[H]=0, bool const (*const xh2)[H]=0, bool const (*const xo)[O]=0, bool const *xPt=0)
void interactWithImage(Water &w1, Water &w2, double &U)
Interactions of a molecule with an image.
void setPlatinum(int nPlatinum, double const positions[])
Initialises the positions of the atoms of platinum.
void coulombWithCutoff(Water &w1, Water &w2, double &u, double const relativePermittivity)
Coulomb interaction between two molecules within the swithcing zone.
void isotropic10(double const distance, double &force, double &energy, double const epsilon, double const sigma, double const C10)
Isotropic interaction between water and platinum.
void interactionPtH(double const R1[], double const R2[], double F1[], double F2[], double &energy)
static char const * getName()
Name of the potential.
void interactionPtO(double const R1[], double const R2[], double F1[], double F2[], double &energy)
void computeHH_O_Pt_(const int nWater, const int nPt, const double r[], double f[], double &energy, double const b[], bool const fixed[])
Compute water-platinum forcefield.
std::vector< double > forces_
SPC/E potential for water.
Pointers to molecule of water.
Definition spce_ccl.hpp:78
Parameters for potential ZhuPhilpott.