1 |
|
#include <cmath> |
2 |
|
#include <iostream> |
3 |
+ |
using namespace std; |
4 |
|
|
4 |
– |
|
5 |
|
#ifdef IS_MPI |
6 |
|
#include <mpi++.h> |
7 |
|
#endif //is_mpi |
16 |
|
Thermo::Thermo( SimInfo* the_entry_plug ) { |
17 |
|
entry_plug = the_entry_plug; |
18 |
|
int baseSeed = BASE_SEED; |
19 |
+ |
|
20 |
+ |
cerr << "creating thermo stream\n"; |
21 |
|
gaussStream = new gaussianSPRNG( baseSeed ); |
22 |
+ |
cerr << "created thermo stream\n"; |
23 |
|
} |
24 |
|
|
25 |
|
Thermo::~Thermo(){ |
167 |
|
ndf = ndfRaw - n_constraints - 3; |
168 |
|
kebar = kb * temperature * (double)ndf / ( 2.0 * (double)ndfRaw ); |
169 |
|
|
167 |
– |
printf("Entered Velocitize\n"); |
170 |
|
for(vr = 0; vr < n_atoms; vr++){ |
171 |
|
|
172 |
|
// uses equipartition theory to solve for vbar in angstrom/fs |
204 |
|
x = drand48(); |
205 |
|
y = drand48(); |
206 |
|
vz = vbar * sqrt( -2.0 * log(x)) * cos(2 * M_PI * y); |
207 |
< |
printf("Setting new velocities vx: %f\n",vx); |
207 |
> |
|
208 |
|
#endif // use_spring |
209 |
|
|
210 |
|
#ifdef USE_SPRNG |