faunus
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Faunus::pairpotential::FunctorPotential Class Reference

Arbitrary potentials for specific atom types. More...

#include <potentials.h>

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

Public Member Functions

 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...
 

Protected Member Functions

void from_json (const json &j) override
 
- Protected Member Functions inherited from Faunus::pairpotential::PairPotential
 PairPotential (std::string name=std::string(), std::string cite=std::string(), bool isotropic=true)
 

Protected Attributes

PairMatrix< EnergyFunctor, true > umatrix
 

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)
 

Detailed Description

Arbitrary potentials for specific atom types.

This maintains a species x species matrix with function pointers (std::function) that wraps pair potentials. Flexibility over performance.

Todo:
to_json should retrieve info from potentials instead of merely passing input
Warning
Each atom pair will be assigned an instance of a pair-potential. This could be problematic if these have large memory requirements.

Member Function Documentation

◆ operator()()

double Faunus::pairpotential::FunctorPotential::operator() ( const Particle particle_a,
const Particle particle_b,
const double  squared_distance,
const Point b_towards_a = {0, 0, 0} 
) const
inlineoverridevirtual

Pair energy between two particles.

Parameters
particle_aFirst particle
particle_bSecond particle
squared_distanceSquared distance, |𝐚-𝐛|²
b_towards_aDistance vector 𝐛 -> 𝐚 = 𝐚 - 𝐛
Returns
Interaction energy in units of kT

Implements Faunus::pairpotential::PairPotential.


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