Tinker9 70bd052 (Thu Nov 9 12:11:35 2023 -0800)
|
Periodic boundary conditions and image distance. More...
Classes | |
struct | tinker::Box |
Macros | |
#define | TINKER_IMAGE_LVEC_PARAMS real3 lvec1, real3 lvec2, real3 lvec3 |
#define | TINKER_IMAGE_LVEC_ARGS lvec1, lvec2, lvec3 |
#define | TINKER_IMAGE_RECIP_PARAMS real3 recipa, real3 recipb, real3 recipc |
#define | TINKER_IMAGE_RECIP_ARGS recipa, recipb, recipc |
#define | TINKER_IMAGE_PARAMS BoxShape box_shape, TINKER_IMAGE_LVEC_PARAMS, TINKER_IMAGE_RECIP_PARAMS |
#define | TINKER_IMAGE_ARGS box_shape, TINKER_IMAGE_LVEC_ARGS, TINKER_IMAGE_RECIP_ARGS |
#define | IMAGE_TRI__(xr, yr, zr, l1, l2, l3, ra, rb, rc) |
Image displacement for the triclinic PBC. More... | |
#define | IMAGE_MONO__(xr, yr, zr, l1, l2, l3, ra, rb, rc) |
Image displacement for the monoclinic PBC. More... | |
#define | IMAGE_ORTHO__(xr, yr, zr, l1, l2, l3, ra, rb, rc) |
Image displacement for the orthogonal PBC. More... | |
#define | IMAGE_OCT__(xr, yr, zr, l1, l2, l3, ra, rb, rc) |
Image displacement for the truncated octahedron PBC. More... | |
#define | image(x, y, z) imageGeneral(x, y, z, TINKER_IMAGE_ARGS) |
#define | image2(x, y, z) image2General(x, y, z, TINKER_IMAGE_ARGS) |
#define | imagen2(x, y, z) imagen2General(x, y, z, TINKER_IMAGE_ARGS) |
Enumerations | |
enum class | tinker::BoxShape { tinker::BoxShape::UNBOUND , tinker::BoxShape::ORTHO , tinker::BoxShape::MONO , tinker::BoxShape::TRI , tinker::BoxShape::OCT } |
Shapes of the periodic box. More... | |
Functions | |
void | tinker::boxData (RcOp) |
Sets up box data on device. More... | |
void | tinker::boxDataP1 (RcOp) |
Internal function used in the setup. More... | |
void | tinker::boxExtent (double newExtent) |
void | tinker::boxSetCurrent (const Box &p) |
Sets the box by the input and updates the box on device. More... | |
void | tinker::boxGetCurrent (Box &p) |
Copies the current PBC box to the output variable. More... | |
void | tinker::boxSetCurrentRecip () |
void | tinker::boxSetTinker (const Box &p) |
Updates the related PBC modules of Tinker by p . More... | |
void | tinker::boxCopyin () |
void | tinker::boxLattice (Box &p, BoxShape sh, double a, double b, double c, double alphaDeg, double betaDeg, double gammaDeg) |
Sets up the internal PBC data. Similar to Tinker lattice subroutine. More... | |
real | tinker::boxVolume () |
__device__ real3 | tinker::ftoc_triclinic (real3 f, real3 l1, real3 l2, real3 l3) |
Fractional to cartesian: triclinic. More... | |
__device__ real3 | tinker::ftoc_monoclinic (real3 f, real3 l1, real3 l2, real3 l3) |
Fractional to cartesian: monoclinic. More... | |
__device__ real3 | tinker::ftoc_orthogonal (real3 f, real3 l1, real3 l2, real3 l3) |
Fractional to cartesian: orthogonal. More... | |
__device__ real3 | tinker::ftoc_general (real3 f, real3 l1, real3 l2, real3 l3) |
Fractional to cartesian. More... | |
__device__ real3 | tinker::imageFrac (real3 f) |
PBC image of the fractional coordinates. More... | |
__device__ real3 | tinker::ctof_triclinic (real xr, real yr, real zr, real3 ra, real3 rb, real3 rc) |
Cartesian to fractional: triclinic. More... | |
__device__ real3 | tinker::ctof_monoclinic (real xr, real yr, real zr, real3 ra, real3 rb, real3 rc) |
Cartesian to fractional: monoclinic. More... | |
__device__ real3 | tinker::ctof_orthogonal (real xr, real yr, real zr, real3 ra, real3 rb, real3 rc) |
Cartesian to fractional: orthogonal. More... | |
__device__ real3 | tinker::imagectof_general (real xr, real yr, real zr, real3 ra, real3 rb, real3 rc) |
Cartesian to fractional. More... | |
Variables | |
BoxShape | tinker::box_shape |
real3 | tinker::lvec1 |
real3 | tinker::lvec2 |
real3 | tinker::lvec3 |
real3 | tinker::recipa |
real3 | tinker::recipb |
real3 | tinker::recipc |
Box * | tinker::trajbox |
Host pointer to the PBC boxes of a trajectory. More... | |
Periodic boundary conditions and image distance.
struct tinker::Box |
Internal data for the periodic boundary condition (PBC).
PBC in Tinker is defined by lengths of three axes and three angles: a-axis
, b-axis
, c-axis
, alpha
, beta
, and gamma
.
In cartesian coordinates:
a-axis
is always aligned with the x axis, so the vector of a-axis
is (ax,ay,az) = (a,0,0)
;b-axis
does not have z component, so the vector of b-axis
is (bx,by,bz) = (bx,by,0)
;c-axis
is (cx,cy,cz)
.Tinker has another 3x3 matrix lvec
:
lvec(:,1)
(or lvec[0][]
): (ax,bx,cx)
;lvec(:,2)
(or lvec[1][]
): (ay,by,cy)
;lvec(:,3)
(or lvec[2][]
): (az,bz,cz)
.Triclinic:
lvec(:,1)
(or lvec[0][]
): (ax,bx,cx)
;lvec(:,2)
(or lvec[1][]
): ( 0,by,cy)
;lvec(:,3)
(or lvec[2][]
): ( 0, 0,cz)
.Monoclinic:
lvec(:,1)
(or lvec[0][]
): (a,0,cx)
;lvec(:,2)
(or lvec[1][]
): (0,b, 0)
;lvec(:,3)
(or lvec[2][]
): (0,0,cz)
;alpha
and gamma
are 90 degrees.Orthogonal:
lvec(:,1)
(or lvec[0][]
): (a,0,0)
;lvec(:,2)
(or lvec[1][]
): (0,b,0)
;lvec(:,3)
(or lvec[2][]
): (0,0,c)
;alpha
, beta
, and gamma
are 90 degrees.Reciprocal lattice (recip
), is the inverse of lvec
:
recip(:,1)
, recip(:,2)
, recip(:,3)
;recip[0][]
, recip[1][]
, recip[2][]
;fi = recip(:,i) (xr,yr,zr), (i=1,2,3)
;wr = inv_recip(:,w) (f1,f2,f3) = lvec(:,w) (f1,f2,f3), (w=1,2,3 or x,y,z)
. Public Attributes | |
BoxShape | box_shape |
real3 | lvec1 |
real3 | lvec2 |
real3 | lvec3 |
real3 | recipa |
real3 | recipb |
real3 | recipc |
BoxShape tinker::Box::box_shape |
real3 tinker::Box::lvec1 |
real3 tinker::Box::lvec2 |
real3 tinker::Box::lvec3 |
real3 tinker::Box::recipa |
real3 tinker::Box::recipb |
real3 tinker::Box::recipc |
#define image | ( | x, | |
y, | |||
z | |||
) | imageGeneral(x, y, z, TINKER_IMAGE_ARGS) |
Applies periodic boundary conditions to displacement (xr,yr,zr)
and preserves the correct signs.
For testing purpose, defining it in the source code before including this header file will overwrite the default macro definition.
#define image2 | ( | x, | |
y, | |||
z | |||
) | image2General(x, y, z, TINKER_IMAGE_ARGS) |
Applies periodic boundary conditions to displacement (xr,yr,zr)
and preserves the correct signs. Returns the displacement squared.
#define IMAGE_MONO__ | ( | xr, | |
yr, | |||
zr, | |||
l1, | |||
l2, | |||
l3, | |||
ra, | |||
rb, | |||
rc | |||
) |
Image displacement for the monoclinic PBC.
#define IMAGE_OCT__ | ( | xr, | |
yr, | |||
zr, | |||
l1, | |||
l2, | |||
l3, | |||
ra, | |||
rb, | |||
rc | |||
) |
Image displacement for the truncated octahedron PBC.
#define IMAGE_ORTHO__ | ( | xr, | |
yr, | |||
zr, | |||
l1, | |||
l2, | |||
l3, | |||
ra, | |||
rb, | |||
rc | |||
) |
Image displacement for the orthogonal PBC.
#define IMAGE_TRI__ | ( | xr, | |
yr, | |||
zr, | |||
l1, | |||
l2, | |||
l3, | |||
ra, | |||
rb, | |||
rc | |||
) |
Image displacement for the triclinic PBC.
#define imagen2 | ( | x, | |
y, | |||
z | |||
) | imagen2General(x, y, z, TINKER_IMAGE_ARGS) |
Applies periodic boundary conditions to displacement (xr,yr,zr)
. Correct signs may not be preserved. Returns the displacement squared.
#define TINKER_IMAGE_ARGS box_shape, TINKER_IMAGE_LVEC_ARGS, TINKER_IMAGE_RECIP_ARGS |
#define TINKER_IMAGE_LVEC_ARGS lvec1, lvec2, lvec3 |
#define TINKER_IMAGE_LVEC_PARAMS real3 lvec1, real3 lvec2, real3 lvec3 |
#define TINKER_IMAGE_PARAMS BoxShape box_shape, TINKER_IMAGE_LVEC_PARAMS, TINKER_IMAGE_RECIP_PARAMS |
#define TINKER_IMAGE_RECIP_ARGS recipa, recipb, recipc |
#define TINKER_IMAGE_RECIP_PARAMS real3 recipa, real3 recipb, real3 recipc |
|
strong |
void tinker::boxCopyin | ( | ) |
OpenACC only: Copies the current box data to device asynchronously. The implementations are empty for CPU and CUDA code because it is only in the OpenACC code that a copy of the PBC box is created on device.
void tinker::boxData | ( | RcOp | ) |
Sets up box data on device.
void tinker::boxDataP1 | ( | RcOp | ) |
Internal function used in the setup.
void tinker::boxExtent | ( | double | newExtent | ) |
Sets up a hypothetical orthogonal box for the unbound box whose a-axis equals the new extent.
void tinker::boxGetCurrent | ( | Box & | p | ) |
Copies the current PBC box to the output variable.
void tinker::boxLattice | ( | Box & | p, |
BoxShape | sh, | ||
double | a, | ||
double | b, | ||
double | c, | ||
double | alphaDeg, | ||
double | betaDeg, | ||
double | gammaDeg | ||
) |
Sets up the internal PBC data. Similar to Tinker lattice
subroutine.
void tinker::boxSetCurrent | ( | const Box & | p | ) |
Sets the box by the input and updates the box on device.
void tinker::boxSetCurrentRecip | ( | ) |
Calculates the recip
arrays by new lvec
arrays and updates the box on device
void tinker::boxSetTinker | ( | const Box & | p | ) |
Updates the related PBC modules of Tinker by p
.
real tinker::boxVolume | ( | ) |
Gets the volume of the PBC box.
|
inline |
Cartesian to fractional: monoclinic.
|
inline |
Cartesian to fractional: orthogonal.
|
inline |
Cartesian to fractional: triclinic.
Fractional to cartesian.
Fractional to cartesian: monoclinic.
Fractional to cartesian: orthogonal.
Fractional to cartesian: triclinic.
|
inline |
Cartesian to fractional.
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
Host pointer to the PBC boxes of a trajectory.