Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
PLMD::gridtools::GridCoordinatesObject Class Reference

#include <GridCoordinatesObject.h>

Public Member Functions

void convertIndexToIndices (const unsigned &index, const std::vector< unsigned > &nnbin, std::vector< unsigned > &indices) const
 Convert an index into indices. More...
 
double getCellVolume () const
 Return the volume of one of the grid cells. More...
 
unsigned getDimension () const
 Get the dimensionality of the function. More...
 
void getGridPointCoordinates (const unsigned &, std::vector< double > &) const
 Get the coordinates for a point in the grid. More...
 
void getGridPointCoordinates (const unsigned &, std::vector< unsigned > &, std::vector< double > &) const
 
const std::vector< double > & getGridSpacing () const
 Get the spacing between grid points. More...
 
std::string getGridType () const
 Get the type of the grid. More...
 
unsigned getIndex (const std::vector< double > &p) const
 Convert a point in space the the correspoinding grid point. More...
 
unsigned getIndex (const std::vector< unsigned > &indices) const
 Flatten the grid and get the grid index for a point. More...
 
void getIndices (const std::vector< double > &point, std::vector< unsigned > &indices) const
 Get the indices of a particular point. More...
 
void getIndices (const unsigned &index, std::vector< unsigned > &indices) const
 Get the indices fof a point. More...
 
std::vector< std::string > getMax () const
 Get the vector containing the maximum value of the grid in each dimension. More...
 
std::vector< std::string > getMin () const
 Get the vector containing the minimum value of the grid in each dimension. More...
 
std::vector< unsigned > getNbin (const bool &shape) const
 Get the number of grid points for each dimension. More...
 
void getNeighbors (const std::vector< double > &pp, const std::vector< unsigned > &nneigh, unsigned &num_neighbours, std::vector< unsigned > &neighbors) const
 Get the set of points neighouring a particular location in space. More...
 
void getNeighbors (const std::vector< unsigned > &indices, const std::vector< unsigned > &nneigh, unsigned &num_neighbors, std::vector< unsigned > &neighbors) const
 Get the neighbors for a set of indices of a point. More...
 
unsigned getNumberOfPoints () const
 Get the number of points in the grid. More...
 
void getSplineNeighbors (const unsigned &mybox, unsigned &nneighbors, std::vector< unsigned > &mysneigh) const
 Get the points neighboring a particular spline point. More...
 
const std::vector< unsigned > & getStride () const
 Get the stride (the distance between the grid points of an index) More...
 
bool inbounds (const std::vector< double > &point) const
 Check if a point is within the grid boundaries. More...
 
bool isPeriodic (const unsigned &i) const
 Is the grid periodic in the ith direction. More...
 
void putCoordinateAtValue (const unsigned &, const double &, std::vector< double > &) const
 Create a coordinate that has this value of the grid. More...
 
void setBounds (const std::vector< std::string > &smin, const std::vector< std::string > &smax, const std::vector< unsigned > &nbins, std::vector< double > &spacing)
 Set the minimum and maximum of the grid. More...
 
void setup (const std::string &geom, const std::vector< bool > &ipbc, const unsigned &np, const double &fib_cutoff)
 Setup the grid. More...
 

Private Types

enum  { flat, fibonacci }
 The way that grid points are constructed. More...
 

Private Member Functions

void getFibonacciCoordinates (const unsigned &ipoint, std::vector< double > &x) const
 Get the coordinates on the Fibonacci grid. More...
 
unsigned getFibonacciIndex (const std::vector< double > &p) const
 Get the index of the closest point on the fibonacci sphere. More...
 
void getFlatGridCoordinates (const unsigned &ipoint, std::vector< unsigned > &tindices, std::vector< double > &x) const
 Get the flat grid coordinates. More...
 

Private Attributes

bool bounds_set
 Have the bounds been setup on the grid. More...
 
unsigned dimension
 The dimensionality of the grid. More...
 
std::vector< double > dx
 The spacing between grid points. More...
 
double fib_increment
 
std::vector< std::vector< unsigned > > fib_nlist
 
double fib_offset
 Fib increment here is equal to 2*pi*(INVERSE GOLDEN RATIO) More...
 
double fib_shift
 
double golden
 
enum PLMD::gridtools::GridCoordinatesObject:: { ... }  gtype
 The way that grid points are constructed. More...
 
double igolden
 
double log_golden2
 
std::vector< double > max
 
std::vector< double > min
 The minimum and maximum of the grid stored as doubles. More...
 
std::vector< unsigned > nbin
 The number of bins in each grid direction. More...
 
unsigned npoints
 The number of points in the grid. More...
 
std::vector< bool > pbc
 Is this direction periodic. More...
 
double root5
 Stuff for fibonacci grids. More...
 
std::vector< std::string > str_max
 
std::vector< std::string > str_min
 The minimum and maximum in the grid stored as strings. More...
 
std::vector< unsigned > stride
 The numerical distance between adjacent grid points. More...
 

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
private

The way that grid points are constructed.

Enumerator
flat 
fibonacci 

Member Function Documentation

◆ convertIndexToIndices()

void PLMD::gridtools::GridCoordinatesObject::convertIndexToIndices ( const unsigned &  index,
const std::vector< unsigned > &  nnbin,
std::vector< unsigned > &  indices 
) const

Convert an index into indices.

◆ getCellVolume()

double PLMD::gridtools::GridCoordinatesObject::getCellVolume ( ) const
inline

Return the volume of one of the grid cells.

◆ getDimension()

unsigned PLMD::gridtools::GridCoordinatesObject::getDimension ( ) const
inline

Get the dimensionality of the function.

◆ getFibonacciCoordinates()

void PLMD::gridtools::GridCoordinatesObject::getFibonacciCoordinates ( const unsigned &  ipoint,
std::vector< double > &  x 
) const
private

Get the coordinates on the Fibonacci grid.

◆ getFibonacciIndex()

unsigned PLMD::gridtools::GridCoordinatesObject::getFibonacciIndex ( const std::vector< double > &  p) const
private

Get the index of the closest point on the fibonacci sphere.

◆ getFlatGridCoordinates()

void PLMD::gridtools::GridCoordinatesObject::getFlatGridCoordinates ( const unsigned &  ipoint,
std::vector< unsigned > &  tindices,
std::vector< double > &  x 
) const
private

Get the flat grid coordinates.

◆ getGridPointCoordinates() [1/2]

void PLMD::gridtools::GridCoordinatesObject::getGridPointCoordinates ( const unsigned &  ipoint,
std::vector< double > &  x 
) const

Get the coordinates for a point in the grid.

◆ getGridPointCoordinates() [2/2]

void PLMD::gridtools::GridCoordinatesObject::getGridPointCoordinates ( const unsigned &  ipoint,
std::vector< unsigned > &  tindices,
std::vector< double > &  x 
) const

◆ getGridSpacing()

const std::vector< double > & PLMD::gridtools::GridCoordinatesObject::getGridSpacing ( ) const
inline

Get the spacing between grid points.

◆ getGridType()

std::string PLMD::gridtools::GridCoordinatesObject::getGridType ( ) const
inline

Get the type of the grid.

◆ getIndex() [1/2]

unsigned PLMD::gridtools::GridCoordinatesObject::getIndex ( const std::vector< double > &  p) const

Convert a point in space the the correspoinding grid point.

◆ getIndex() [2/2]

unsigned PLMD::gridtools::GridCoordinatesObject::getIndex ( const std::vector< unsigned > &  indices) const

Flatten the grid and get the grid index for a point.

◆ getIndices() [1/2]

void PLMD::gridtools::GridCoordinatesObject::getIndices ( const std::vector< double > &  point,
std::vector< unsigned > &  indices 
) const

Get the indices of a particular point.

◆ getIndices() [2/2]

void PLMD::gridtools::GridCoordinatesObject::getIndices ( const unsigned &  index,
std::vector< unsigned > &  indices 
) const

Get the indices fof a point.

◆ getMax()

std::vector< std::string > PLMD::gridtools::GridCoordinatesObject::getMax ( ) const

Get the vector containing the maximum value of the grid in each dimension.

◆ getMin()

std::vector< std::string > PLMD::gridtools::GridCoordinatesObject::getMin ( ) const

Get the vector containing the minimum value of the grid in each dimension.

◆ getNbin()

std::vector< unsigned > PLMD::gridtools::GridCoordinatesObject::getNbin ( const bool &  shape) const

Get the number of grid points for each dimension.

◆ getNeighbors() [1/2]

void PLMD::gridtools::GridCoordinatesObject::getNeighbors ( const std::vector< double > &  pp,
const std::vector< unsigned > &  nneigh,
unsigned &  num_neighbours,
std::vector< unsigned > &  neighbors 
) const

Get the set of points neighouring a particular location in space.

◆ getNeighbors() [2/2]

void PLMD::gridtools::GridCoordinatesObject::getNeighbors ( const std::vector< unsigned > &  indices,
const std::vector< unsigned > &  nneigh,
unsigned &  num_neighbors,
std::vector< unsigned > &  neighbors 
) const

Get the neighbors for a set of indices of a point.

◆ getNumberOfPoints()

unsigned PLMD::gridtools::GridCoordinatesObject::getNumberOfPoints ( ) const
inline

Get the number of points in the grid.

◆ getSplineNeighbors()

void PLMD::gridtools::GridCoordinatesObject::getSplineNeighbors ( const unsigned &  mybox,
unsigned &  nneighbors,
std::vector< unsigned > &  mysneigh 
) const

Get the points neighboring a particular spline point.

◆ getStride()

const std::vector< unsigned > & PLMD::gridtools::GridCoordinatesObject::getStride ( ) const
inline

Get the stride (the distance between the grid points of an index)

◆ inbounds()

bool PLMD::gridtools::GridCoordinatesObject::inbounds ( const std::vector< double > &  point) const

Check if a point is within the grid boundaries.

◆ isPeriodic()

bool PLMD::gridtools::GridCoordinatesObject::isPeriodic ( const unsigned &  i) const
inline

Is the grid periodic in the ith direction.

◆ putCoordinateAtValue()

void PLMD::gridtools::GridCoordinatesObject::putCoordinateAtValue ( const unsigned &  ind,
const double &  val,
std::vector< double > &  coords 
) const

Create a coordinate that has this value of the grid.

◆ setBounds()

void PLMD::gridtools::GridCoordinatesObject::setBounds ( const std::vector< std::string > &  smin,
const std::vector< std::string > &  smax,
const std::vector< unsigned > &  nbins,
std::vector< double > &  spacing 
)

Set the minimum and maximum of the grid.

◆ setup()

void PLMD::gridtools::GridCoordinatesObject::setup ( const std::string &  geom,
const std::vector< bool > &  ipbc,
const unsigned &  np,
const double &  fib_cutoff 
)

Setup the grid.

Member Data Documentation

◆ bounds_set

bool PLMD::gridtools::GridCoordinatesObject::bounds_set
private

Have the bounds been setup on the grid.

◆ dimension

unsigned PLMD::gridtools::GridCoordinatesObject::dimension
private

The dimensionality of the grid.

◆ dx

std::vector<double> PLMD::gridtools::GridCoordinatesObject::dx
private

The spacing between grid points.

◆ fib_increment

double PLMD::gridtools::GridCoordinatesObject::fib_increment
private

◆ fib_nlist

std::vector<std::vector<unsigned> > PLMD::gridtools::GridCoordinatesObject::fib_nlist
private

◆ fib_offset

double PLMD::gridtools::GridCoordinatesObject::fib_offset
private

Fib increment here is equal to 2*pi*(INVERSE GOLDEN RATIO)

◆ fib_shift

double PLMD::gridtools::GridCoordinatesObject::fib_shift
private

◆ golden

double PLMD::gridtools::GridCoordinatesObject::golden
private

◆ gtype

enum { ... } PLMD::gridtools::GridCoordinatesObject::gtype

The way that grid points are constructed.

◆ igolden

double PLMD::gridtools::GridCoordinatesObject::igolden
private

◆ log_golden2

double PLMD::gridtools::GridCoordinatesObject::log_golden2
private

◆ max

std::vector<double> PLMD::gridtools::GridCoordinatesObject::max
private

◆ min

std::vector<double> PLMD::gridtools::GridCoordinatesObject::min
private

The minimum and maximum of the grid stored as doubles.

◆ nbin

std::vector<unsigned> PLMD::gridtools::GridCoordinatesObject::nbin
private

The number of bins in each grid direction.

◆ npoints

unsigned PLMD::gridtools::GridCoordinatesObject::npoints
private

The number of points in the grid.

◆ pbc

std::vector<bool> PLMD::gridtools::GridCoordinatesObject::pbc
private

Is this direction periodic.

◆ root5

double PLMD::gridtools::GridCoordinatesObject::root5
private

Stuff for fibonacci grids.

◆ str_max

std::vector<std::string> PLMD::gridtools::GridCoordinatesObject::str_max
private

◆ str_min

std::vector<std::string> PLMD::gridtools::GridCoordinatesObject::str_min
private

The minimum and maximum in the grid stored as strings.

◆ stride

std::vector<unsigned> PLMD::gridtools::GridCoordinatesObject::stride
private

The numerical distance between adjacent grid points.


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