class rgpot::PotentialBase¶
Overview¶
Abstract base class for all potential energy surfaces. More…
#include <Potential.hpp>
class PotentialBase {
public:
// construction
PotentialBase(PotType inp_type);
virtual ~PotentialBase();
// methods
virtual std::tuple<double, types::AtomMatrix, double> operator()(const types::AtomMatrix& positions, const std::vector<int>& atmtypes, const std::array<std::array<double, 3>, 3>& box) = 0;
virtual PotCaps caps() const;
virtual uint64_t paramsKey() const;
PotType get_type() const;
};
Detailed Documentation¶
Abstract base class for all potential energy surfaces.
Construction¶
PotentialBase(PotType inp_type)
Constructor for PotentialBase.
Parameters:
inp_type |
The type of the potential. |
virtual ~PotentialBase()
Virtual destructor.
Methods¶
virtual std::tuple<double, types::AtomMatrix, double> operator()(const types::AtomMatrix& positions, const std::vector<int>& atmtypes, const std::array<std::array<double, 3>, 3>& box) = 0
Main interface for potential and force calculation.
Parameters:
positions |
The atomic coordinates. |
atmtypes |
The atomic numbers. |
box |
The simulation cell vectors. |
Returns:
A pair containing the energy and the force matrix. Energy, forces, and optional uncertainty scale (eV). See derived Potential::operator() for variance semantics.
virtual PotCaps caps() const
Concurrency and evaluation capabilities of this potential.
Multi-threaded callers (NEB images, dimer endpoints) derive their sharing and cloning policy from this instead of hard-coded lists.
virtual uint64_t paramsKey() const
Fingerprint of the potential’s parameter set.
Mixed into the result-cache key so results never cross parameter sets. Implementations hash their config field by field (see ParamHash.hpp) plus a kernel-version salt that changes whenever the numerics change. The default (0) suits parameter-free potentials whose numerics never changed.
PotType get_type() const
Fetches the potential type.
Returns:
The potential type.