Template Class CellListPotential#
Defined in File cell_list_potential.hpp
Inheritance Relationships#
Base Type#
public pele::PairwisePotentialInterface(Class PairwisePotentialInterface)
Class Documentation#
-
template<typename pairwise_interaction, typename distance_policy>
class CellListPotential : public pele::PairwisePotentialInterface# Potential to loop over the list of atom pairs generated with the cell list implementation in cell_lists.h.
This should also do the cell list construction and refresh, such that the interface is the same for the user as with SimplePairwise.
Public Functions
-
inline ~CellListPotential()#
- std::shared_ptr<pairwise_interaction> interaction,
- std::shared_ptr<distance_policy> dist,
- pele::Array<double> const &boxvec,
- double ncellx_scale,
- const pele::Array<double> radii,
- NonAdditiveCutoffCalculator cutoff_calculator,
- const double radii_sca = 0.0,
- const bool balance_omp = true,
- const bool exact_sum = false
- std::shared_ptr<pairwise_interaction> interaction,
- std::shared_ptr<distance_policy> dist,
- pele::Array<double> const &boxvec,
- double rcut,
- double ncellx_scale,
- const pele::Array<double> radii,
- const double radii_sca = 0.0,
- const bool balance_omp = true,
- const bool exact_sum = false,
- const double non_additivity = 0.0
- std::shared_ptr<pairwise_interaction> interaction,
- std::shared_ptr<distance_policy> dist,
- pele::Array<double> const &boxvec,
- double rcut,
- double ncellx_scale,
- const bool balance_omp = true,
- const bool exact_sum = false
-
inline virtual size_t get_ndim()#
-
inline virtual double get_energy(Array<double> const &coords)#
Return the energy of configuration x.
This is the only function which must be overloaded
- inline virtual double get_energy_change(
- Array<double> const &old_coords,
- Array<double> const &new_coords,
- std::vector<size_t> const &changed_atoms
Return the change in energy when configuration A is changed to configuration B.
It also takes in the vector of indices of atoms changed to recalculate energies changed by those atoms.
- inline virtual double get_energy_gradient( )#
compute the energy and gradient.
If not overloaded it will compute the numerical gradient
- inline virtual double add_energy_gradient_hessian( )#
Adds the gradient and hessian of the potential to the arrays.
- Parameters:
coords –
grad –
hess –
- Returns:
double
- inline virtual double add_energy_gradient( )#
Adds the gradient of the potential to the array.
- Parameters:
coords –
grad –
- Returns:
double
- inline virtual double get_energy_gradient_hessian( )#
compute the energy and gradient and Hessian.
If not overloaded it will compute the Hessian numerically and use get_energy_gradient to get the energy and gradient.
- inline virtual void get_neighbors(
- pele::Array<double> const &coords,
- pele::Array<std::vector<size_t>> &neighbor_indexes,
- pele::Array<std::vector<std::vector<double>>> &neighbor_displacements,
- const double cutoff_factor = 1.0
Return lists of neighbors.
- inline virtual void get_neighbors_picky(
- pele::Array<double> const &coords,
- pele::Array<std::vector<size_t>> &neighbor_indexes,
- pele::Array<std::vector<std::vector<double>>> &neighbor_displacements,
- pele::Array<short> const &include_atoms,
- const double cutoff_factor = 1.0
Return lists of neighbors considering only certain atoms.
-
inline virtual std::vector<size_t> get_overlaps(Array<double> const &coords)#
Return linearized vector of overlapping atoms.
Every two entries in the resulting vector correspond to a pair of overlapping atoms.
-
inline virtual pele::Array<size_t> get_atom_order(Array<double> &coords)#
Return a computationally sensible order for sorting the atoms.
This is primarily used for better caching when using cell lists. If sorting atoms is not useful, it returns an empty Pele-Array.
-
inline virtual size_t get_ndim() const#
Return the number of dimensions (box dimensions).
Ideally this should be overloaded.
- inline virtual void get_rij(
- double *const r_ij,
- double const *const r1,
- double const *const r2
Return the distance as measured by the distance policy.
- inline virtual double get_interaction_energy_gradient(
- double r2,
- double *gij,
- size_t atom_i,
- size_t atom_j
Return energy_gradient of interaction.
- inline virtual double get_interaction_energy_gradient_hessian(
- double r2,
- double *gij,
- double *hij,
- size_t atom_i,
- size_t atom_j
Return gradient and Hessian of interaction.
Protected Attributes
-
pele::CellLists<distance_policy> m_cell_lists#
-
std::shared_ptr<pairwise_interaction> m_interaction#
-
std::shared_ptr<distance_policy> m_dist#
-
const double m_radii_sca#
-
bool exact_sum#
-
bool exact_gradient_initialized#
-
std::shared_ptr<std::vector<xsum_small_accumulator>> exact_gradient#
-
EnergyAccumulatorExact<pairwise_interaction, distance_policy> *m_eAccExact#
-
EnergyGradientAccumulatorExact<pairwise_interaction, distance_policy> *m_egAccExact#
-
EnergyGradientHessianAccumulatorExact<pairwise_interaction, distance_policy> *m_eghAccExact#
Protected Static Attributes
-
static const size_t m_ndim = distance_policy::_ndim#
-
inline ~CellListPotential()#