Template Struct meta_image#

Struct Documentation#

template<size_t IDX>
struct meta_image#

meta_image applies the nearest periodic image convention to the coordinates of one particle.

In particular, meta_image is called by put_in_box once for each particle. x points to the first coodinate of the particle that should be put in the box. The template meta program expands to apply the nearest image convention to all ndim coordinates in the range [x, x + ndim). The function f of meta_image translates x[k] such that its new value is in the range [-box[k]/2, box[k]/2]. To see this, consider the behavior of std::round. E.g. if the input is x[k] == -0.7 box[k], then round_fast(x[k] * ibox[k]) == -1 and finally (x[k] -= -1 * box[k]) == 0.3 * box[k]

Public Static Functions

static inline void f(
double *const xnew,
const double *x,
const double *ibox,
const double *box
)#
static inline void f(double *const x, const double *ibox, const double *box)#