ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
Loading...
Searching...
No Matches
HarmonicBond Struct Reference

Parameters for harmonic bond Potential. More...

#include <harmonic.hpp>

Public Member Functions

double cutoff () const
 
 HarmonicBond (double k, double r, double r_cut)
 
std::optional< Utils::Vector3dforce (Utils::Vector3d const &dx) const
 Compute the harmonic bond force.
 
std::optional< double > energy (Utils::Vector3d const &dx) const
 Compute the harmonic bond energy.
 

Public Attributes

double k
 spring constant
 
double r
 equilibrium bond length
 
double r_cut
 cutoff length
 

Static Public Attributes

static constexpr int num = 1
 

Detailed Description

Parameters for harmonic bond Potential.

Definition at line 37 of file harmonic.hpp.

Constructor & Destructor Documentation

◆ HarmonicBond()

HarmonicBond::HarmonicBond ( double  k,
double  r,
double  r_cut 
)
inline

Definition at line 49 of file harmonic.hpp.

References k, r, and r_cut.

Member Function Documentation

◆ cutoff()

double HarmonicBond::cutoff ( ) const
inline

Definition at line 45 of file harmonic.hpp.

References r_cut.

◆ energy()

std::optional< double > HarmonicBond::energy ( Utils::Vector3d const &  dx) const
inline

Compute the harmonic bond energy.

Parameters
[in]dxDistance between the particles.

Definition at line 87 of file harmonic.hpp.

References k, Utils::Vector< T, N >::norm(), r, r_cut, and Utils::sqr().

◆ force()

std::optional< Utils::Vector3d > HarmonicBond::force ( Utils::Vector3d const &  dx) const
inline

Compute the harmonic bond force.

Parameters
[in]dxDistance between the particles.

Definition at line 63 of file harmonic.hpp.

References k, Utils::Vector< T, N >::norm(), r, r_cut, ROUND_ERROR_PREC, and runtimeErrorMsg.

Member Data Documentation

◆ k

double HarmonicBond::k

spring constant

Definition at line 39 of file harmonic.hpp.

Referenced by energy(), force(), and HarmonicBond().

◆ num

constexpr int HarmonicBond::num = 1
staticconstexpr

Definition at line 47 of file harmonic.hpp.

◆ r

double HarmonicBond::r

equilibrium bond length

Definition at line 41 of file harmonic.hpp.

Referenced by energy(), force(), and HarmonicBond().

◆ r_cut

double HarmonicBond::r_cut

cutoff length

Definition at line 43 of file harmonic.hpp.

Referenced by cutoff(), energy(), force(), and HarmonicBond().


The documentation for this struct was generated from the following file: