10 |
|
#include "Thermo.hpp" |
11 |
|
#include "SRI.hpp" |
12 |
|
#include "Integrator.hpp" |
13 |
+ |
#include "simError.h" |
14 |
|
|
15 |
|
#ifdef IS_MPI |
16 |
|
#define __C |
93 |
|
nSRI = entry_plug->n_SRI; |
94 |
|
|
95 |
|
potential_local = 0.0; |
96 |
+ |
potential = 0.0; |
97 |
|
potential_local += entry_plug->lrPot; |
98 |
|
|
99 |
|
for( el=0; el<entry_plug->n_mol; el++ ){ |
100 |
|
potential_local += molecules[el].getPotential(); |
101 |
|
} |
102 |
+ |
|
103 |
+ |
#ifdef IS_MPI |
104 |
+ |
/* |
105 |
+ |
std::cerr << "node " << worldRank << ": before LONG RANGE pot = " << entry_plug->lrPot |
106 |
+ |
<< "; pot_local = " << potential_local |
107 |
+ |
<< "; pot = " << potential << "\n"; |
108 |
+ |
*/ |
109 |
+ |
#endif |
110 |
|
|
111 |
|
// Get total potential for entire system from MPI. |
112 |
|
#ifdef IS_MPI |
115 |
|
potential = potential_local; |
116 |
|
#endif // is_mpi |
117 |
|
|
118 |
+ |
#ifdef IS_MPI |
119 |
+ |
/* |
120 |
+ |
std::cerr << "node " << worldRank << ": after pot = " << potential << "\n"; |
121 |
+ |
*/ |
122 |
+ |
#endif |
123 |
+ |
|
124 |
|
return potential; |
125 |
|
} |
126 |
|
|
212 |
|
|
213 |
|
av2 = 2.0 * kebar / atoms[vr]->getMass(); |
214 |
|
vbar = sqrt( av2 ); |
215 |
< |
|
215 |
> |
|
216 |
|
// vbar = sqrt( 8.31451e-7 * temperature / atoms[vr]->getMass() ); |
217 |
|
|
218 |
|
// picks random velocities from a gaussian distribution |