ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/branches/new_design/OOPSE-3.0/src/integrators/NPT.hpp
Revision: 1822
Committed: Thu Dec 2 02:08:29 2004 UTC (19 years, 7 months ago) by tim
File size: 4806 byte(s)
Log Message:
oopse get compiled, still has some linking problem

File Contents

# User Rev Content
1 tim 1762 /*
2     * Copyright (C) 2000-2004 Object Oriented Parallel Simulation Engine (OOPSE) project
3     *
4     * Contact: oopse@oopse.org
5     *
6     * This program is free software; you can redistribute it and/or
7     * modify it under the terms of the GNU Lesser General Public License
8     * as published by the Free Software Foundation; either version 2.1
9     * of the License, or (at your option) any later version.
10     * All we ask is that proper credit is given for our work, which includes
11     * - but is not limited to - adding the above copyright notice to the beginning
12     * of your source code files, and to any copyright notice that you may distribute
13     * with programs based on this work.
14     *
15     * This program is distributed in the hope that it will be useful,
16     * but WITHOUT ANY WARRANTY; without even the implied warranty of
17     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18     * GNU Lesser General Public License for more details.
19     *
20     * You should have received a copy of the GNU Lesser General Public License
21     * along with this program; if not, write to the Free Software
22     * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23     *
24     */
25    
26     /**
27     * @file NPT.hpp
28     * @author tlin
29     * @date 11/19/2004
30     * @time 13:25am
31     * @version 1.0
32     */
33    
34     #ifndef INTEGRATORS_NPT_HPP
35     #define INTEGRATORS_NPT_HPP
36    
37     #include "integrators/VelocityVerletIntegrator.hpp"
38    
39     namespace oopse {
40     class NPT : public VelocityVerletIntegrator {
41     public:
42    
43 tim 1822 NPT(SimInfo * info);
44     virtual ~NPT();
45 tim 1762
46 tim 1774
47     int getMaxIterationNumber() {
48     return maxIterNum_;
49 tim 1762 }
50    
51 tim 1774 void setMaxIterationNumber(int maxIter) {
52     maxIterNum_ = maxIter;
53     }
54     double getTauThermostat() {
55 tim 1762 return tauThermostat;
56     }
57    
58     void setTauThermostat(double tt) {
59     tauThermostat = tt;
60     }
61    
62 tim 1774 double getTauBarostat() {
63     return tauBarostat;
64     }
65 tim 1762 void setTauBarostat(double tb) {
66     tauBarostat = tb;
67     }
68    
69 tim 1774 double getTargetTemp() {
70     return targetTemp;
71     }
72    
73 tim 1762 void setTargetTemp(double tt) {
74     targetTemp = tt;
75     }
76    
77 tim 1774 double getTargetPressure() {
78     return targetTemp;
79     }
80    
81 tim 1762 void setTargetPressure(double tp) {
82     targetPressure = tp;
83     }
84    
85 tim 1774 double getChiTolerance() {
86     return chiTolerance;
87     }
88    
89 tim 1762 void setChiTolerance(double tol) {
90     chiTolerance = tol;
91     }
92    
93 tim 1774 double getEtaTolerance() {
94     return etaTolerance;
95 tim 1762 }
96 tim 1774
97 tim 1762 void setEtaTolerance(double tol) {
98     etaTolerance = tol;
99     }
100    
101     protected:
102    
103 tim 1822 virtual void integrateStep() {
104     needStress= true;
105     VelocityVerletIntegrator::integrateStep();
106 tim 1774 }
107 tim 1822
108     virtual void doUpdate();
109 tim 1774
110     double NkBT;
111     double fkBT;
112 tim 1762
113 tim 1774 double tt2;
114     double tb2;
115    
116     double instaTemp;
117     double instaPress;
118     double instaVol;
119 tim 1762
120 tim 1822
121 tim 1774 // targetTemp, targetPressure, and tauBarostat must be set.
122     // One of qmass or tauThermostat must be set;
123 tim 1762
124 tim 1774 double targetTemp;
125     double targetPressure;
126     double tauThermostat;
127     double tauBarostat;
128 tim 1762
129 tim 1774 std::vector<Vector3d> oldPos;
130     std::vector<Vector3d> oldVel;
131     std::vector<Vector3d> oldJi;
132    
133     double etaTolerance;
134 tim 1822
135     double chi;
136     double integralOfChidt;
137     Mat3x3d press;
138 tim 1774
139     private:
140    
141     virtual void moveA();
142     virtual void moveB();
143    
144     virtual void getVelScaleA(Vector3d& sc, const Vector3d& vel) = 0;
145 tim 1822
146 tim 1774 virtual void getVelScaleB(Vector3d& sc, int index) = 0;
147 tim 1822
148     virtual void getPosScale(const Vector3d& pos, const Vector3d& COM,
149     int index, Vector3d& sc) = 0;
150    
151 tim 1762 virtual void calcVelScale() = 0;
152    
153     virtual bool etaConverged() = 0;
154    
155     virtual void evolveEtaA() = 0;
156 tim 1822
157 tim 1762 virtual void evolveEtaB() = 0;
158    
159     virtual void scaleSimBox() = 0;
160 tim 1774
161     virtual double calcConservedQuantity() = 0;
162 tim 1822
163     virtual void loadEta() = 0;
164     virtual void saveEta() = 0;
165 tim 1774
166     int maxIterNum_;
167 tim 1762
168 tim 1822 double chiTolerance;
169 tim 1762 };
170    
171     } //end namespace oopse
172    
173     #endif //INTEGRATORS_NPT_HPP