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

Custom pair-potential taking math. More...

#include <potentials.h>

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

Public Member Functions

double operator() (const Particle &particle1, const Particle &particle2, double squared_distance, [[maybe_unused]] const Point &b_towards_a) const override
 
Point force (const Particle &particle_a, const Particle &particle_b, double squared_distance, const Point &b_towards_b) const override
 Force on particle a due to particle b. More...
 
 CustomPairPotential (const std::string &name="custom")
 
void to_json (json &j) const override
 
- Public Member Functions inherited from Faunus::pairpotential::PairPotential
virtual double operator() (const Particle &particle_a, const Particle &particle_b, double squared_distance, const Point &b_towards_a) const =0
 Pair energy between two particles. 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)
 

Detailed Description

Custom pair-potential taking math.

expressions at runtime

Note
symbols is a shared_ptr as this allows it to be modified by operator() const. A hack, but would otherwise require const-removal in all pair-potentials.

Member Function Documentation

◆ force()

Point Faunus::pairpotential::CustomPairPotential::force ( const Particle a,
const Particle b,
double  squared_distance,
const Point b_towards_a 
) const
inlineoverridevirtual

Force on particle a due to particle b.

Calculates force on particle a due to another particle, b.

Parameters
particle_aFirst particle
particle_bSecond particle
squared_distanceSquared distance, |𝐚-𝐛|²
b_towards_aDistance vector 𝐛 -> 𝐚 = 𝐚 - 𝐛
Returns
Force acting on a dur to b in units of kT/Å
Parameters
particle_aParticle a
particle_bParticle b
squared_distanceSquared norm |𝐚-𝐛|²
b_towards_aDistance vector 𝐛 -> 𝐚 = 𝐚 - 𝐛
Returns
Force on particle a due to particle b

Reimplemented from Faunus::pairpotential::PairPotential.


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