#include <Pbc.h>
Public Member Functions | |
| Pbc () | |
| Constructor. | |
| void | apply (std::vector< Vector > &dlist, unsigned max_index=0) const |
| void | apply (VectorView dlist, unsigned max_index=0) const |
| Apply PBC to a set of positions or distance vectors. | |
| double | distance (const bool pbc, const Vector &v1, const Vector &v2) const |
| Compute modulo of (v2-v1), using or not pbc depending on bool pbc. | |
| Vector | distance (const Vector &, const Vector &) const |
| Computes v2-v1, using minimal image convention if specified, also returns the number of attempted shifts. | |
| Vector | distance (const Vector &, const Vector &, int *nshifts) const |
| Computes v2-v1, using minimal image convention if specified, also returns the number of attempted shifts. | |
| Vector3f | distance (const Vector3f &, const Vector3f &) const |
| void | fullSearch (Vector &) const |
| Full search (for testing). | |
| const Tensor & | getBox () const |
| Returns the box. | |
| const Tensor & | getInvBox () const |
| Returns the inverse matrix of box. | |
| bool | isOrthorombic () const |
| Returns true if the box vectors are orthogonal. | |
| bool | isSet () const |
| Returns true if box is set and non zero. | |
| Vector | realToScaled (const Vector &) const |
| Transform a vector in real space to a vector in scaled coordinates. | |
| Vector3f | realToScaled (const Vector3f &) const |
| void | removeFromACCDevice () const |
| Helper function for cleaning the memory of the class from an openacc device. | |
| Vector | scaledToReal (const Vector &) const |
| Transform a vector in scaled coordinates to a vector in real space. | |
| Vector3f | scaledToReal (const Vector3f &) const |
| void | setBox (const Tensor &b) |
| Set the lattice vectors. | |
| void | toACCDevice () const |
| Helper function for moving the class to an openacc device. | |
Private Types | |
| enum | { unset , orthorombic , generic } |
| Type of box. More... | |
Private Member Functions | |
| void | buildShifts (gch::small_vector< Vector, maxshiftsize > shifts[2][2][2]) const |
| Build list of shifts. | |
Private Attributes | |
| Tensor | box |
| Box. | |
| Vector | diag |
| Alternative representation for orthorombic cells. | |
| Vector | hdiag |
| Tensor | invBox |
| Inverse box. | |
| Tensor | invReduced |
| Inverse of the reduced box. | |
| Vector | mdiag |
| Tensor | reduced |
| Reduced box. | |
| gch::small_vector< Vector, maxshiftsize > | shifts [2][2][2] |
| List of shifts that should be attempted. | |
| enum PLMD::Pbc:: { ... } | type |
| Type of box. | |
Static Private Attributes | |
| static constexpr unsigned | maxshiftsize =6 |
| This is the maximum expected size for general boxes. | |
| PLMD::Pbc::Pbc | ( | ) |
Constructor.
| void PLMD::Pbc::apply | ( | std::vector< Vector > & | dlist, |
| unsigned | max_index = 0 ) const |
| void PLMD::Pbc::apply | ( | VectorView | dlist, |
| unsigned | max_index = 0 ) const |
Apply PBC to a set of positions or distance vectors.
|
private |
Build list of shifts.
This is expensive, and must be called only when box is reset. It allows building a minimal set of shifts depending on the sign of the scaled coordinates representing a distance vector.
Compute modulo of (v2-v1), using or not pbc depending on bool pbc.
Computes v2-v1, using minimal image convention if specified, also returns the number of attempted shifts.
Computes v2-v1, using minimal image convention if specified, also returns the number of attempted shifts.
| void PLMD::Pbc::fullSearch | ( | Vector & | d | ) | const |
Full search (for testing).
Perform a full search on vector
| const Tensor & PLMD::Pbc::getBox | ( | ) | const |
Returns the box.
| const Tensor & PLMD::Pbc::getInvBox | ( | ) | const |
Returns the inverse matrix of box.
Thus: pbc.getInvBox() == inverse(pbc.getBox()).
| bool PLMD::Pbc::isOrthorombic | ( | ) | const |
Returns true if the box vectors are orthogonal.
|
inline |
Returns true if box is set and non zero.
Transform a vector in real space to a vector in scaled coordinates.
Thus:pbc.realToScaled(v) == matmul(transpose(inverse(pbc.getBox(),v)));
| void PLMD::Pbc::removeFromACCDevice | ( | ) | const |
Helper function for cleaning the memory of the class from an openacc device.
Transform a vector in scaled coordinates to a vector in real space.
Thus:pbc.scaledToRead(v) == matmul(transpose(pbc.getBox()),v);
| void PLMD::Pbc::setBox | ( | const Tensor & | b | ) |
Set the lattice vectors.
b[i][j] is the j-th component of the i-th vector
| void PLMD::Pbc::toACCDevice | ( | ) | const |
Helper function for moving the class to an openacc device.
|
private |
Box.
|
private |
Alternative representation for orthorombic cells.
Not really used, but could be used to optimize search in orthorombic cells.
|
private |
|
private |
Inverse box.
|
private |
Inverse of the reduced box.
|
staticconstexprprivate |
This is the maximum expected size for general boxes.
I found this empirically by manually modifying regtest basic/rt-make-1 Since it uses randomly generated boxes it should be correct. In any case, this is just used as a hint for small_vector, which will then switch to heap allocations if more shifts are needed
|
private |
|
private |
Reduced box.
This is a set of lattice vectors generating the same lattice but "minimally skewed". Useful to optimize image search.
|
private |
List of shifts that should be attempted.
Depending on the sign of the scaled coordinates representing a distance vector, a different set of shifts must be tried.
| enum { ... } PLMD::Pbc::type |
Type of box.
Hosted by GitHub
|
1.13.2
|