OpenMD 3.0
Molecular Dynamics in the Open
Loading...
Searching...
No Matches
NPT.hpp
Go to the documentation of this file.
1/*
2 * Copyright (c) 2004-present, The University of Notre Dame. All rights
3 * reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 *
8 * 1. Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer.
10 *
11 * 2. Redistributions in binary form must reproduce the above copyright notice,
12 * this list of conditions and the following disclaimer in the documentation
13 * and/or other materials provided with the distribution.
14 *
15 * 3. Neither the name of the copyright holder nor the names of its
16 * contributors may be used to endorse or promote products derived from
17 * this software without specific prior written permission.
18 *
19 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
23 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE.
30 *
31 * SUPPORT OPEN SCIENCE! If you use OpenMD or its source code in your
32 * research, please cite the appropriate papers when you publish your
33 * work. Good starting points are:
34 *
35 * [1] Meineke, et al., J. Comp. Chem. 26, 252-271 (2005).
36 * [2] Fennell & Gezelter, J. Chem. Phys. 124, 234104 (2006).
37 * [3] Sun, Lin & Gezelter, J. Chem. Phys. 128, 234107 (2008).
38 * [4] Vardeman, Stocker & Gezelter, J. Chem. Theory Comput. 7, 834 (2011).
39 * [5] Kuang & Gezelter, Mol. Phys., 110, 691-701 (2012).
40 * [6] Lamichhane, Gezelter & Newman, J. Chem. Phys. 141, 134109 (2014).
41 * [7] Lamichhane, Newman & Gezelter, J. Chem. Phys. 141, 134110 (2014).
42 * [8] Bhattarai, Newman & Gezelter, Phys. Rev. B 99, 094106 (2019).
43 */
44
45/**
46 * @file NPT.hpp
47 * @author tlin
48 * @date 11/19/2004
49 * @version 1.0
50 */
51
52#ifndef INTEGRATORS_NPT_HPP
53#define INTEGRATORS_NPT_HPP
54
55#include "integrators/VelocityVerletIntegrator.hpp"
56
57namespace OpenMD {
59 public:
60 NPT(SimInfo* info);
61
62 int getMaxIterationNumber() { return maxIterNum_; }
63
64 void setMaxIterationNumber(int maxIter) { maxIterNum_ = maxIter; }
65 RealType getTauThermostat() { return tauThermostat; }
66
67 void setTauThermostat(RealType tt) { tauThermostat = tt; }
68
69 RealType getTauBarostat() { return tauBarostat; }
70 void setTauBarostat(RealType tb) { tauBarostat = tb; }
71
72 RealType getTargetTemp() { return targetTemp; }
73
74 void setTargetTemp(RealType tt) { targetTemp = tt; }
75
76 RealType getTargetPressure() { return targetTemp; }
77
78 void setTargetPressure(RealType tp) { targetPressure = tp; }
79
80 RealType getChiTolerance() { return chiTolerance; }
81
82 void setChiTolerance(RealType tol) { chiTolerance = tol; }
83
84 RealType getEtaTolerance() { return etaTolerance; }
85
86 void setEtaTolerance(RealType tol) { etaTolerance = tol; }
87
88 protected:
89 virtual void step() {
90 needVirial = true;
92 }
93
94 virtual void doUpdateSizes();
95
96 virtual void resetIntegrator();
97
98 virtual void resetEta();
99
100 RealType NkBT;
101 RealType fkBT;
102
103 RealType tt2;
104 RealType tb2;
105
106 RealType instaTemp;
107 RealType instaPress;
108 RealType instaVol;
109
110 // targetTemp, targetPressure, and tauBarostat must be set.
111 // One of qmass or tauThermostat must be set;
112
113 RealType targetTemp;
114 RealType targetPressure;
115 RealType tauThermostat;
116 RealType tauBarostat;
117
118 std::vector<Vector3d> oldPos;
119 std::vector<Vector3d> oldVel;
120 std::vector<Vector3d> oldJi;
121
122 RealType etaTolerance;
123
124 pair<RealType, RealType> thermostat;
125 Mat3x3d press;
126
127 private:
128 virtual void moveA();
129 virtual void moveB();
130
131 virtual void getVelScaleA(Vector3d& sc, const Vector3d& vel) = 0;
132
133 virtual void getVelScaleB(Vector3d& sc, int index) = 0;
134
135 virtual void getPosScale(const Vector3d& pos, const Vector3d& COM,
136 int index, Vector3d& sc) = 0;
137
138 virtual void calcVelScale() = 0;
139
140 virtual bool etaConverged() = 0;
141
142 virtual void evolveEtaA() = 0;
143
144 virtual void evolveEtaB() = 0;
145
146 virtual void scaleSimBox() = 0;
147
148 virtual RealType calcConservedQuantity() = 0;
149
150 virtual void loadEta() = 0;
151 virtual void saveEta() = 0;
152 RealType chiTolerance;
153
154 protected:
155 int maxIterNum_;
156 };
157} // namespace OpenMD
158
159#endif // INTEGRATORS_NPT_HPP
virtual void step()
Computes an integration step from t to t+dt.
Definition NPT.hpp:89
One of the heavy-weight classes of OpenMD, SimInfo maintains objects and variables relating to the cu...
Definition SimInfo.hpp:93
virtual void step()
Computes an integration step from t to t+dt.
This basic Periodic Table class was originally taken from the data.cpp file in OpenBabel.