17 |
|
#include "mpiSimulation.hpp" |
18 |
|
#endif // is_mpi |
19 |
|
|
20 |
+ |
inline double roundMe( double x ){ |
21 |
+ |
return ( x >= 0 ) ? floor( x + 0.5 ) : ceil( x - 0.5 ); |
22 |
+ |
} |
23 |
+ |
|
24 |
|
Thermo::Thermo( SimInfo* the_info ) { |
25 |
|
info = the_info; |
26 |
|
int baseSeed = the_info->getSeed(); |
232 |
|
|
233 |
|
matVecMul3(info->Hmat, scaled, pcom); |
234 |
|
|
235 |
< |
p_local[0] += molmass * (vcom[0] * vcom[0]) + fcom[0]*pcom[0]*eConvert; |
236 |
< |
p_local[1] += molmass * (vcom[0] * vcom[1]) + fcom[0]*pcom[1]*eConvert; |
237 |
< |
p_local[2] += molmass * (vcom[0] * vcom[2]) + fcom[0]*pcom[2]*eConvert; |
238 |
< |
p_local[3] += molmass * (vcom[1] * vcom[0]) + fcom[1]*pcom[0]*eConvert; |
239 |
< |
p_local[4] += molmass * (vcom[1] * vcom[1]) + fcom[1]*pcom[1]*eConvert; |
240 |
< |
p_local[5] += molmass * (vcom[1] * vcom[2]) + fcom[1]*pcom[2]*eConvert; |
241 |
< |
p_local[6] += molmass * (vcom[2] * vcom[0]) + fcom[2]*pcom[0]*eConvert; |
242 |
< |
p_local[7] += molmass * (vcom[2] * vcom[1]) + fcom[2]*pcom[1]*eConvert; |
243 |
< |
p_local[8] += molmass * (vcom[2] * vcom[2]) + fcom[2]*pcom[2]*eConvert; |
235 |
> |
p_local[0] += molmass * (vcom[0] * vcom[0]); |
236 |
> |
p_local[1] += molmass * (vcom[0] * vcom[1]); |
237 |
> |
p_local[2] += molmass * (vcom[0] * vcom[2]); |
238 |
> |
p_local[3] += molmass * (vcom[1] * vcom[0]); |
239 |
> |
p_local[4] += molmass * (vcom[1] * vcom[1]); |
240 |
> |
p_local[5] += molmass * (vcom[1] * vcom[2]); |
241 |
> |
p_local[6] += molmass * (vcom[2] * vcom[0]); |
242 |
> |
p_local[7] += molmass * (vcom[2] * vcom[1]); |
243 |
> |
p_local[8] += molmass * (vcom[2] * vcom[2]); |
244 |
|
|
245 |
|
} |
246 |
|
|
259 |
|
for(i = 0; i < 3; i++) { |
260 |
|
for (j = 0; j < 3; j++) { |
261 |
|
k = 3*i + j; |
262 |
< |
press[i][j] = p_global[k] / volume; |
259 |
< |
|
262 |
> |
press[i][j] = (p_global[k] + info->tau[k]*e_convert) / volume; |
263 |
|
} |
264 |
|
} |
265 |
|
} |
450 |
|
|
451 |
|
info->integrableObjects[vd]->setVel( aVel ); |
452 |
|
} |
453 |
< |
} |
453 |
> |
} |