Gromacs  2020.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Member Functions
gmx::GridAxis Class Reference

#include <gromacs/awh/grid.h>

Description

An axis, i.e. dimension, of the grid.

Public Member Functions

 GridAxis (double origin, double end, double period, double pointDensity)
 Constructor. More...
 
 GridAxis (double origin, double end, double period, int numPoints)
 Constructor. More...
 
bool isPeriodic () const
 Returns if the axis has periodic boundaries.
 
double period () const
 Returns the period of the grid along the axis.
 
double origin () const
 Returns the grid origin along the axis.
 
double spacing () const
 Returns the grid point spacing along the axis.
 
int numPoints () const
 Returns the number of grid points along the axis.
 
int numPointsInPeriod () const
 Returns the period of the grid in points along the axis. More...
 
double length () const
 Returns the length of the interval. More...
 
int nearestIndex (double value) const
 Map a value to the nearest point index along an axis. More...
 

Constructor & Destructor Documentation

gmx::GridAxis::GridAxis ( double  origin,
double  end,
double  period,
double  pointDensity 
)

Constructor.

The spacing and number of points are set such that we have at least the requested point density. Requesting 0 point density results in the minimum number of points (2).

Parameters
[in]originStarting value.
[in]endEnd value.
[in]periodPeriod, pass 0 if not periodic.
[in]pointDensityRequested number of point per unit of axis length.
gmx::GridAxis::GridAxis ( double  origin,
double  end,
double  period,
int  numPoints 
)

Constructor.

Parameters
[in]originStarting value.
[in]endEnd value.
[in]periodPeriod, pass 0 if not periodic.
[in]numPointsThe number of points.

Member Function Documentation

double gmx::GridAxis::length ( ) const
inline

Returns the length of the interval.

This returns the distance obtained by connecting the origin point to the end point in the positive direction. Note that this is generally not the shortest distance. For period > 0, both origin and end are expected to take values in the same periodic interval.

int gmx::GridAxis::nearestIndex ( double  value) const

Map a value to the nearest point index along an axis.

Parameters
[in]valueValue along the axis.
Returns
the index nearest to the value.
int gmx::GridAxis::numPointsInPeriod ( ) const
inline

Returns the period of the grid in points along the axis.

Returns 0 if the axis is not periodic.


The documentation for this class was generated from the following files: