#include <GridVessel.h>
Public Member Functions | |
GridVessel (const vesselbase::VesselOptions &) | |
Constructor. More... | |
void | activateThesePoints (const std::vector< bool > &to_activate) |
Deactivate all the grid points. More... | |
void | addToGridElement (const unsigned &ipoint, const unsigned &jelement, const double &value) |
Add data to an element of the grid. More... | |
bool | applyForce (std::vector< double > &fforces) override |
And retrieve the forces. More... | |
void | calculate (const unsigned ¤t, MultiValue &myvals, std::vector< double > &buffer, std::vector< unsigned > &der_list) const override |
Copy data from the action into the grid. More... | |
void | checkRead () |
Check that readin was fine. More... | |
virtual void | clear () |
Clear all the data stored on the grid. More... | |
void | convertIndexToIndices (const unsigned &index, const std::vector< unsigned > &nnbin, std::vector< unsigned > &indices) const |
Convert an index into indices. More... | |
std::string | description () override |
Get a description of the grid to output to the log. More... | |
void | finish (const std::vector< double > &buffer) override |
Finish the calculation. More... | |
double | getCellVolume () const |
Return the volume of one of the grid cells. More... | |
std::string | getComponentName (const unsigned &i) const |
Get the name of the ith component. More... | |
double | getCubeUnits () const |
This ensures that Gaussian cube files are in correct units. More... | |
unsigned | getDimension () const |
Get the dimensionality of the function. More... | |
virtual double | getFibonacciCutoff () const |
Get the cutoff to use for the Fibonacci spheres. More... | |
virtual void | getFinalForces (const std::vector< double > &buffer, std::vector< double > &finalForces) |
This retrieves the final force. More... | |
double | getGridElement (const std::vector< unsigned > &, const unsigned &) const |
Operations on one of the elements of grid point specified by vector. More... | |
virtual double | getGridElement (const unsigned &, const unsigned &) const |
Get the value of the ith grid element. More... | |
double | getGridExtent (const unsigned &i) const |
Get the extent of the grid in one of the axis. 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... | |
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::string | getInputString () const |
Return a string containing the input to the grid so we can clone it. More... | |
std::string | getLabel () const |
Return the label. 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::string | getName () const |
Return the name. More... | |
std::vector< unsigned > | getNbin () 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... | |
double | getNorm () const |
virtual unsigned | getNumberOfBufferPoints () const |
Get the number of points needed in the buffer. More... | |
virtual unsigned | getNumberOfComponents () const |
Get the number of components in the vector stored on each grid point. More... | |
unsigned | getNumberOfPoints () const |
Get the number of points in the grid. More... | |
unsigned | getNumberOfQuantities () const |
Get the number of quantities we have stored at each grid point. 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... | |
std::string | getType () const |
Get the type of grid we are using. More... | |
double | getValueAndDerivatives (const std::vector< double > &x, const unsigned &ind, std::vector< double > &der) const |
Get the value and derivatives at a particular location using spline interpolation. More... | |
bool | inactive (const unsigned &ip) const |
Is this point active. More... | |
bool | isPeriodic (const unsigned &i) const |
Is the grid periodic in the ith direction. More... | |
bool | noDerivatives () const |
Does this have derivatives. More... | |
virtual void | prepare () |
Do something before the loop. More... | |
virtual void | reset () |
Reset the grid so that it is cleared at start of next time it is calculated. More... | |
void | resize () override |
Set the size of the buffer equal to nper*npoints. More... | |
virtual void | setBounds (const std::vector< std::string > &smin, const std::vector< std::string > &smax, const std::vector< unsigned > &nbins, const std::vector< double > &spacing) |
Set the minimum and maximum of the grid. More... | |
virtual void | setBufferStart (unsigned &start) |
Set the start of the buffer. More... | |
void | setCubeUnits (const double &units) |
This ensures that Gaussian cube fies are in correct units. More... | |
void | setForce (const std::vector< double > &inforces) |
Apply the forces. More... | |
void | setGridElement (const std::vector< unsigned > &, const unsigned &, const double &) |
void | setGridElement (const unsigned &, const unsigned &, const double &) |
Operations on one of the elements of grid point i. More... | |
void | setNoDerivatives () |
Remove the derivatives. More... | |
void | setNorm (const double &snorm) |
Functions for dealing with normalisation constant. More... | |
void | setupFibonacciGrid (const unsigned &np) |
Setup the grid if it is a fibonacci grid on the surface of a sphere. More... | |
void | setValueAndDerivatives (const unsigned &, const unsigned &, const double &, const std::vector< double > &) |
Set the values and derivatives of a particular element. More... | |
virtual MultiValue & | transformDerivatives (const unsigned ¤t, MultiValue &myvals, MultiValue &bvals) |
This is replaced in bridges so we can transform the derivatives. More... | |
bool | wasForced () const |
Was a force added to the grid. More... | |
bool | wasreset () const |
Was the grid cleared on the last step. More... | |
Static Public Member Functions | |
static void | registerKeywords (Keywords &keys) |
keywords More... | |
static std::string | transformName (const std::string &name) |
Convert the name to the label of the component. More... | |
Protected Member Functions | |
void | addDataElement (const unsigned &myelem, const double &value) |
Add some value to an element of the data array. More... | |
void | error (const std::string &errmsg) |
Report an error. More... | |
ActionWithVessel * | getAction () const |
Return a pointer to the action we are working in. More... | |
std::string | getAllInput () |
This returns the whole input line (it is used for less_than/more_than/between) More... | |
double | getDataElement (const unsigned &myelem) const |
Get the value of one of the data element. More... | |
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... | |
unsigned | getIndex (const std::vector< double > &p) const |
Convert a point in space the the correspoinding grid point. More... | |
double | getNLTolerance () const |
Return the value of the neighbor list tolerance. More... | |
int | getNumericalLabel () const |
Return the numerical label. More... | |
unsigned | getSizeOfBuffer () const |
Return the size of the buffer. More... | |
double | getTolerance () const |
Return the value of the tolerance. More... | |
bool | noAverage () const |
Are we averaging the data. More... | |
template<class T > | |
void | parse (const std::string &key, T &t) |
Parse something from the input. More... | |
void | parseFlag (const std::string &key, bool &t) |
Parse one keyword as boolean flag. More... | |
template<class T > | |
void | parseVector (const std::string &key, std::vector< T > &t) |
Parse one keyword as std::vector. More... | |
void | resizeBuffer (const unsigned &n) |
Set the size of the data buffer. More... | |
void | setDataElement (const unsigned &myelem, const double &value) |
Set an element of the data array. More... | |
void | setDataSize (const unsigned &size) |
Set the size of the data vector. More... | |
Protected Attributes | |
std::vector< bool > | active |
Which grid points are we actively accumulating. More... | |
std::vector< std::string > | arg_names |
The names of the various columns in the grid file. More... | |
unsigned | bufstart |
The start of this Vessel's buffer in buffer in the underlying ActionWithVessel. More... | |
unsigned | dimension |
The dimensionality of the grid. More... | |
std::vector< double > | dx |
The spacing between grid points. More... | |
std::vector< double > | forces |
Forces acting on grid elements. More... | |
bool | noderiv |
Do we have derivatives. More... | |
unsigned | nper |
The number of pieces of information we are storing for each point in the grid. More... | |
std::vector< bool > | pbc |
Is this direction periodic. More... | |
std::vector< std::string > | str_max |
std::vector< std::string > | str_min |
The minimum and maximum in the grid stored as strings. More... | |
bool | wasforced |
Is forced. More... | |
Private Types | |
enum | { flat, fibonacci } |
The way that grid points are constructed. More... | |
Private Attributes | |
ActionWithVessel * | action |
The action that this vessel is created within. More... | |
bool | bounds_set |
Have the minimum and maximum for the grid been set. More... | |
unsigned | bufsize |
The number of elements in this vessel's buffered data. More... | |
double | cube_units |
Units for Gaussian Cube file. More... | |
unsigned | currentGridPoint |
The grid point that was requested last by getGridPointCoordinates. More... | |
std::vector< double > | data |
The data that is being averaged. 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 |
std::vector< double > | finalForces |
The forces that will be output at the end of the calculation. More... | |
bool | finished_read |
This just checks we have done checkRead. More... | |
bool | foundprint |
This flag is used to check if the user has created a valid input. More... | |
double | golden |
enum PLMD::gridtools::GridVessel:: { ... } | gtype |
The way that grid points are constructed. More... | |
double | igolden |
const PLMD::Keywords & | keywords |
The keywords. More... | |
std::vector< std::string > | line |
Directive line. More... | |
double | log_golden2 |
std::vector< double > | max |
std::vector< double > | min |
The minimum and maximum of the grid stored as doubles. More... | |
std::string | mylabel |
The label for the vessel for referencing. More... | |
std::string | myname |
The keyword for the vessel in the input file. More... | |
std::vector< unsigned > | nbin |
The number of bins in each grid direction. More... | |
unsigned | npoints |
The number of points in the grid. More... | |
const int | numlab |
The numerical label for this object. More... | |
double | root5 |
Stuff for fibonacci grids. More... | |
std::vector< unsigned > | stride |
The numerical distance between adjacent grid points. More... | |
bool | unormalised |
Are we outputting unormalised data. More... | |
bool | wascleared |
The grid was recently cleared and bounds can be set. More... | |
Friends | |
class | ActionWithInputGrid |
class | DumpGrid |
|
explicit |
Constructor.
void PLMD::gridtools::GridVessel::activateThesePoints | ( | const std::vector< bool > & | to_activate | ) |
Deactivate all the grid points.
|
inlineprotectedinherited |
Add some value to an element of the data array.
void PLMD::gridtools::GridVessel::addToGridElement | ( | const unsigned & | ipoint, |
const unsigned & | jelement, | ||
const double & | value | ||
) |
Add data to an element of the grid.
|
overridevirtual |
And retrieve the forces.
Implements PLMD::vesselbase::Vessel.
|
overridevirtual |
Copy data from the action into the grid.
Implements PLMD::vesselbase::Vessel.
Reimplemented in PLMD::gridtools::HistogramOnGrid.
|
inherited |
Check that readin was fine.
|
virtualinherited |
Clear all the data stored on the grid.
void PLMD::gridtools::GridVessel::convertIndexToIndices | ( | const unsigned & | index, |
const std::vector< unsigned > & | nnbin, | ||
std::vector< unsigned > & | indices | ||
) | const |
Convert an index into indices.
|
overridevirtual |
Get a description of the grid to output to the log.
Implements PLMD::vesselbase::Vessel.
|
protectedinherited |
Report an error.
|
overridevirtual |
Finish the calculation.
Implements PLMD::vesselbase::Vessel.
Reimplemented in PLMD::gridtools::HistogramOnGrid.
|
inlineprotectedinherited |
Return a pointer to the action we are working in.
|
protectedinherited |
This returns the whole input line (it is used for less_than/more_than/between)
|
inline |
Return the volume of one of the grid cells.
|
inline |
Get the name of the ith component.
double PLMD::gridtools::GridVessel::getCubeUnits | ( | ) | const |
This ensures that Gaussian cube files are in correct units.
|
inlineprotectedinherited |
Get the value of one of the data element.
|
inline |
Get the dimensionality of the function.
|
protected |
Get the coordinates on the Fibonacci grid.
|
inlinevirtual |
Get the cutoff to use for the Fibonacci spheres.
Reimplemented in PLMD::gridtools::HistogramOnGrid.
|
protected |
Get the index of the closest point on the fibonacci sphere.
|
inlinevirtual |
This retrieves the final force.
Reimplemented in PLMD::gridtools::HistogramOnGrid, and PLMD::gridtools::AverageOnGrid.
|
protected |
Get the flat grid coordinates.
double PLMD::gridtools::GridVessel::getGridElement | ( | const std::vector< unsigned > & | indices, |
const unsigned & | jelement | ||
) | const |
Operations on one of the elements of grid point specified by vector.
|
virtual |
Get the value of the ith grid element.
Reimplemented in PLMD::gridtools::AverageOnGrid.
|
inline |
Get the extent of the grid in one of the axis.
void PLMD::gridtools::GridVessel::getGridPointCoordinates | ( | const unsigned & | ipoint, |
std::vector< double > & | x | ||
) | const |
Get the coordinates for a point in the grid.
void PLMD::gridtools::GridVessel::getGridPointCoordinates | ( | const unsigned & | ipoint, |
std::vector< unsigned > & | tindices, | ||
std::vector< double > & | x | ||
) | const |
|
inline |
Get the spacing between grid points.
|
protected |
Convert a point in space the the correspoinding grid point.
unsigned PLMD::gridtools::GridVessel::getIndex | ( | const std::vector< unsigned > & | indices | ) | const |
Flatten the grid and get the grid index for a point.
void PLMD::gridtools::GridVessel::getIndices | ( | const std::vector< double > & | point, |
std::vector< unsigned > & | indices | ||
) | const |
Get the indices of a particular point.
void PLMD::gridtools::GridVessel::getIndices | ( | const unsigned & | index, |
std::vector< unsigned > & | indices | ||
) | const |
Get the indices fof a point.
std::string PLMD::gridtools::GridVessel::getInputString | ( | ) | const |
Return a string containing the input to the grid so we can clone it.
|
inherited |
Return the label.
std::vector< std::string > PLMD::gridtools::GridVessel::getMax | ( | ) | const |
Get the vector containing the maximum value of the grid in each dimension.
std::vector< std::string > PLMD::gridtools::GridVessel::getMin | ( | ) | const |
Get the vector containing the minimum value of the grid in each dimension.
|
inherited |
Return the name.
std::vector< unsigned > PLMD::gridtools::GridVessel::getNbin | ( | ) | const |
Get the number of grid points for each dimension.
void PLMD::gridtools::GridVessel::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.
void PLMD::gridtools::GridVessel::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.
|
inlineprotectedinherited |
Return the value of the neighbor list tolerance.
|
inlineinherited |
|
inlinevirtual |
Get the number of points needed in the buffer.
Reimplemented in PLMD::gridtools::HistogramOnGrid.
|
inlinevirtual |
Get the number of components in the vector stored on each grid point.
Reimplemented in PLMD::gridtools::AverageOnGrid.
|
inline |
Get the number of points in the grid.
|
inline |
Get the number of quantities we have stored at each grid point.
|
inlineprotectedinherited |
Return the numerical label.
|
inlineprotectedinherited |
Return the size of the buffer.
void PLMD::gridtools::GridVessel::getSplineNeighbors | ( | const unsigned & | mybox, |
unsigned & | nneighbors, | ||
std::vector< unsigned > & | mysneigh | ||
) | const |
Get the points neighboring a particular spline point.
|
inline |
Get the stride (the distance between the grid points of an index)
|
inlineprotectedinherited |
Return the value of the tolerance.
|
inline |
Get the type of grid we are using.
double PLMD::gridtools::GridVessel::getValueAndDerivatives | ( | const std::vector< double > & | x, |
const unsigned & | ind, | ||
std::vector< double > & | der | ||
) | const |
Get the value and derivatives at a particular location using spline interpolation.
|
inline |
Is this point active.
|
inline |
Is the grid periodic in the ith direction.
|
inlineprotectedinherited |
Are we averaging the data.
|
inline |
Does this have derivatives.
|
protectedinherited |
Parse something from the input.
|
protectedinherited |
Parse one keyword as boolean flag.
|
protectedinherited |
Parse one keyword as std::vector.
|
inlinevirtualinherited |
Do something before the loop.
Reimplemented in PLMD::vesselbase::BridgeVessel, and PLMD::mapping::SpathVessel.
|
static |
keywords
|
virtualinherited |
Reset the grid so that it is cleared at start of next time it is calculated.
|
overridevirtual |
Set the size of the buffer equal to nper*npoints.
Implements PLMD::vesselbase::Vessel.
|
inlineprotectedinherited |
Set the size of the data buffer.
|
virtual |
Set the minimum and maximum of the grid.
Reimplemented in PLMD::gridtools::HistogramOnGrid.
|
inlinevirtualinherited |
Set the start of the buffer.
Reimplemented in PLMD::vesselbase::BridgeVessel.
void PLMD::gridtools::GridVessel::setCubeUnits | ( | const double & | units | ) |
This ensures that Gaussian cube fies are in correct units.
|
inlineprotectedinherited |
Set an element of the data array.
|
protectedinherited |
Set the size of the data vector.
void PLMD::gridtools::GridVessel::setForce | ( | const std::vector< double > & | inforces | ) |
Apply the forces.
void PLMD::gridtools::GridVessel::setGridElement | ( | const std::vector< unsigned > & | indices, |
const unsigned & | jelement, | ||
const double & | value | ||
) |
void PLMD::gridtools::GridVessel::setGridElement | ( | const unsigned & | ipoint, |
const unsigned & | jelement, | ||
const double & | value | ||
) |
Operations on one of the elements of grid point i.
void PLMD::gridtools::GridVessel::setNoDerivatives | ( | ) |
Remove the derivatives.
|
inlineinherited |
Functions for dealing with normalisation constant.
void PLMD::gridtools::GridVessel::setupFibonacciGrid | ( | const unsigned & | np | ) |
Setup the grid if it is a fibonacci grid on the surface of a sphere.
void PLMD::gridtools::GridVessel::setValueAndDerivatives | ( | const unsigned & | ipoint, |
const unsigned & | jelement, | ||
const double & | value, | ||
const std::vector< double > & | der | ||
) |
Set the values and derivatives of a particular element.
|
inlinevirtualinherited |
This is replaced in bridges so we can transform the derivatives.
Reimplemented in PLMD::vesselbase::BridgeVessel.
|
staticinherited |
Convert the name to the label of the component.
bool PLMD::gridtools::GridVessel::wasForced | ( | ) | const |
Was a force added to the grid.
|
inherited |
Was the grid cleared on the last step.
|
friend |
|
friend |
|
privateinherited |
The action that this vessel is created within.
|
protected |
Which grid points are we actively accumulating.
|
protected |
The names of the various columns in the grid file.
|
private |
Have the minimum and maximum for the grid been set.
|
privateinherited |
The number of elements in this vessel's buffered data.
|
protectedinherited |
The start of this Vessel's buffer in buffer in the underlying ActionWithVessel.
|
private |
Units for Gaussian Cube file.
|
private |
The grid point that was requested last by getGridPointCoordinates.
|
privateinherited |
The data that is being averaged.
|
protected |
The dimensionality of the grid.
|
protected |
The spacing between grid points.
|
private |
|
private |
|
private |
Fib increment here is equal to 2*pi*(INVERSE GOLDEN RATIO)
|
private |
|
private |
The forces that will be output at the end of the calculation.
|
privateinherited |
This just checks we have done checkRead.
|
protected |
Forces acting on grid elements.
|
private |
This flag is used to check if the user has created a valid input.
|
private |
enum { ... } PLMD::gridtools::GridVessel::gtype |
The way that grid points are constructed.
|
private |
|
privateinherited |
The keywords.
|
privateinherited |
Directive line.
This line is progressively erased during vessel construction so as to check if all the present keywords are correct.
|
private |
|
private |
|
private |
The minimum and maximum of the grid stored as doubles.
|
privateinherited |
The label for the vessel for referencing.
|
privateinherited |
The keyword for the vessel in the input file.
|
private |
The number of bins in each grid direction.
|
protected |
Do we have derivatives.
|
protected |
The number of pieces of information we are storing for each point in the grid.
|
private |
The number of points in the grid.
|
privateinherited |
The numerical label for this object.
|
protected |
Is this direction periodic.
|
private |
Stuff for fibonacci grids.
|
protected |
|
protected |
The minimum and maximum in the grid stored as strings.
|
private |
The numerical distance between adjacent grid points.
|
privateinherited |
Are we outputting unormalised data.
|
privateinherited |
The grid was recently cleared and bounds can be set.
|
protected |
Is forced.
Hosted by GitHub | 1.8.17 |