|
faunus
|
Cosine attraction. More...
#include <potentials.h>


Public Member Functions | |
| CosAttract (const std::string &name="cos2") | |
| double | cutOffSquared () const |
| Squared cutoff distance where potential goes to zero. | |
| double | operator() (const Particle &, const Particle &, double squared_distance, const Point &) const override |
| Point | force (const Particle &, const Particle &, double squared_distance, const Point &b_towards_a) const override |
| Force on particle a due to particle b. More... | |
| void | to_json (json &j) const override |
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) | |
Cosine attraction.
This is an attractive potential used for coarse grained lipids and has the form:
\[ \beta u(r) = -\epsilon \cos^2 [ \pi(r-r_c)/2w_c ] \]
for \(r_c\leq r \leq r_c+w_c\). For \(r<r_c\), \(\beta u=-\epsilon\), while zero for \(r>r_c+w_c\).
JSON keywords:
| Key | Description |
|---|---|
eps | Depth, \(\epsilon\) [kJ/mol] |
rc | Width, r_c [angstrom] |
wc | Decay range, w_c [angstrom] |
|
inlineoverridevirtual |
Force on particle a due to particle b.
Calculates force on particle a due to another particle, b.
| particle_a | First particle |
| particle_b | Second particle |
| squared_distance | Squared distance, |𝐚-𝐛|² |
| b_towards_a | Distance vector 𝐛 -> 𝐚 = 𝐚 - 𝐛 |
| particle_a | Particle a |
| particle_b | Particle b |
| squared_distance | Squared norm |𝐚-𝐛|² |
| b_towards_a | Distance vector 𝐛 -> 𝐚 = 𝐚 - 𝐛 |
Reimplemented from Faunus::pairpotential::PairPotential.
|
inlineoverridevirtual |
x(c,r2,rc) defined herein could be approximated by a series expansion for r2=rcwc2.In this way one can avoid cos() and sqrt(). C code for this could be generated in Matlab:
Implements Faunus::pairpotential::PairPotential.
1.8.13