Atoms.h¶
Structures for single and multiple atom positions.
These objects facilitate storage and manipulation of atom positions (and possibly velocities, but not currently), and calculation of non-cartesian components of stored quantities.
-
struct
Atom¶ - #include <Atoms.h>
Simple structure to hold information about a single atom.
-
class
AtomArray¶ - #include <Atoms.h>
Data structure to hold information about multiple atoms.
Can get and set coordinates from Atom. This object must be instantiated after DatafileReader so that SimData::numAtoms is already defined since this value is used to determine the size of allocated arrays.
Atom positions for all timesteps in a frame are stored, which may lead to memory issues if Options::stepsPerFrame or SimData::numAtoms are very large.
Public Functions
-
void
allocateArrays()¶ Allocate arrays.
Four arrays are allocated: x, y, z, r; each of which are of length
numAtoms * stepsPerFrame. Since the last frame may have more steps than other frames, we usestepsPerFrame = simDataPtr->lastFrame.numSteps.
-
AtomArray(SimData &simData)¶ Sole constructor.
- Parameters
simData: SimData object whosenumAtomsmember is already defined.
-
~AtomArray()¶
-
void
setNumAtoms(int _numAtoms)¶
-
void
setAtom(int atomNum, int stepInFrame, Atom &atom)¶ Copy data for atom
atomNumat stepstepInFrametoatom.
-
void
getAtom(int atomNum, int stepInFrame, Atom &atom)¶ Copy data for atom
atomNumat stepstepInFramefromatom.
-
void
printStats()¶ Print min, max, mean, std. of each x, y, z components of positions.
Private Functions
-
void
deallocateArrays()¶
-
int
getIndex(int atomNum, int stepInFrame)¶ Return index of atom position in arrays.
Private Members
-
bool
allocated¶ Whether the position arrays have been allocated.
-
void