Debian Codegraph @

avogadro/qtplugins/qtaim/qtaimodeintegrator.h

raw
1 /******************************************************************************
2
3 This source file is part of the Avogadro project.
4
5 Copyright (C) 2010 Eric C. Brown
6
7 This source code is released under the New BSD License, (the "License").
8
9 Unless required by applicable law or agreed to in writing, software
10 distributed under the License is distributed on an "AS IS" BASIS,
11 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 See the License for the specific language governing permissions and
13 limitations under the License.
14
15 ******************************************************************************/
16
17 #ifndef QTAIMODEINTEGRATOR_H
18 #define QTAIMODEINTEGRATOR_H
19
20 #include "qtaimwavefunctionevaluator.h"
21
22 #include <QDebug>
23 #include <QList>
24 #include <QPair>
25 #include <QVector3D>
26
27 #include <Eigen/Core>
28
29 namespace Avogadro::QtPlugins {
30
31 class QTAIMODEIntegrator
32 {
33
34 public:
35 enum
36 {
37 SteepestAscentPathInElectronDensity = 0,
38 CMBPMinusThreeGradientInElectronDensity = 1,
39 CMBPMinusOneGradientInElectronDensity = 2,
40 CMBPPlusOneGradientInElectronDensity = 3,
41 CMBPPlusThreeGradientInElectronDensity = 4,
42 CMBPMinusThreeGradientInElectronDensityLaplacian = 5,
43 CMBPMinusOneGradientInElectronDensityLaplacian = 6,
44 CMBPPlusOneGradientInElectronDensityLaplacian = 7,
45 CMBPPlusThreeGradientInElectronDensityLaplacian = 8
46 };
47
48 explicit QTAIMODEIntegrator(QTAIMWavefunctionEvaluator& eval,
49 const qint64 mode);
50
51 QVector3D integrate(QVector3D x0y0z0);
52
53 qint64 status() const { return m_status; }
54 const QList<QVector3D> path() const { return m_path; }
55
56 void setBetaSpheres(QList<QPair<QVector3D, qreal>> betaSpheres)
57 {
58 m_betaSpheres = betaSpheres;
59 }
60 qint64 associatedSphere() const { return m_associatedSphere; }
61
62 private:
63 QTAIMWavefunctionEvaluator* m_eval;
64 qint64 m_mode;
65
66 qint64 m_status;
67 QList<QVector3D> m_path;
68
69 QList<QPair<QVector3D, qreal>> m_betaSpheres;
70 qint64 m_associatedSphere;
71
72 // ODE integrator
73 qreal r8_abs(qreal x);
74 qreal r8_epsilon();
75 void r8_fehl(qint64 neqn, qreal y[], qreal t, qreal h, qreal yp[], qreal f1[],
76 qreal f2[], qreal f3[], qreal f4[], qreal f5[], qreal s[]);
77 qreal r8_max(qreal x, qreal y);
78 qreal r8_min(qreal x, qreal y);
79 qint64 r8_rkf45(qint64 neqn, qreal y[], qreal yp[], qreal* t, qreal tout,
80 qreal* relerr, qreal abserr, qint64 flag);
81 qreal r8_sign(qreal x);
82
83 void r8_f(qreal t, qreal y[], qreal yp[]);
84
85 qreal abserr_save;
86 qint64 flag_save;
87 qreal h;
88 qint64 init;
89 qint64 kflag;
90 qint64 kop;
91 qint64 nfe;
92 qreal relerr_save;
93 qreal remin;
94 };
95
96 } // namespace Avogadro::QtPlugins
97
98 #endif // QTAIMODEINTEGRATOR_H