class rgpot::TersoffSiC¶
Overview¶
Tersoff potential for silicon, carbon, and silicon-carbide. More…
#include <TersoffSiC.hpp>
class TersoffSiC: public rgpot::Potential< TersoffSiC > {
public:
// structs
struct Pair;
struct Species;
// fields
static double kChiSiC = 0.9776;
// construction
TersoffSiC();
// methods
virtual PotCaps caps() const;
virtual uint64_t paramsKey() const;
void forceImpl(const ForceInput& in, ForceOut* out) const;
void setHeldSkin(double skin);
void setNeighbourMode(nlist::Mode mode);
const nlist::NeighborList& heldList() const;
void energyAndGradient(const double* positions, const int* atomic_numbers, const double* box, std::size_t n_atoms, double* energy, double* gradient, nlist::NeighborList* neighbors = nullptr) const;
void energyAndGradientBatch(std::size_t n_config, const double* positions, const int* atomic_numbers, const double* box, std::size_t n_atoms, double* energies, double* gradients) const;
};
Detailed Documentation¶
Tersoff potential for silicon, carbon, and silicon-carbide.
Atomic numbers are 14 and 6. One call evaluates a whole configuration. energyAndGradientBatch evaluates many configurations that share a cell and a species list.
Methods¶
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.
void forceImpl(const ForceInput& in, ForceOut* out) const
Forces, energy and the Cauchy stress sigma = (1/V) dE/dε in eV/Angstrom^3, the convention of stress.hpp. The virial sums each folded bond vector times the energy gradient with respect to it.
void setHeldSkin(double skin)
Keep one Verlet list across forceImpl calls.
Parameters:
skin |
Extra search distance, Angstrom. Zero, the default, uses the internal list, with a skin of one fifth of the cutoff (none in Stream mode). A positive skin reuses the pairs until an atom has moved by more than skin/2 since the last build, or the cell or the atom count changes. The instance then reports perImageInstances. |
void setNeighbourMode(nlist::Mode mode)
Auto, Stored and Stream all use the shared neighbour layer. One thread agrees with the old ordered walk to within 1e-12.
const nlist::NeighborList& heldList() const
The list forceImpl keeps. Not built until a call with a positive skin.
void energyAndGradient(const double* positions, const int* atomic_numbers, const double* box, std::size_t n_atoms, double* energy, double* gradient, nlist::NeighborList* neighbors = nullptr) const
Energy and dE/dx for one configuration.
Parameters:
positions |
Row-major coordinates, Angstrom. |
atomic_numbers |
Length n_atoms. 14 is silicon, 6 is carbon. |
box |
Row-major cell, Angstrom. Periodic in every direction. |
n_atoms |
Atom count. |
energy |
Receives the energy, eV. |
gradient |
Receives dE/dx, eV/Angstrom. The force is its negation. |
neighbors |
Optional Verlet list. Null uses the internal list, with a skin of one fifth of the cutoff (none in Stream mode). A list is reused while each atom has moved by at most half its skin and the cell is unchanged. |
void energyAndGradientBatch(std::size_t n_config, const double* positions, const int* atomic_numbers, const double* box, std::size_t n_atoms, double* energies, double* gradients) const
Energy and dE/dx for configurations that share a cell.
Parameters:
n_config |
Number of configurations. |
positions |
n_config blocks of n_atoms * 3 coordinates. |
atomic_numbers |
Species shared by every configuration. |
box |
Cell shared by every configuration. |
n_atoms |
Atom count of each configuration. |
energies |
Length n_config. |
gradients |
Length n_config * n_atoms * 3. |