1 |
|
#include <math.h> |
2 |
+ |
#include "MatVec3.h" |
3 |
|
#include "Atom.hpp" |
4 |
|
#include "SRI.hpp" |
5 |
|
#include "AbstractClasses.hpp" |
117 |
|
} |
118 |
|
} |
119 |
|
|
120 |
< |
template<typename T> void NPTxyz<T>::getVelScaleA(double sc[3], double vel[3]) { |
120 |
> |
template<typename T> void NPTxyz<T>::calcVelScale(void) { |
121 |
|
int i,j; |
121 |
– |
double vScale[3][3]; |
122 |
|
|
123 |
|
for (i = 0; i < 3; i++ ) { |
124 |
|
for (j = 0; j < 3; j++ ) { |
129 |
|
} |
130 |
|
} |
131 |
|
} |
132 |
+ |
} |
133 |
|
|
134 |
< |
info->matVecMul3( vScale, vel, sc ); |
134 |
> |
template<typename T> void NPTxyz<T>::getVelScaleA(double sc[3], double vel[3]) { |
135 |
> |
matVecMul3( vScale, vel, sc ); |
136 |
|
} |
137 |
|
|
138 |
|
template<typename T> void NPTxyz<T>::getVelScaleB(double sc[3], int index ){ |
139 |
< |
int i,j; |
139 |
> |
int j; |
140 |
|
double myVel[3]; |
139 |
– |
double vScale[3][3]; |
141 |
|
|
141 |
– |
for (i = 0; i < 3; i++ ) { |
142 |
– |
for (j = 0; j < 3; j++ ) { |
143 |
– |
vScale[i][j] = eta[i][j]; |
144 |
– |
|
145 |
– |
if (i == j) { |
146 |
– |
vScale[i][j] += chi; |
147 |
– |
} |
148 |
– |
} |
149 |
– |
} |
150 |
– |
|
142 |
|
for (j = 0; j < 3; j++) |
143 |
|
myVel[j] = oldVel[3*index + j]; |
144 |
|
|
145 |
< |
info->matVecMul3( vScale, myVel, sc ); |
145 |
> |
matVecMul3( vScale, myVel, sc ); |
146 |
|
} |
147 |
|
|
148 |
|
template<typename T> void NPTxyz<T>::getPosScale(double pos[3], double COM[3], |
153 |
|
for(j=0; j<3; j++) |
154 |
|
rj[j] = ( oldPos[index*3+j] + pos[j]) / 2.0 - COM[j]; |
155 |
|
|
156 |
< |
info->matVecMul3( eta, rj, sc ); |
156 |
> |
matVecMul3( eta, rj, sc ); |
157 |
|
} |
158 |
|
|
159 |
|
template<typename T> void NPTxyz<T>::scaleSimBox( void ){ |
234 |
|
simError(); |
235 |
|
} else { |
236 |
|
info->getBoxM(hm); |
237 |
< |
info->matMul3(hm, scaleMat, hmnew); |
237 |
> |
matMul3(hm, scaleMat, hmnew); |
238 |
|
info->setBoxM(hmnew); |
239 |
|
} |
240 |
|
} |
270 |
|
|
271 |
|
thermostat_potential = fkBT* integralOfChidt / eConvert; |
272 |
|
|
273 |
< |
info->transposeMat3(eta, a); |
274 |
< |
info->matMul3(a, eta, b); |
275 |
< |
trEta = info->matTrace3(b); |
273 |
> |
transposeMat3(eta, a); |
274 |
> |
matMul3(a, eta, b); |
275 |
> |
trEta = matTrace3(b); |
276 |
|
|
277 |
|
barostat_kinetic = NkBT * tb2 * trEta / |
278 |
|
(2.0 * eConvert); |