Swarm-NG
1.1
|
Gravitation calculation for a number of bodies between 10-20 EXPERIMENTAL: This class is not thoroughly tested. More...
#include <gravitation_mediumn.hpp>
Public Member Functions | |
GENERIC | GravitationMediumN (ensemble::SystemRef &sys, shared_data &shared) |
Create a function object for computing gravitational force on planets in a system using a shared memory area. More... | |
GPUAPI void | operator() (int ij, int b, int c, double &pos, double &vel, double &acc, double &jerk) const |
Run the complete algorithm for computing acceleration and jerk on all bodies. More... | |
__device__ double | acc_planets (int ij, int b, int c) const |
todo: Remove once allow propagators to use GravitationAcc | |
__device__ double | acc (int ij, int b, int c, double &pos, double &vel) const |
todo: Remove once allow propagators to use GravitationAcc | |
Static Public Member Functions | |
static GENERIC int | shmem_per_system () |
static GENERIC int | thread_per_system () |
Number of threads per system. | |
static GENERIC int | shmem_per_system () |
Amount of shared memory per system. | |
Gravitation calculation for a number of bodies between 10-20 EXPERIMENTAL: This class is not thoroughly tested.
templatized Class working as a function object to calculate acceleration and jerk in parallel.
shared_data member is to be initialized with a shared memory pointer. Although it does not have to be a shared memory pointer.
It operates in two steps:
Step 0: Write positions and velocities to global memory which is cached.
Step 1: Calculate distances between pairs using calc_pair you should supply ij that is between 0 and n*(n-1)/2. It calculates the inverse of distance squared between each pair of bodies. The intermediate values for calculating acc/jerk are stored to the shared memory.
Step 2: Calculate forces that operate on each body it is done in one of the functions: sum, sum_acc, sum_acc_planets This function should be called per body per component. It uses the shared data and calculates the acc/jerk for each body.
Definition at line 66 of file gravitation_mediumn.hpp.
|
inline |
Create a function object for computing gravitational force on planets in a system using a shared memory area.
Definition at line 91 of file gravitation_mediumn.hpp.
|
inline |
Run the complete algorithm for computing acceleration and jerk on all bodies.
This is tightly coupled with the BPPT integrators. ij, b and c are calculated from thread id.
If you need to calculate only acceleration use acc function instead.
The pair number for this tread. The planet number for this thread. coordinate
number x:0,y:1,z:2 position for this planet's coordinate velecotiy for this planet's coordinate output variable to hold acceleration output variable to hold jerk.
Definition at line 300 of file gravitation_mediumn.hpp.
References peyton::constants::c.
|
inlinestatic |
todo: Test
Definition at line 344 of file gravitation_mediumn.hpp.