Révision 176
| NBody/NBody.py (revision 176) | ||
|---|---|---|
| 108 | 108 |
} |
| 109 | 109 |
#endif |
| 110 | 110 |
|
| 111 |
// Interaction based of Force (1/r**2) or Potential (-grad(1/r))
|
|
| 111 |
// Interaction based of Force as gradient of Potential
|
|
| 112 | 112 |
MYFLOAT4 Interaction(MYFLOAT4 m,MYFLOAT4 n) |
| 113 | 113 |
#if INTERACTION == TFORCE |
| 114 | 114 |
#if ARTEVASION == NEGEXP |
| ... | ... | |
| 137 | 137 |
#else |
| 138 | 138 |
// Force definited as gradient of potential |
| 139 | 139 |
// Estimate potential and proximate potential to estimate force |
| 140 |
// MYFLOAT4 InteractionPotential(MYFLOAT4 m,MYFLOAT4 n) |
|
| 141 | 140 |
{
|
| 142 | 141 |
// 1/1024 seems to be a good factor: larger one provides bad results |
| 143 | 142 |
private MYFLOAT epsilon=(MYFLOAT)(1.e0f/1024); |
| ... | ... | |
| 379 | 378 |
// cast to float for sin,cos are NEEDED by Mesa FP64 implementation! |
| 380 | 379 |
// Implemention on AMD Oland are probably broken in float |
| 381 | 380 |
|
| 382 |
SpeedVector=(MYFLOAT4)((MWCfp-0.5e0f)*velocity,(MWCfp-0.5e0f)*velocity,
|
|
| 383 |
(MWCfp-0.5e0f)*velocity,0.e0f);
|
|
| 381 |
SpeedVector=(MYFLOAT4)((MWCfp-5e-1f)*velocity,(MWCfp-5e-1f)*velocity,
|
|
| 382 |
(MWCfp-5e-1f)*velocity,0.e0f);
|
|
| 384 | 383 |
} |
| 385 | 384 |
clDataV[gid]=SpeedVector; |
| 386 | 385 |
barrier(CLK_GLOBAL_MEM_FENCE); |
Formats disponibles : Unified diff