STORMM Source Documentation
|
Store the coordinates and box information for a series of frames, in one of several levels of precision. Individual frames can be extracted into CoordinateFrame, and PhaseSpace, and PhaseSpaceSynthesis objects, or new frames can be added from CoordinateFrame objects. This object is not the CoordinateFrame equivalent of a PhaseSpaceSynthesis object, however: its purpose is to collect only the coordinates of many frames of a single system at the appropriate level of precision. More...
#include <coordinate_series.h>
Public Member Functions | |
CoordinateSeries (const CoordinateSeries &original, HybridFormat format_in) | |
A special copy constructor can create an object with an altered memory format. | |
HybridFormat | getFormat () const |
Get the memory format. | |
int | getAtomCount () const |
Get the number of atoms in each frame of the series. | |
int | getFrameCount () const |
Get the number of frames in the series. | |
int | getFrameCapacity () const |
Get the maximum number of frames that the object can hold. | |
UnitCellType | getUnitCellType () const |
Get the unit cell type of the coordinate system. | |
int | getFixedPrecisionBits () const |
Get the fixed precision bits after the decimal (if applicable, warn if the data type is non-integer). | |
std::vector< double > | getBoxSpaceTransform (int frame_index, HybridTargetLevel tier=HybridTargetLevel::HOST) const |
Get the transformation matrix to take coordinates into box (fractional) space. The result should be interpreted as a 3x3 matrix in column-major format. | |
std::vector< double > | getInverseTransform (int frame_index, HybridTargetLevel tier=HybridTargetLevel::HOST) const |
Get the transformation matrix to take coordinates from fractional space back into real space. The result should be interpreted as a 3x3 matrix in column-major format. | |
CoordinateFrame | exportFrame (size_t frame_index, HybridTargetLevel tier=HybridTargetLevel::HOST) const |
Prepare a CoordinateFrame object based on one frame of the series, accomplishing any necessary data conversions to put the coordinates back into the familiar double-precision format. | |
PhaseSpace | exportPhaseSpace (size_t frame_index, HybridTargetLevel tier=HybridTargetLevel::HOST) const |
Prepare a PhaseSpace object based on one frame of the series, accomplishing any data conversions needed to put the coordinates back into the familiar double-precision format. | |
void | exportToFile (const std::string &file_name, CoordinateFileKind output_kind=CoordinateFileKind::AMBER_CRD, PrintSituation expectation=PrintSituation::UNKNOWN, int low_index=0, int high_index=0, HybridTargetLevel tier=HybridTargetLevel::HOST) const |
Export the contents of this coordinate series to a trajectory file. | |
const Hybrid< T > & | getCoordinateReference (CartesianDimension dim) const |
Get a const reference to the one of the Cartesian coordinate arrays. | |
const Hybrid< T > * | getCoordinatePointer (CartesianDimension dim) const |
Get a const pointer to one of the Cartesian coordinate arrays. | |
const Hybrid< double > & | getBoxTransforms () const |
Get a const reference to the box space transformation matrices. | |
const Hybrid< double > * | getBoxTransformPointer () const |
Get a const pointer to the box space transformation matrices. | |
const Hybrid< double > & | getInverseTransforms () const |
Get a const reference to the box space transformation matrices. | |
const Hybrid< double > * | getInverseTransformPointer () const |
Get a const pointer to the box space transformation matrices. | |
const Hybrid< double > * | getBoxDimensionPointer () const |
Get a const pointer to the list of box dimensions for all frames. | |
const CoordinateSeries< T > * | getSelfPointer () const |
Get a const pointer to the object iself, so that it may be passed to functions by const reference and still emit a const poiner. | |
void | importFromFile (const std::string &file_name, CoordinateFileKind file_kind=CoordinateFileKind::UNKNOWN, const std::vector< int > &frame_numbers={}, int replica_count=1, int frame_index_start=-1) |
Import coordinates from a file. This function accepts directives to read a subset of the coordinates and integrate them into the series at a specified point. | |
void | reserve (const int new_frame_capacity) |
Reserve capacity in this series. The new frames will be uninitialized. | |
void | shrinkToFit () |
Shrink the object's various arrays to accommodate only the current frame and atom counts. Mimics the Standard Template Library vector shrink_to_fit() member function. | |
CoordinateSeries (int natom_in=0, int nframe_in=0, UnitCellType unit_cell_in=UnitCellType::NONE, int globalpos_scale_bits_in=0, HybridFormat format_in=default_hpc_format) | |
There are several options for constructing this collection of coordinate frames. | |
CoordinateSeries (const std::string &file_name, int atom_count_in=0, CoordinateFileKind file_kind=CoordinateFileKind::UNKNOWN, const std::vector< int > &frame_numbers={}, int replica_count=1, UnitCellType unit_cell_in=UnitCellType::NONE, int globalpos_scale_bits_in=0, HybridFormat format_in=default_hpc_format) | |
CoordinateSeries (PhaseSpace *ps, int nframe_in, int globalpos_scale_bits_in=0, HybridFormat format_in=default_hpc_format) | |
CoordinateSeries (const PhaseSpace &ps, int nframe_in, int globalpos_scale_bits_in=0, HybridFormat format_in=default_hpc_format) | |
CoordinateSeries (CoordinateFrame *cf, int nframe_in, int globalpos_scale_bits_in=0, HybridFormat format_in=default_hpc_format) | |
CoordinateSeries (const CoordinateFrame &cf, int nframe_in, int globalpos_scale_bits_in=0, HybridFormat format_in=default_hpc_format) | |
CoordinateSeries (const CoordinateSeries &original)=default | |
Use the default copy and move constructors, copy and move assignment operators. This object has no const members to trigger implicit deletions and no POINTER-kind Hybrid objects to repair. | |
CoordinateSeries (CoordinateSeries &&original)=default | |
CoordinateSeries & | operator= (const CoordinateSeries &other)=default |
CoordinateSeries & | operator= (CoordinateSeries &&other)=default |
template<typename Toriginal> | |
CoordinateSeries (const CoordinateSeries< Toriginal > &original, int globalpos_scale_bits_in=0, HybridFormat format_in=default_hpc_format) | |
Special copy constructor to take a CoordinateSeries of one data type into another. The implementation requires a special declaration (template <typename T> template <typename Toriginal>...) with two uses of the template keyword because of the nested nature of these templates. In other contexts template <typename T, typename Toriginal> would suffice. | |
template<typename Treport> | |
std::vector< Treport > | getInterlacedCoordinates (int frame_index, int globalpos_bits_out=-1, HybridTargetLevel tier=HybridTargetLevel::HOST) const |
Get the interlaced coordinates of one frame. | |
template<typename Treport> | |
std::vector< Treport > | getInterlacedCoordinates (int frame_index, int low_index, int high_index, int globalpos_bits_out=-1, HybridTargetLevel tier=HybridTargetLevel::HOST) const |
std::vector< double > | getBoxDimensions (int frame_index, HybridTargetLevel tier=HybridTargetLevel::HOST) const |
Get the box dimensions in their pure form for a particular frame. | |
const Hybrid< double > & | getBoxDimensions () const |
void | extractFrame (CoordinateFrame *cf, size_t frame_index, const GpuDetails &gpu) const |
Extract coordinates to a pre-existing object. | |
void | extractFrame (PhaseSpace *ps, size_t frame_index, TrajectoryKind kind, CoordinateCycle time_point, const GpuDetails &gpu) const |
void | extractFrame (PhaseSpace *ps, size_t frame_index, TrajectoryKind kind, const GpuDetails &gpu) const |
void | extractFrame (PhaseSpace *ps, size_t frame_index, const GpuDetails &gpu) const |
void | extractFrame (CoordinateFrame *cf, size_t frame_index, HybridTargetLevel tier) const |
void | extractFrame (PhaseSpace *ps, size_t frame_index, TrajectoryKind kind, CoordinateCycle time_point, HybridTargetLevel tier) const |
void | extractFrame (PhaseSpace *ps, size_t frame_index, TrajectoryKind kind, HybridTargetLevel tier) const |
void | extractFrame (PhaseSpace *ps, size_t frame_index, HybridTargetLevel tier) const |
const Hybrid< T > * | getFramesHandle (CartesianDimension dim) const |
Get a pointer to one of the coordinate arrays. | |
Hybrid< T > * | getFramesHandle (CartesianDimension dim) |
const Hybrid< double > * | getBoxTransformsHandle () const |
Get a pointer to the box space transform. Overloading follows from getCoordinateHandle(), above. | |
Hybrid< double > * | getBoxTransformsHandle () |
const Hybrid< double > * | getInverseTransformsHandle () const |
Get a pointer to the inverse transform that takes coordinates back into real space. Overloading follows from getCoordinateHandle(), above. | |
Hybrid< double > * | getInverseTransformsHandle () |
const Hybrid< double > * | getBoxDimensionsHandle () const |
Get a pointer to the transform that takes coordinates back into real space. Overloading follows from getCoordinateHandle(), above. | |
Hybrid< double > * | getBoxDimensionsHandle () |
const CoordinateSeriesReader< T > | data (HybridTargetLevel tier=HybridTargetLevel::HOST) const |
Get the abstract for this object, containing C-style pointers for the most rapid access to any of its member variables. | |
CoordinateSeriesWriter< T > | data (HybridTargetLevel tier=HybridTargetLevel::HOST) |
const CoordinateSeriesReader< void > | templateFreeData (HybridTargetLevel tier=HybridTargetLevel::HOST) const |
Get the object's abstract, with all templated type pointers cast to void pointers. The true data type can be encoded in a separate 64-bit unsigned integer code (use std::type_index() as seen in DataTypes/common_types.h). Parameter descriptions and overloading match those in data() above. | |
CoordinateSeriesWriter< void > | templateFreeData (HybridTargetLevel tier=HybridTargetLevel::HOST) |
void | importFrame (const CoordinateFrameReader &cfr, int atom_start, int atom_end, int frame_index=-1) |
Import coordinates from a CoordinateFrame or PhaseSpace object. The original object must have the same number of atoms as the CoordinateSeries itself, or else a range of atoms within the original coordinate object must be specified that fits the CoordinateSeries. The default behavior is to push the new coordinates to the back of the list, but any frame index within the bounds of the current list may also be specified. | |
void | importFrame (const CoordinateFrameReader &cfr, int frame_index=-1) |
void | importFrame (const CoordinateFrameWriter &cfw, int atom_start, int atom_end, int frame_index=-1) |
void | importFrame (const CoordinateFrameWriter &cfw, int frame_index=-1) |
void | importFrame (const CoordinateFrame &cf, int atom_start, int atom_end, int frame_index=-1) |
void | importFrame (const CoordinateFrame &cf, int frame_index=-1) |
void | importFrame (const CoordinateFrame *cf, int atom_start, int atom_end, int frame_index=-1) |
void | importFrame (const CoordinateFrame *cf, int frame_index=-1) |
void | importFrame (const PhaseSpace &ps, int atom_start, int atom_end, int frame_index=-1, TrajectoryKind kind=TrajectoryKind::POSITIONS, CoordinateCycle orientation=CoordinateCycle::WHITE) |
void | importFrame (const PhaseSpace &ps, int frame_index=-1, TrajectoryKind kind=TrajectoryKind::POSITIONS, CoordinateCycle orientation=CoordinateCycle::WHITE) |
void | importFrame (const PhaseSpace *ps, int atom_start, int atom_end, int frame_index=-1, TrajectoryKind kind=TrajectoryKind::POSITIONS, CoordinateCycle orientation=CoordinateCycle::WHITE) |
void | importFrame (const PhaseSpace *ps, int frame_index=-1, TrajectoryKind kind=TrajectoryKind::POSITIONS, CoordinateCycle orientation=CoordinateCycle::WHITE) |
void | resize (int new_frame_count) |
Resize the series, allocating new capacity if needed, initializing new frames with the provided coordinate set. ("New" frames are defined as any frames with indices greater than the original maximum index, regardless of whether new capacity was allocated to hold them or if the size simply increased within the existing space available.) | |
void | resize (int new_frame_count, const CoordinateFrameReader &cfr, int atom_start=0, int atom_end=0) |
void | resize (int new_frame_count, const CoordinateFrameWriter &cfw, int atom_start=0, int atom_end=0) |
void | resize (int new_frame_count, const CoordinateFrame &cf, int atom_start=0, int atom_end=0) |
void | resize (int new_frame_count, CoordinateFrame *cf, int atom_start=0, int atom_end=0) |
void | resize (int new_frame_count, const PhaseSpace &ps, int atom_start=0, int atom_end=0) |
void | resize (int new_frame_count, PhaseSpace *ps, int atom_start=0, int atom_end=0) |
void | pushBack (const CoordinateFrameReader &cfr, int atom_start=0, int atom_end=0) |
Push a coordinate set to the back of the list. This invokes the import member function after reallocating the frame series with 25% spare capacity if the original capacity is insufficient. | |
void | pushBack (const CoordinateFrameWriter &cfw, int atom_start=0, int atom_end=0) |
void | pushBack (const CoordinateFrame &cf, int atom_start=0, int atom_end=0) |
void | pushBack (CoordinateFrame *cf, int atom_start=0, int atom_end=0) |
void | pushBack (const PhaseSpace &ps, int atom_start=0, int atom_end=0) |
void | pushBack (PhaseSpace *ps, int atom_start=0, int atom_end=0) |
Store the coordinates and box information for a series of frames, in one of several levels of precision. Individual frames can be extracted into CoordinateFrame, and PhaseSpace, and PhaseSpaceSynthesis objects, or new frames can be added from CoordinateFrame objects. This object is not the CoordinateFrame equivalent of a PhaseSpaceSynthesis object, however: its purpose is to collect only the coordinates of many frames of a single system at the appropriate level of precision.
|
explicit |
There are several options for constructing this collection of coordinate frames.
Overloaded:
natom_in | The number of atoms expected |
nframe_in | Initial number of frames to allocate for |
unit_cell_in | The type of unit cell to prepare for (this can be modified after creating the object) |
file_name | File to read from |
frame_numbers_in | Frame numbers of the file to read (default all frames) |
replica_count_in | The number of times to replicate a series of one of more frames read from a file (this is useful for immediately making many copies of a restrart or input coordinates file, which has only one frame) |
atom_count_in | The number of atoms to expect (critical if the input file is an Amber .crd format trajectory, otherwise can be left at zero to be filled in when the file is read) |
ps | Pre-existing object with a complete coordinate set to use as a template. When constructing from a pre-existing PhaseSpace object, nframe_in indicates a number of copies to allocate for and create. |
cf | Pre-existing object with a complete coordinate set to use as a template. When constructing from a pre-existing CoordinateFrame, nframe_in indicates a number of copies to allocate for and create. |
|
default |
Use the default copy and move constructors, copy and move assignment operators. This object has no const members to trigger implicit deletions and no POINTER-kind Hybrid objects to repair.
original | The original object, being copied or moved |
other | The other object, being copied or moved by assignment |
|
explicit |
A special copy constructor can create an object with an altered memory format.
original | The original object, being copied or moved |
format_in | The format to apply to the new object. Content is subject to the priority of the deepCopy() function for Hybrid objects, as it is with the PhaseSpace and CoordinateFrame objects. |
stormm::trajectory::CoordinateSeries< T >::CoordinateSeries | ( | const CoordinateSeries< Toriginal > & | original, |
int | globalpos_scale_bits_in = 0, | ||
HybridFormat | format_in = default_hpc_format ) |
Special copy constructor to take a CoordinateSeries of one data type into another. The implementation requires a special declaration (template <typename T> template <typename Toriginal>...) with two uses of the template keyword because of the nested nature of these templates. In other contexts template <typename T, typename Toriginal> would suffice.
original | The original object, being copied or moved |
const CoordinateSeriesReader< T > stormm::trajectory::CoordinateSeries< T >::data | ( | HybridTargetLevel | tier = HybridTargetLevel::HOST | ) | const |
Get the abstract for this object, containing C-style pointers for the most rapid access to any of its member variables.
Overloaded:
tier | Get pointers to data at the level of the CPU host or GPU device |
CoordinateFrame stormm::trajectory::CoordinateSeries< T >::exportFrame | ( | size_t | frame_index, |
HybridTargetLevel | tier = HybridTargetLevel::HOST ) const |
Prepare a CoordinateFrame object based on one frame of the series, accomplishing any necessary data conversions to put the coordinates back into the familiar double-precision format.
frame_index | The frame to extract |
tier | Level at which to retrieve data (if STORMM is compiled to run on a GPU) |
PhaseSpace stormm::trajectory::CoordinateSeries< T >::exportPhaseSpace | ( | size_t | frame_index, |
HybridTargetLevel | tier = HybridTargetLevel::HOST ) const |
Prepare a PhaseSpace object based on one frame of the series, accomplishing any data conversions needed to put the coordinates back into the familiar double-precision format.
frame_index | The frame to extract |
tier | Level at which to retrieve data (if STORMM is compiled to run on a GPU) |
void stormm::trajectory::CoordinateSeries< T >::exportToFile | ( | const std::string & | file_name, |
CoordinateFileKind | output_kind = CoordinateFileKind::AMBER_CRD, | ||
PrintSituation | expectation = PrintSituation::UNKNOWN, | ||
int | low_index = 0, | ||
int | high_index = 0, | ||
HybridTargetLevel | tier = HybridTargetLevel::HOST ) const |
Export the contents of this coordinate series to a trajectory file.
file_name | Name of the file to write |
output_kind | The format of the file to write (checkpoint files print position and velocity data by obligation, but trajectory files can contain either of these as well as forces) |
expectation | The condition in which the output file is expected to be found |
low_index | The first frame index to export |
high_index | The upper limit of frame indices to export |
tier | Level at which to retrieve data (if STORMM is compiled to run on a GPU) |
void stormm::trajectory::CoordinateSeries< T >::extractFrame | ( | CoordinateFrame * | cf, |
size_t | frame_index, | ||
const GpuDetails & | gpu ) const |
Extract coordinates to a pre-existing object.
Overloaded:
cf | Coordinate frame into which coordinates shall be placed |
ps | Phase space object into which coordinates shall be placed |
frame_index | Frame to use in coordinate extraction |
std::vector< double > stormm::trajectory::CoordinateSeries< T >::getBoxDimensions | ( | int | frame_index, |
HybridTargetLevel | tier = HybridTargetLevel::HOST ) const |
Get the box dimensions in their pure form for a particular frame.
Overloaded:
frame_index | The frame for which to extract the transformation matrix |
tier | Level at which to retrieve data (if STORMM is compiled to run on a GPU) |
std::vector< double > stormm::trajectory::CoordinateSeries< T >::getBoxSpaceTransform | ( | int | frame_index, |
HybridTargetLevel | tier = HybridTargetLevel::HOST ) const |
Get the transformation matrix to take coordinates into box (fractional) space. The result should be interpreted as a 3x3 matrix in column-major format.
frame_index | The frame for which to extract the transformation matrix |
tier | Level at which to retrieve data (if STORMM is compiled to run on a GPU) |
const Hybrid< T > * stormm::trajectory::CoordinateSeries< T >::getCoordinatePointer | ( | CartesianDimension | dim | ) | const |
Get a const pointer to one of the Cartesian coordinate arrays.
dim | The dimension of interest |
const Hybrid< T > & stormm::trajectory::CoordinateSeries< T >::getCoordinateReference | ( | CartesianDimension | dim | ) | const |
Get a const reference to the one of the Cartesian coordinate arrays.
dim | The dimension of interest |
const Hybrid< T > * stormm::trajectory::CoordinateSeries< T >::getFramesHandle | ( | CartesianDimension | dim | ) | const |
Get a pointer to one of the coordinate arrays.
Overloaded:
dim | Specify coordinate data along one of the Cartesian axes |
std::vector< Treport > stormm::trajectory::CoordinateSeries< T >::getInterlacedCoordinates | ( | int | frame_index, |
int | globalpos_bits_out = -1, | ||
HybridTargetLevel | tier = HybridTargetLevel::HOST ) const |
Get the interlaced coordinates of one frame.
Overloaded:
frame_index | Index of the frame to access |
globalpos_bits_out | The number of bits after the point to apply if a fixed-precision output is required. Setting this to <= 0 indicates floating point output. |
low_index | The lower atom index of a range |
high_index | The upper atom index of a range |
tier | The level at which to access coordinates |
std::vector< double > stormm::trajectory::CoordinateSeries< T >::getInverseTransform | ( | int | frame_index, |
HybridTargetLevel | tier = HybridTargetLevel::HOST ) const |
Get the transformation matrix to take coordinates from fractional space back into real space. The result should be interpreted as a 3x3 matrix in column-major format.
frame_index | The frame for which to extract the transformation matrix |
tier | Level at which to retrieve data (if STORMM is compiled to run on a GPU) |
void stormm::trajectory::CoordinateSeries< T >::importFrame | ( | const CoordinateFrameReader & | cfr, |
int | atom_start, | ||
int | atom_end, | ||
int | frame_index = -1 ) |
Import coordinates from a CoordinateFrame or PhaseSpace object. The original object must have the same number of atoms as the CoordinateSeries itself, or else a range of atoms within the original coordinate object must be specified that fits the CoordinateSeries. The default behavior is to push the new coordinates to the back of the list, but any frame index within the bounds of the current list may also be specified.
Overloaded:
cfr | Coordinates to import. The CoordinateFrameReader is the most basic object available for importation. Both CoordinateFrame and PhaseSpace objects can create CoordinateFrameReaders or writers, and the writers can be const-ified into readers. |
cfw | Coordinates to import |
cf | Coordinates to import |
ps | Coordinates to import |
atom_start | First atom from the coordinate set to add to a frame of the series |
atom_end | Limit of atoms from the coordinate set to add to a frame of the series |
frame_index | Index of the frame into which the coordinates should be imported. The default value of -1 adds the new coordinates to the end of the list. |
void stormm::trajectory::CoordinateSeries< T >::importFromFile | ( | const std::string & | file_name, |
CoordinateFileKind | file_kind = CoordinateFileKind::UNKNOWN, | ||
const std::vector< int > & | frame_numbers = {}, | ||
int | replica_count = 1, | ||
int | frame_index_start = -1 ) |
Import coordinates from a file. This function accepts directives to read a subset of the coordinates and integrate them into the series at a specified point.
file_name | Name of the file |
file_kind | The kind of coordinate file being read, default UNKNOWN which will lead to automatic deduction of the file type |
frame_numbers | List of frame indices (starting from zero) to import from the file (if the file is too small to hold one or more frames with the requested indices, this is an error) |
replica_count_in | The number of replicas of the frames from this file (default 1). If additional replicas are requested, the whole series will be added in sequence, i.e. frames 3, 5, 8, 9, 3, 5, 8, 9, 3, ... |
frame_index_start | The starting index of the series for incorporating frames found in the file. A negative value in this argument triggers addition to the end of any existing series. |
void stormm::trajectory::CoordinateSeries< T >::pushBack | ( | const CoordinateFrameReader & | cfr, |
int | atom_start = 0, | ||
int | atom_end = 0 ) |
Push a coordinate set to the back of the list. This invokes the import member function after reallocating the frame series with 25% spare capacity if the original capacity is insufficient.
Overloaded:
cfr | Coordinates to import. The CoordinateFrameReader is the most basic object available for importation. Both CoordinateFrame and PhaseSpace objects can create CoordinateFrameReaders or writers, and the writers can be const-ified into readers. |
cfw | Coordinates to import |
cf | Coordinates to import |
ps | Coordinates to import |
atom_start | First atom from the coordinate set to add to a frame of the series |
atom_end | Limit of atoms from the coordinate set to add to a frame of the series |
void stormm::trajectory::CoordinateSeries< T >::reserve | ( | const int | new_frame_capacity | ) |
Reserve capacity in this series. The new frames will be uninitialized.
new_frame_capacity | The new capacity to prepare for. If such capacity already exists, the function will do nothing. |
void stormm::trajectory::CoordinateSeries< T >::resize | ( | int | new_frame_count | ) |
Resize the series, allocating new capacity if needed, initializing new frames with the provided coordinate set. ("New" frames are defined as any frames with indices greater than the original maximum index, regardless of whether new capacity was allocated to hold them or if the size simply increased within the existing space available.)
Overloaded:
new_frame_count | The number of new frames that the list shall report holding. This is less than or equal to the capacity; if there is insufficient capacity when resize() is called, new capacity will be allocated to hold precisely new_frame_count frames. |
cfr | Optional coordinate set to use in initializing new frames. If no coordinates are provided, the series will report holding frames but have undefined values in them. |
cfw | Optional coordinate set to use in initializing new frames |
cf | Optional coordinate set to use in initializing new frames |
ps | Optional coordinate set to use in initializing new frames |
atom_start | First atom from the coordinate set to add to a frame of the series (the default value is zero, to use all atoms) |
atom_end | Limit of atoms from the coordinate set to add to a frame of the series (the default value of zero will trigger an access to atom count from the coordinate object to load all of its atoms) |