PROFASI
Version 1.5
|
A class to store the coordinates of an atom. More...
#include <AtomCoordinates.hh>
Public Member Functions | |
AtomCoordinates (int i) | |
create coordinates for atom with unique_id i | |
Accessing coordinate data | |
access or modify properties of an individual AtomCoordinates object | |
double | x () const |
double | y () const |
double | z () const |
void | x (double val) |
void | y (double val) |
void | z (double val) |
int | Id () const |
return the unique_id corresponding to the AtomCoordinates object | |
void | Id (int i) |
Static Public Member Functions | |
static void | Initialize (int tot_atoms) |
An important initialization function. | |
static void | update (int strt, int iend) |
Update backup coordinates. | |
static void | revert (int strt, int iend) |
Revert to backup coordinates. | |
static Vector3 | CenterOfMass (int strt, int iend) |
Center of mass of a block of coordinates, expensive! | |
static void | center () |
Move center of mass to origin. | |
static double | rgyr (int istrt, int iend) |
Radius of gyration of a block, again, use carefully! | |
static void | BlockRotate (double tht, int strt, int iend, AtomCoordinates ax1, AtomCoordinates ax2) |
Rotate a block of atoms. | |
static void | BlockRotate (double tht, int strt, int iend, Vector3 org, Vector3 axs) |
Rotate block about given axis and origin. | |
static void | BlockTranslate (const Vector3 &amnt, int strt, int iend) |
translate a block of coordinates by given amounts. | |
static void | BoundingBox (int i1, int i2, double &xmn, double &xmx, double &ymn, double &ymx, double &zmn, double &zmx) |
find bounding box for atoms between i1 and i2 | |
static void | EnforceBC (int i1, int i2) |
enforce periodic boundary conditions on atoms between i1 and i2 | |
static void | write_pdb_box_info (FILE *fp) |
Periodic box information to a pdb file. | |
static void | CheckDiff () |
static void | switch_to_backups () |
static void | switch_to_regular () |
Switch back to current coordinates. | |
static void | SetBox (double bx) |
Set size of periodic box. | |
static double | boxL () |
access box size | |
static double | total_error () |
difference between present coordinates and backups | |
Static coordinate access without AtomCoordinates object | |
Access coordinates without an AtomCoordinate object It is also possible to access the x,y, z coordinates of the i'th atom without ever referring to the atom or an AtomCoordinates object. This is done using static functions using the unique_id of that atom as the argument. | |
static double | xval (int i) |
static double | yval (int i) |
static double | zval (int i) |
static Vector3 | diff_from_backup (int i) |
difference between current and backup coordinates for atom i | |
Three-vector like operations | |
One can manipulate AtomCoordinates just like three vectors. Algebraic operations are supported among them which yield answers which would be expected had they really been three vectors. Even algebraic operations between an ordinary three vector and an AtomCoordinates object should work seamlessly. | |
Vector3 | value () const |
extract three vector out of the AtomCoordinates object | |
void | value (double gx, double gy, double gz) |
assign x,y and z coordinates | |
AtomCoordinates & | operator= (const AtomCoordinates &) |
Copy x,y and z coordinates from another AtomCoordinates object. | |
AtomCoordinates & | operator= (const Vector3 &) |
Assign a Vector3 to an AtomCoordinates. | |
Vector3 | operator+ (const AtomCoordinates &) const |
Vector3 | operator+ (const Vector3 &) const |
AtomCoordinates & | operator+= (const AtomCoordinates &) |
AtomCoordinates & | operator+= (const Vector3 &) |
Vector3 | operator- (const AtomCoordinates &) const |
Vector3 | operator- (const Vector3 &) const |
AtomCoordinates & | operator-= (const AtomCoordinates &) |
AtomCoordinates & | operator-= (const Vector3 &) |
double | dot (const AtomCoordinates &) const |
Scalar product of two AtomCoordinates. | |
double | dot (const Vector3 &) const |
Scalar product of an AtomCoordinates object with a Vector3. | |
Vector3 | operator* (const AtomCoordinates &) const |
Vector (cross) product of two AtomCoordinates. | |
Vector3 | operator* (const Vector3 &) const |
Vector product of an AtomCoordinates object with a Vector3. | |
static Vector3 | vec (int i) |
statically get the Vector3 representing the coordinates of atom i | |
static void | vec (int i, double gx, double gy, double gz) |
statically assign x,y and z values to atom i | |
Vector3 | operator+ (const Vector3 &, const AtomCoordinates &) |
Vector3 | operator- (const Vector3 &, const AtomCoordinates &) |
Distance measure related functions | |
static double | per_sep (double x1, double x2) |
Periodic separation between values x1 and x2. | |
static double | pos_per_sep (double x1, double x2) |
Positive definite periodic separation. | |
static double | xdist (int i1, int i2) |
components of the periodic dist. between atoms indexed i1 and i2 | |
static double | ydist (int i1, int i2) |
static double | zdist (int i1, int i2) |
static double | npxdist (int i1, int i2) |
non-periodic versions of the separations along x,y and z axes | |
static double | npydist (int i1, int i2) |
static double | npzdist (int i1, int i2) |
static double | sepx (int i, double xpt) |
periodic separation between atom i and a given point along an axis | |
static double | sepy (int i, double ypt) |
static double | sepz (int i, double zpt) |
static Vector3 | sepv (int i, Vector3 v) |
static double | psepx (int i, double xpt) |
positive definite periodic separation between atom i and a point | |
static double | psepy (int i, double ypt) |
static double | psepz (int i, double zpt) |
static double | s2 (int i1, int i2) |
bare cartessian distance measure between atoms i1 and i2 | |
static double | s (int i1, int i2) |
static double | dist2 (int i1, int i2) |
distance measure respecting periodic box | |
static double | dist (int i1, int i2) |
static double | seps2 (int i, double xpt, double ypt, double zpt) |
Periodic distance measure from a given point. | |
static double | pseps2 (int i, double xpt, double ypt, double zpt) |
Distance^2 from a point using positive definite periodic measures. | |
static double | seps (int i, double xpt, double ypt, double zpt) |
static double | pseps (int i, double xpt, double ypt, double zpt) |
static Vector3 | diff (int i1, int i2) |
Non-periodic vector difference between i1 and i2. | |
static Vector3 | sep (int i1, int i2) |
Periodic vector difference between i1 and i2. | |
static Vector3 | psep (int i1, int i2) |
Positive-definite periodic Vector difference between i1 and i2. | |
AtomCoordinates class is meant to work in two ways. On the one hand it is the x,y and z coordinates of an atom. So, if you subtract two AtomCoordinate objects you get a Vector3. But there are some advantages in not using the Vector3 directly for the coordinates of an atom. In order to impose the periodic boundary condition, one has to check the extent of each molecule of the system along all three axes separately. This is cumbersome if each component of the position vectors is only accessible through the three vector. As far as periodicity is concerned, the different spatial directions have nothing to do with eachother.
Besides, in this implementation, the AtomCoordinates class will actually store coordinates of all atoms in static valarrays. The unique_id of each atom marks the element in the static arrays reserved for that atom. While this is by no means crucial, it has been done for two reasons...
AtomCoordinates also saves a backup set of coordinates for each atom. This helps quickly restore the system when an update is rejected.
|
static |
Rotate a block of atoms between strt and iend by angle tht about the axis passing through the atomCoordinates ax2 and ax1.
|
static |
check that the differences between current and backup coordinates are not too big. Mostly a sanity check function Switch to make the back up coordinates the active ones
|
static |
The function Initialize(tot_atoms) allocates space for the coordinates of tot_atoms Atoms. It should be called once, at the beginning when the total number of atoms has been determined.
|
static |
Copy a block of coordinates "backward", so that current values are abandoned and replaced with backup values
|
inlinestatic |
This does not dump the current coordinates, but causes energy calculations or for that matter any external object to access the backup values as the coordinates of different atoms.
|
inlinestatic |
This reverses what is done in switch_to_backups
|
static |
Copy a block of coordinates "forward", so that backups are synchronized with the current values