| 23 |
|
// |
| 24 |
|
// Hoover, W. G., 1986, Phys. Rev. A, 34, 2499. |
| 25 |
|
|
| 26 |
< |
template<typename T> NPTi<T>::NPTi ( SimInfo *theInfo, ForceFields* the_ff): |
| 27 |
< |
T( theInfo, the_ff ) |
| 26 |
> |
NPTi::NPTi ( SimInfo *theInfo, ForceFields* the_ff): |
| 27 |
> |
Integrator( theInfo, the_ff ) |
| 28 |
|
{ |
| 29 |
|
GenericData* data; |
| 30 |
|
DoubleArrayData * etaValue; |
| 47 |
|
|
| 48 |
|
} |
| 49 |
|
|
| 50 |
< |
template<typename T> NPTi<T>::~NPTi() { |
| 50 |
> |
NPTi::~NPTi() { |
| 51 |
|
//nothing for now |
| 52 |
|
} |
| 53 |
|
|
| 54 |
< |
template<typename T> void NPTi<T>::resetIntegrator() { |
| 54 |
> |
void NPTi::resetIntegrator() { |
| 55 |
|
eta = 0.0; |
| 56 |
< |
T::resetIntegrator(); |
| 56 |
> |
Integrator::resetIntegrator(); |
| 57 |
|
} |
| 58 |
|
|
| 59 |
< |
template<typename T> void NPTi<T>::evolveEtaA() { |
| 59 |
> |
void NPTi::evolveEtaA() { |
| 60 |
|
eta += dt2 * ( instaVol * (instaPress - targetPressure) / |
| 61 |
|
(p_convert*NkBT*tb2)); |
| 62 |
|
oldEta = eta; |
| 63 |
|
} |
| 64 |
|
|
| 65 |
< |
template<typename T> void NPTi<T>::evolveEtaB() { |
| 65 |
> |
void NPTi::evolveEtaB() { |
| 66 |
|
|
| 67 |
|
prevEta = eta; |
| 68 |
|
eta = oldEta + dt2 * ( instaVol * (instaPress - targetPressure) / |
| 69 |
|
(p_convert*NkBT*tb2)); |
| 70 |
|
} |
| 71 |
|
|
| 72 |
< |
template<typename T> void NPTi<T>::getVelScaleA(double sc[3], double vel[3]) { |
| 72 |
> |
void NPTi::getVelScaleA(double sc[3], double vel[3]) { |
| 73 |
|
int i; |
| 74 |
|
|
| 75 |
|
for(i=0; i<3; i++) sc[i] = vel[i] * ( chi + eta ); |
| 76 |
|
} |
| 77 |
|
|
| 78 |
< |
template<typename T> void NPTi<T>::getVelScaleB(double sc[3], int index ){ |
| 78 |
> |
void NPTi::getVelScaleB(double sc[3], int index ){ |
| 79 |
|
int i; |
| 80 |
|
|
| 81 |
|
for(i=0; i<3; i++) sc[i] = oldVel[index*3 + i] * ( chi + eta ); |
| 82 |
|
} |
| 83 |
|
|
| 84 |
|
|
| 85 |
< |
template<typename T> void NPTi<T>::getPosScale(double pos[3], double COM[3], |
| 85 |
> |
void NPTi::getPosScale(double pos[3], double COM[3], |
| 86 |
|
int index, double sc[3]){ |
| 87 |
|
int j; |
| 88 |
|
|
| 93 |
|
sc[j] *= eta; |
| 94 |
|
} |
| 95 |
|
|
| 96 |
< |
template<typename T> void NPTi<T>::scaleSimBox( void ){ |
| 96 |
> |
void NPTi::scaleSimBox( void ){ |
| 97 |
|
|
| 98 |
|
double scaleFactor; |
| 99 |
|
|
| 113 |
|
|
| 114 |
|
} |
| 115 |
|
|
| 116 |
< |
template<typename T> bool NPTi<T>::etaConverged() { |
| 116 |
> |
bool NPTi::etaConverged() { |
| 117 |
|
|
| 118 |
|
return ( fabs(prevEta - eta) <= etaTolerance ); |
| 119 |
|
} |
| 120 |
|
|
| 121 |
< |
template<typename T> double NPTi<T>::getConservedQuantity(void){ |
| 121 |
> |
double NPTi::getConservedQuantity(void){ |
| 122 |
|
|
| 123 |
|
double conservedQuantity; |
| 124 |
|
double Energy; |
| 153 |
|
return conservedQuantity; |
| 154 |
|
} |
| 155 |
|
|
| 156 |
< |
template<typename T> string NPTi<T>::getAdditionalParameters(void){ |
| 156 |
> |
string NPTi::getAdditionalParameters(void){ |
| 157 |
|
string parameters; |
| 158 |
|
const int BUFFERSIZE = 2000; // size of the read buffer |
| 159 |
|
char buffer[BUFFERSIZE]; |