Loading...
Searching...
No Matches
eonc::pbc Namespace Reference

Functions

void wrapMinimumImage (double *data, size_t n)
void wrapLegacyUnit (double *data, size_t n)
AtomMatrix apply (const AtomMatrix &diff, const Matrix3d &cell, const Matrix3d &cellInverse)
AtomMatrix applyLegacy (const AtomMatrix &coords, const Matrix3d &cell, const Matrix3d &cellInverse)
AtomMatrix applyPositions (const AtomMatrix &coords, const Matrix3d &cell, const Matrix3d &cellInverse, PbcConvention convention)
VectorXd applyV (const VectorXd &diffVector, const Matrix3d &cell, const Matrix3d &cellInverse)

Function Documentation

◆ apply()

AtomMatrix eonc::pbc::apply ( const AtomMatrix & diff,
const Matrix3d & cell,
const Matrix3d & cellInverse )
inline

Definition at line 44 of file Matter.h.

45 {
46 // Fractional coordinates, minimum-image wrap to [-0.5, 0.5), back to
47 // Cartesian. x - floor(x + 0.5), Highway when the build has it.
48 AtomMatrix frac = diff * cellInverse;
49 wrapMinimumImage(frac.data(), static_cast<size_t>(frac.size()));
50 return frac * cell;
51}
Eigen::Matrix< double, Eigen::Dynamic, 3, eOnStorageOrder > AtomMatrix
Definition Eigen.h:37
void wrapMinimumImage(double *data, size_t n)
Definition PbcSimd.cpp:109

◆ applyLegacy()

AtomMatrix eonc::pbc::applyLegacy ( const AtomMatrix & coords,
const Matrix3d & cell,
const Matrix3d & cellInverse )
inline

Definition at line 55 of file Matter.h.

56 {
57 AtomMatrix frac = coords * cellInverse;
58 // Same values as fmod(x + 1, 1): (x + 1) - trunc(x + 1).
59 wrapLegacyUnit(frac.data(), static_cast<size_t>(frac.size()));
60 return frac * cell;
61}
void wrapLegacyUnit(double *data, size_t n)
Definition PbcSimd.cpp:113

◆ applyPositions()

AtomMatrix eonc::pbc::applyPositions ( const AtomMatrix & coords,
const Matrix3d & cell,
const Matrix3d & cellInverse,
PbcConvention convention )
inline

Definition at line 64 of file Matter.h.

66 {
67 if (convention == PbcConvention::MinimumImage) {
68 return apply(coords, cell, cellInverse);
69 }
70 return applyLegacy(coords, cell, cellInverse);
71}
AtomMatrix apply(const AtomMatrix &diff, const Matrix3d &cell, const Matrix3d &cellInverse)
Definition Matter.h:44
AtomMatrix applyLegacy(const AtomMatrix &coords, const Matrix3d &cell, const Matrix3d &cellInverse)
Definition Matter.h:55

◆ applyV()

VectorXd eonc::pbc::applyV ( const VectorXd & diffVector,
const Matrix3d & cell,
const Matrix3d & cellInverse )
inline

Definition at line 73 of file Matter.h.

74 {
75 AtomMatrix pbcMatrix =
76 apply(AtomMatrix::Map(diffVector.data(), diffVector.size() / 3, 3), cell,
77 cellInverse);
78 return VectorXd(VectorXd::Map(pbcMatrix.data(), diffVector.size()));
79}

◆ wrapLegacyUnit()

void eonc::pbc::wrapLegacyUnit ( double * data,
size_t n )

Definition at line 113 of file PbcSimd.cpp.

113 {
114 wrapLegacyUnitScalar(data, 0, n);
115}

◆ wrapMinimumImage()

void eonc::pbc::wrapMinimumImage ( double * data,
size_t n )

Definition at line 109 of file PbcSimd.cpp.

109 {
110 wrapMinimumImageScalar(data, 0, n);
111}