faunus
Classes | Public Member Functions | List of all members
Faunus::pairpotential::SplinedPotential Class Reference

Splined pair potentials. More...

#include <potentials.h>

Inheritance diagram for Faunus::pairpotential::SplinedPotential:
Inheritance graph
[legend]
Collaboration diagram for Faunus::pairpotential::SplinedPotential:
Collaboration graph
[legend]

Public Member Functions

 SplinedPotential (const std::string &name="splined")
 
double operator() (const Particle &particle_a, const Particle &particle_b, double squared_distance, [[maybe_unused]] const Point &b_towards_a) const override
 Policies: More...
 
- Public Member Functions inherited from Faunus::pairpotential::FunctorPotential
 FunctorPotential (const std::string &name="functor potential")
 
void to_json (json &j) const override
 
double operator() (const Particle &particle_a, const Particle &particle_b, const double squared_distance, const Point &b_towards_a={0, 0, 0}) const override
 Pair energy between two particles. More...
 
- Public Member Functions inherited from Faunus::pairpotential::PairPotential
virtual Point force (const Particle &a, const Particle &b, double squared_distance, const Point &b_towards_a) const
 Force on particle a due to particle b. More...
 

Additional Inherited Members

- Public Attributes inherited from Faunus::pairpotential::PairPotential
std::string name
 unique name per polymorphic call; used in FunctorPotential::combinePairPotentials
 
std::string cite
 Typically a short-doi litterature reference.
 
bool isotropic = true
 true if pair-potential is independent of particle orientation
 
std::function< double(const Particle &)> selfEnergy = nullptr
 self energy of particle (kT)
 
- Protected Member Functions inherited from Faunus::pairpotential::PairPotential
 PairPotential (std::string name=std::string(), std::string cite=std::string(), bool isotropic=true)
 
- Protected Attributes inherited from Faunus::pairpotential::FunctorPotential
PairMatrix< EnergyFunctor, true > umatrix
 

Detailed Description

Splined pair potentials.

This maintains a species x species matrix as in FunctorPotential but with splined pair potentials. This avoids the functor lookup and renders all potentials roughly the same speed.

The spline range is automatically detected based on user-defined energy thresholds. If below the range, the default behavior is to return the EXACT energy, while if above ZERO is returned.

Todo:
Add force

Member Function Documentation

◆ operator()()

double Faunus::pairpotential::SplinedPotential::operator() ( const Particle particle_a,
const Particle particle_b,
double  squared_distance,
[[maybe_unused] ] const Point b_towards_a 
) const
inlineoverride

Policies:

  1. return splined potential if rmin>r<rmax
  2. return zero if r>=rmax
  3. return infinity if r<=rmin AND hardsphere_repulsion has been set to true
  4. return exact energy if r<=rmin

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