CellGPU
0.8.0
GPU-accelerated simulations of cells
|
A simple box defining a 2D periodic domain. More...
#include <gpubox.h>
Public Member Functions | |
HOSTDEVICE | gpubox (Dscalar x, Dscalar y) |
Construct a rectangular box containing the unit cell ((0,0),(x,0),(x,y),(0,y)) | |
HOSTDEVICE | gpubox (Dscalar a, Dscalar b, Dscalar c, Dscalar d) |
Construct a non-rectangular box. | |
HOSTDEVICE void | getBoxDims (Dscalar &xx, Dscalar &xy, Dscalar &yx, Dscalar &yy) |
Get the dimensions of the box. | |
HOSTDEVICE bool | isBoxSquare () |
Check if the box is rectangular or not (as certain optimizations can then be used) | |
HOSTDEVICE void | getBoxInvDims (Dscalar &xx, Dscalar &xy, Dscalar &yx, Dscalar &yy) |
Get the inverse of the box transformation matrix. | |
HOSTDEVICE void | setSquare (Dscalar x, Dscalar y) |
Set the box to some new rectangular specification. | |
HOSTDEVICE void | setGeneral (Dscalar a, Dscalar b, Dscalar c, Dscalar d) |
Set the box to some new generic specification. | |
HOSTDEVICE void | putInBoxReal (Dscalar2 &p1) |
Take the point and put it back in the unit cell. | |
HOSTDEVICE void | Trans (const Dscalar2 &p1, Dscalar2 &pans) |
Take a point in the unit square and find its position in the box. | |
HOSTDEVICE void | invTrans (const Dscalar2 p1, Dscalar2 &pans) |
Take a point in the box and find its position in the unit square. | |
HOSTDEVICE void | minDist (const Dscalar2 &p1, const Dscalar2 &p2, Dscalar2 &pans) |
Calculate the minimum distance between two points. | |
HOSTDEVICE void | move (Dscalar2 &p1, const Dscalar2 &disp) |
Move p1 by the amount disp, then put it in the box. | |
HOSTDEVICE void | operator= (gpubox &other) |
Protected Member Functions | |
HOSTDEVICE void | putInBox (Dscalar2 &vp) |
Protected Attributes | |
Dscalar | x11 |
The transformation matrix defining the periodic box. | |
Dscalar | x12 |
Dscalar | x21 |
Dscalar | x22 |
Dscalar | halfx11 |
Dscalar | halfx22 |
Dscalar | xi11 |
The inverse of the transformation matrix. | |
Dscalar | xi12 |
Dscalar | xi21 |
Dscalar | xi22 |
bool | isSquare |
A simple box defining a 2D periodic domain.
gpubox periodic boundary conditions in 2D, computing minimum distances between periodic images, displacing particles and putting them back in the central unit cell, etc. The workhorse of this class is calling Box.minDist(vecA,vecB,&disp), which computes the displacement between vecA and the closest periodic image of vecB and stores the result in disp. Also Box.putInBoxReal(&point), which will take the point and put it back in the primary unit cell. Please note that while the gpubox class can handle generic 2D periodic domains, many of the other classes that interface with it do not yet have this functionality implemented.