-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathdftd_eeq.h
119 lines (108 loc) · 3 KB
/
dftd_eeq.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
/* This file is part of cpp-d4.
*
* Copyright (C) 2019 Sebastian Ehlert, Marvin Friede
*
* cpp-d4 is free software: you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* cpp-d4 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with cpp-d4. If not, see <https://www.gnu.org/licenses/>.
*/
/**
* Electronegativity equilibration (EEQ) model for DFT-D4
*/
#pragma once
#include "dftd_geometry.h"
#include "dftd_matrix.h"
namespace dftd4 {
/**
* Get the EEQ charges for a given molecule.
*
* @param mol The molecule object
* @param dist The distance matrix
* @param charge The total charge of the molecule
* @param cutoff The cutoff for the EEQ coordination number
* @param q The EEQ charges
* @param dqdr The derivative of the EEQ charges
* @param lgrad Flag for the gradient
*
* @return 0 if successful, 1 otherwise
*/
extern int get_charges(
const TMolecule &mol,
const TMatrix<double> &dist,
int charge,
double cutoff,
TVector<double> &q,
TMatrix<double> &dqdr,
bool lgrad
);
/**
* Get the EEQ charges for a given molecule for the atoms specified by the
* indices in `realIdx`.
*
* @param mol The molecule object
* @param realIdx The real atom indices (for excluding dummy atoms)
* @param dist The distance matrix
* @param charge The total charge of the molecule
* @param cutoff The cutoff for the EEQ coordination number
* @param q The EEQ charges
* @param dqdr The derivative of the EEQ charges
* @param lgrad Flag for the gradient
*
* @return 0 if successful, 1 otherwise
*/
extern int get_charges(
const TMolecule &mol,
const TIVector &realIdx,
const TMatrix<double> &dist,
int charge,
double cutoff,
TVector<double> &q,
TMatrix<double> &dqdr,
bool lgrad
);
extern int get_vrhs(
const TMolecule &mol,
const TIVector &realIdx,
const int &charge,
const TVector<double> &cn,
TVector<double> &Xvec,
TVector<double> &dXvec,
bool lgrad
);
extern int get_amat_0d(
const TMolecule &mol,
const TIVector &realIdx,
const TMatrix<double> &dist,
TMatrix<double> &Amat
);
extern int get_damat_0d(
const TMolecule &mol,
const TIVector &realIdx,
const TMatrix<double> &dist,
const TVector<double> &q,
const TMatrix<double> &Amat,
TMatrix<double> &dAmat,
TMatrix<double> &atrace
);
extern int eeq_chrgeq(
const TMolecule &mol,
const TIVector &realIdx,
const TMatrix<double> &dist,
const int &charge,
const TVector<double> &cn,
TVector<double> &qvec,
TMatrix<double> &dcndr,
TMatrix<double> &dqdr,
bool lgrad = false,
bool lverbose = false
);
} // namespace dftd4