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

Interface for simple force source classes. More...

#include <SimpleForceSource.h>

Inheritance diagram for SimpleForceSource:
Inheritance graph
Collaboration diagram for SimpleForceSource:
Collaboration graph

Public Member Functions

virtual ~SimpleForceSource ()=default
 Virtual destructor for correct cleanup of derived classes. More...
 
virtual std::array< double, 3UL > calculateForce (Particle &p) 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 simple force source classes.

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

A ForceSource specifies the force exerted on a single particle p.

Definition at line 16 of file SimpleForceSource.h.

Constructor & Destructor Documentation

◆ ~SimpleForceSource()

virtual SimpleForceSource::~SimpleForceSource ( )
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> SimpleForceSource::calculateForce ( Particle p) const
pure virtual

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

Parameters
pParticle whose force is to be updated
Returns
Force exerted on p

Calculates the force exerted on a particle p.

Implemented in HarmonicForce, and GlobalDownwardsGravity.

◆ operator std::string()

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

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

Implemented in HarmonicForce, and GlobalDownwardsGravity.


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