Chemical Data Processing Library C++ API - Version 1.4.0
Public Member Functions | List of all members
CDPL::ForceField::ElasticPotential Class Reference

Stores parameters for an elastic potential (harmonic distance restraint) between a pair of atoms. More...

#include <ElasticPotential.hpp>

Public Member Functions

 ElasticPotential (std::size_t atom1_idx, std::size_t atom2_idx, double force_const, double ref_length)
 Constructs the elastic potential between atoms atom1_idx and atom2_idx with the specified force constant and reference length. More...
 
std::size_t getAtom1Index () const
 Returns the zero-based index of the first atom. More...
 
std::size_t getAtom2Index () const
 Returns the zero-based index of the second atom. More...
 
double getForceConstant () const
 Returns the force constant of the potential. More...
 
double getReferenceLength () const
 Returns the reference length of the potential. More...
 
void setReferenceLength (double length)
 Sets the reference length of the potential. More...
 

Detailed Description

Stores parameters for an elastic potential (harmonic distance restraint) between a pair of atoms.

See also
ForceField::calcElasticPotentialEnergy()
Since
1.1

Constructor & Destructor Documentation

◆ ElasticPotential()

CDPL::ForceField::ElasticPotential::ElasticPotential ( std::size_t  atom1_idx,
std::size_t  atom2_idx,
double  force_const,
double  ref_length 
)
inline

Constructs the elastic potential between atoms atom1_idx and atom2_idx with the specified force constant and reference length.

Parameters
atom1_idxThe zero-based index of the first restrained atom.
atom2_idxThe zero-based index of the second restrained atom.
force_constThe force constant k of the harmonic potential.
ref_lengthThe reference length \( r_0 \) of the harmonic potential.

Member Function Documentation

◆ getAtom1Index()

std::size_t CDPL::ForceField::ElasticPotential::getAtom1Index ( ) const
inline

Returns the zero-based index of the first atom.

Returns
The first atom index.

◆ getAtom2Index()

std::size_t CDPL::ForceField::ElasticPotential::getAtom2Index ( ) const
inline

Returns the zero-based index of the second atom.

Returns
The second atom index.

◆ getForceConstant()

double CDPL::ForceField::ElasticPotential::getForceConstant ( ) const
inline

Returns the force constant of the potential.

Returns
The force constant k.

◆ getReferenceLength()

double CDPL::ForceField::ElasticPotential::getReferenceLength ( ) const
inline

Returns the reference length of the potential.

Returns
The reference length \( r_0 \).

◆ setReferenceLength()

void CDPL::ForceField::ElasticPotential::setReferenceLength ( double  length)
inline

Sets the reference length of the potential.

Parameters
lengthThe new reference length \( r_0 \).

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