Molecular Dynamics Simulation  1.0
Public Member Functions | List of all members
PairwiseForceSource Class Referenceabstract

Interface for pairwise force source classes. More...

#include <PairwiseForceSource.h>

Inheritance diagram for PairwiseForceSource:
Inheritance graph
Collaboration diagram for PairwiseForceSource:
Collaboration graph

Public Member Functions

virtual ~PairwiseForceSource ()=default
 Virtual destructor for correct cleanup of derived classes. More...
 
virtual std::array< double, 3UL > calculateForce (const Particle &p, const Particle &q) const =0
 Calculates the force a particle q exerts on another particle p. More...
 
virtual operator std::string () const =0
 Conversion from a force source object to a string containing its name. More...
 

Detailed Description

Interface for pairwise force source classes.

Definition of an interface for force source classes. This is used to ensure inheriting classes implement the method calculateForce(Particle& p, Particle& q) according to our definition.

A PairwiseForceSource specifies the force a particle q exerts on another particle p.

Definition at line 16 of file PairwiseForceSource.h.

Constructor & Destructor Documentation

◆ ~PairwiseForceSource()

virtual PairwiseForceSource::~PairwiseForceSource ( )
virtualdefault

Virtual destructor for correct cleanup of derived classes.

Virtual destructor to ensure correct deletion of inheriting classes.

Member Function Documentation

◆ calculateForce()

virtual std::array<double, 3UL> PairwiseForceSource::calculateForce ( const Particle p,
const Particle q 
) const
pure virtual

Calculates the force a particle q exerts on another particle p.

Parameters
pParticle whose force is to be updated
qParticle which exerts the force on p
Returns
Force exerted by q on p

Calculates the force a particle q exerts on another particle p.

Implemented in SmoothedLennardJonesForce, LennardJonesRepulsiveForce, LennardJonesForce, and GravitationalForce.

◆ operator std::string()

virtual PairwiseForceSource::operator std::string ( ) const
explicitpure virtual

Conversion from a force source object to a string containing its name.

Implemented in SmoothedLennardJonesForce, LennardJonesRepulsiveForce, LennardJonesForce, and GravitationalForce.


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