MDBase.h

Basic quantities related to the MD simulation.

Contains time-independent data such as grid and atom information, as well as time-dependent information such as the substrate and monolayer extents.

struct BoxBounds
#include <MDBase.h>

Simulation box bounds, as defined in the LAMMPS dumpfile.

This data is updated each timestep.

See
DumpfileReader

Public Members

double xlo
double xhi
double ylo
double yhi
double zlo
double zhi
struct SimData
#include <MDBase.h>

Source of truth for general MD variables.

Variables are set here, and a pointer to this object is passed around and read elsewhere.

Public Functions

SimData(Options options)
~SimData()
void deleteWaterBonds()

Since water bonds are stored as a map from int to int*, those int*s must be allocated upon storage in the map. So we delete them here.

See
DatafileReader::readWaterBonds

void setOptions(Options options)

Copy a few important options directly to this object.

See
liquidTypes
See
solidTypes
See
stepsPerFrame
See
monoTop
See
substrateTop
See
numAtoms

void setNumSteps(int _numSteps)

Set numsteps and call setStepsPerFrame using value from Options::stepsPerFrame.

void setStepsPerFrame(int _stepsPerFrame)

Set the number of steps per frame and determine how many steps are in the last frame. Must be called after numSteps is defined. This function is called by setNumSteps.

See
LastFrame::setSteps

Public Members

Options options
int numAtoms
int numSteps
int numFrames
int stepsPerFrame
LastFrame lastFrame
vector<int> liquidTypes

Which atom types correspond to liquid.

vector<int> solidTypes

Which atom types correspond to substrate.

map<int, double> masses

Mass for each atom type.

map<int, int *> waterBonds

Maps oxygen atom id to two hydrogen atom ids.

See
DatafileReader::readWaterBonds

BoxBounds simBounds
double substrateTop

z coordinate of the top of the substrate.

If the substrate option is disabled, this can be manually specified via Options::substrateTop.

See
Substrate::findLimits

double monoTop

z coordinate of the top of the monolayer.

If the monolayer option is disabled, this can be manually specified in Options::monoTop.

See
Droplet::findMonolayer
See
Monolayer::findMonoLimits

Frame *framePtr
struct Grid
#include <MDBase.h>

Grid to use for 2D histogram.

Each bin in the grid has the same volume. dz and dv are specified by Options::dz and Options::dv, and determine the size of the bins. dr is determined automatically for each bin from the other two.

Public Functions

~Grid()

Call deallocateBins

void setBounds(double _zlo, double _zhi, double _rhi)
void setSpacing(double _dz, double _dv)
void init()

Set up grid after calling setBounds and setSpacing.

Calls calculateVolumeLimits, allocateBins, calculateBins

void calculateVolumeLimits()

Round upper z and r bounds in case dv or dz don’t evenly divide the z and r ranges.

Increase upper limits if total width is not divisible by required spacing (i.e. (zhi-zlo)dz != 0)

void allocateBins()

Allocate rVals before calling calculateBins.

Includes both endpoints https://root.cern.ch/root/roottalk/roottalk10/1170.html

void calculateBins()

Set rVals after calling allocateBins.

\(r_i = \sqrt{\frac{i\,dv}{\pi\,dz}} \)

void deallocateBins()

Deallocate rVals after using.

Public Members

double zlo
double zhi
double rhi
double vhi
double dz
double dv
int nz
int nv
int nr
double *rVals

\(r \) values of bin edges (including both min and max)

See
calculateBins
See
allocateBins

double zhi_preround

See
calculateVolumeLimits

double vhi_preround

See
calculateVolumeLimits

double rhi_preround

See
calculateVolumeLimits

bool allocated

Whether rVals has been allocated.