| 19 |
|
|
| 20 |
|
#define BASE_SEED 123456789 |
| 21 |
|
|
| 22 |
< |
Thermo::Thermo( SimInfo* the_entry_plug ) { |
| 23 |
< |
entry_plug = the_entry_plug; |
| 22 |
> |
Thermo::Thermo( SimInfo* the_info ) { |
| 23 |
> |
info = the_info; |
| 24 |
|
int baseSeed = BASE_SEED; |
| 25 |
|
|
| 26 |
|
gaussStream = new gaussianSPRNG( baseSeed ); |
| 45 |
|
Atom** atoms; |
| 46 |
|
|
| 47 |
|
|
| 48 |
< |
n_atoms = entry_plug->n_atoms; |
| 49 |
< |
atoms = entry_plug->atoms; |
| 48 |
> |
n_atoms = info->n_atoms; |
| 49 |
> |
atoms = info->atoms; |
| 50 |
|
|
| 51 |
|
kinetic = 0.0; |
| 52 |
|
kinetic_global = 0.0; |
| 88 |
|
int el, nSRI; |
| 89 |
|
Molecule* molecules; |
| 90 |
|
|
| 91 |
< |
molecules = entry_plug->molecules; |
| 92 |
< |
nSRI = entry_plug->n_SRI; |
| 91 |
> |
molecules = info->molecules; |
| 92 |
> |
nSRI = info->n_SRI; |
| 93 |
|
|
| 94 |
|
potential_local = 0.0; |
| 95 |
|
potential = 0.0; |
| 96 |
< |
potential_local += entry_plug->lrPot; |
| 96 |
> |
potential_local += info->lrPot; |
| 97 |
|
|
| 98 |
< |
for( el=0; el<entry_plug->n_mol; el++ ){ |
| 98 |
> |
for( el=0; el<info->n_mol; el++ ){ |
| 99 |
|
potential_local += molecules[el].getPotential(); |
| 100 |
|
} |
| 101 |
|
|
| 129 |
|
const double kb = 1.9872179E-3; // boltzman's constant in kcal/(mol K) |
| 130 |
|
double temperature; |
| 131 |
|
|
| 132 |
< |
temperature = ( 2.0 * this->getKinetic() ) / ((double)entry_plug->ndf * kb ); |
| 132 |
> |
temperature = ( 2.0 * this->getKinetic() ) / ((double)info->ndf * kb ); |
| 133 |
|
return temperature; |
| 134 |
|
} |
| 135 |
|
|
| 151 |
|
|
| 152 |
|
double Thermo::getVolume() { |
| 153 |
|
|
| 154 |
< |
return entry_plug->boxVol; |
| 154 |
> |
return info->boxVol; |
| 155 |
|
} |
| 156 |
|
|
| 157 |
|
double Thermo::getPressure() { |
| 180 |
|
double molmass, volume; |
| 181 |
|
double vcom[3]; |
| 182 |
|
double p_local[9], p_global[9]; |
| 183 |
< |
int i, j, k, l, nMols; |
| 183 |
> |
int i, j, k, nMols; |
| 184 |
|
Molecule* molecules; |
| 185 |
|
|
| 186 |
< |
nMols = entry_plug->n_mol; |
| 187 |
< |
molecules = entry_plug->molecules; |
| 188 |
< |
//tau = entry_plug->tau; |
| 186 |
> |
nMols = info->n_mol; |
| 187 |
> |
molecules = info->molecules; |
| 188 |
> |
//tau = info->tau; |
| 189 |
|
|
| 190 |
|
// use velocities of molecular centers of mass and molecular masses: |
| 191 |
|
for (i=0; i < 9; i++) { |
| 222 |
|
for(i = 0; i < 3; i++) { |
| 223 |
|
for (j = 0; j < 3; j++) { |
| 224 |
|
k = 3*i + j; |
| 225 |
< |
press[i][j] = (p_global[k] + entry_plug->tau[k]*e_convert) / volume; |
| 225 |
> |
press[i][j] = (p_global[k] + info->tau[k]*e_convert) / volume; |
| 226 |
> |
|
| 227 |
|
} |
| 228 |
|
} |
| 229 |
|
} |
| 245 |
|
int n_oriented; |
| 246 |
|
int n_constraints; |
| 247 |
|
|
| 248 |
< |
atoms = entry_plug->atoms; |
| 249 |
< |
n_atoms = entry_plug->n_atoms; |
| 250 |
< |
temperature = entry_plug->target_temp; |
| 251 |
< |
n_oriented = entry_plug->n_oriented; |
| 252 |
< |
n_constraints = entry_plug->n_constraints; |
| 248 |
> |
atoms = info->atoms; |
| 249 |
> |
n_atoms = info->n_atoms; |
| 250 |
> |
temperature = info->target_temp; |
| 251 |
> |
n_oriented = info->n_oriented; |
| 252 |
> |
n_constraints = info->n_constraints; |
| 253 |
|
|
| 254 |
< |
kebar = kb * temperature * (double)entry_plug->ndf / |
| 255 |
< |
( 2.0 * (double)entry_plug->ndfRaw ); |
| 254 |
> |
kebar = kb * temperature * (double)info->ndf / |
| 255 |
> |
( 2.0 * (double)info->ndfRaw ); |
| 256 |
|
|
| 257 |
|
for(vr = 0; vr < n_atoms; vr++){ |
| 258 |
|
|
| 323 |
|
// We are very careless here with the distinction between n_atoms and n_local |
| 324 |
|
// We should really fix this before someone pokes an eye out. |
| 325 |
|
|
| 326 |
< |
n_atoms = entry_plug->n_atoms; |
| 327 |
< |
atoms = entry_plug->atoms; |
| 326 |
> |
n_atoms = info->n_atoms; |
| 327 |
> |
atoms = info->atoms; |
| 328 |
|
|
| 329 |
|
mtot_local = 0.0; |
| 330 |
|
vdrift_local[0] = 0.0; |