16 |
|
#include "mpiSimulation.hpp" |
17 |
|
#endif // is_mpi |
18 |
|
|
19 |
< |
|
20 |
< |
#define BASE_SEED 123456789 |
21 |
< |
|
22 |
< |
Thermo::Thermo( SimInfo* the_entry_plug ) { |
23 |
< |
entry_plug = the_entry_plug; |
24 |
< |
int baseSeed = BASE_SEED; |
19 |
> |
Thermo::Thermo( SimInfo* the_info ) { |
20 |
> |
info = the_info; |
21 |
> |
int baseSeed = the_info->getSeed(); |
22 |
|
|
23 |
|
gaussStream = new gaussianSPRNG( baseSeed ); |
24 |
|
} |
42 |
|
Atom** atoms; |
43 |
|
|
44 |
|
|
45 |
< |
n_atoms = entry_plug->n_atoms; |
46 |
< |
atoms = entry_plug->atoms; |
45 |
> |
n_atoms = info->n_atoms; |
46 |
> |
atoms = info->atoms; |
47 |
|
|
48 |
|
kinetic = 0.0; |
49 |
|
kinetic_global = 0.0; |
85 |
|
int el, nSRI; |
86 |
|
Molecule* molecules; |
87 |
|
|
88 |
< |
molecules = entry_plug->molecules; |
89 |
< |
nSRI = entry_plug->n_SRI; |
88 |
> |
molecules = info->molecules; |
89 |
> |
nSRI = info->n_SRI; |
90 |
|
|
91 |
|
potential_local = 0.0; |
92 |
|
potential = 0.0; |
93 |
< |
potential_local += entry_plug->lrPot; |
93 |
> |
potential_local += info->lrPot; |
94 |
|
|
95 |
< |
for( el=0; el<entry_plug->n_mol; el++ ){ |
95 |
> |
for( el=0; el<info->n_mol; el++ ){ |
96 |
|
potential_local += molecules[el].getPotential(); |
97 |
|
} |
98 |
|
|
126 |
|
const double kb = 1.9872179E-3; // boltzman's constant in kcal/(mol K) |
127 |
|
double temperature; |
128 |
|
|
129 |
< |
temperature = ( 2.0 * this->getKinetic() ) / ((double)entry_plug->ndf * kb ); |
129 |
> |
temperature = ( 2.0 * this->getKinetic() ) / ((double)info->ndf * kb ); |
130 |
|
return temperature; |
131 |
|
} |
132 |
|
|
148 |
|
|
149 |
|
double Thermo::getVolume() { |
150 |
|
|
151 |
< |
return entry_plug->boxVol; |
151 |
> |
return info->boxVol; |
152 |
|
} |
153 |
|
|
154 |
|
double Thermo::getPressure() { |
177 |
|
double molmass, volume; |
178 |
|
double vcom[3]; |
179 |
|
double p_local[9], p_global[9]; |
180 |
< |
int i, j, k, l, nMols; |
180 |
> |
int i, j, k, nMols; |
181 |
|
Molecule* molecules; |
182 |
|
|
183 |
< |
nMols = entry_plug->n_mol; |
184 |
< |
molecules = entry_plug->molecules; |
185 |
< |
//tau = entry_plug->tau; |
183 |
> |
nMols = info->n_mol; |
184 |
> |
molecules = info->molecules; |
185 |
> |
//tau = info->tau; |
186 |
|
|
187 |
|
// use velocities of molecular centers of mass and molecular masses: |
188 |
|
for (i=0; i < 9; i++) { |
219 |
|
for(i = 0; i < 3; i++) { |
220 |
|
for (j = 0; j < 3; j++) { |
221 |
|
k = 3*i + j; |
222 |
< |
press[i][j] = (p_global[k] + entry_plug->tau[k]*e_convert) / volume; |
222 |
> |
press[i][j] = (p_global[k] + info->tau[k]*e_convert) / volume; |
223 |
> |
|
224 |
|
} |
225 |
|
} |
226 |
|
} |
242 |
|
int n_oriented; |
243 |
|
int n_constraints; |
244 |
|
|
245 |
< |
atoms = entry_plug->atoms; |
246 |
< |
n_atoms = entry_plug->n_atoms; |
247 |
< |
temperature = entry_plug->target_temp; |
248 |
< |
n_oriented = entry_plug->n_oriented; |
249 |
< |
n_constraints = entry_plug->n_constraints; |
245 |
> |
atoms = info->atoms; |
246 |
> |
n_atoms = info->n_atoms; |
247 |
> |
temperature = info->target_temp; |
248 |
> |
n_oriented = info->n_oriented; |
249 |
> |
n_constraints = info->n_constraints; |
250 |
|
|
251 |
< |
kebar = kb * temperature * (double)entry_plug->ndf / |
252 |
< |
( 2.0 * (double)entry_plug->ndfRaw ); |
251 |
> |
kebar = kb * temperature * (double)info->ndf / |
252 |
> |
( 2.0 * (double)info->ndfRaw ); |
253 |
|
|
254 |
|
for(vr = 0; vr < n_atoms; vr++){ |
255 |
|
|
320 |
|
// We are very careless here with the distinction between n_atoms and n_local |
321 |
|
// We should really fix this before someone pokes an eye out. |
322 |
|
|
323 |
< |
n_atoms = entry_plug->n_atoms; |
324 |
< |
atoms = entry_plug->atoms; |
323 |
> |
n_atoms = info->n_atoms; |
324 |
> |
atoms = info->atoms; |
325 |
|
|
326 |
|
mtot_local = 0.0; |
327 |
|
vdrift_local[0] = 0.0; |