Molecular Dynamics  v0.4
Project for the Practical hosted by the Scientific Computing Chair
Public Member Functions | Private Attributes | List of all members
HarmonicForce Class Reference

#include <HarmonicForce.h>

Inheritance diagram for HarmonicForce:
Inheritance graph
Collaboration diagram for HarmonicForce:
Collaboration graph

Public Member Functions

 HarmonicForce (double k, double r0)
 Initialise the harmonic force. This force acts between neighbors in a membrane. More...
 
std::array< double, 3 > compute (Particle &target, Particle &source) override
 Actual computation of the harmonic force occurring. More...
 
std::array< double, 3 > computeOptimized (Particle &target, Particle &source, std::array< double, 3 > &difference, double distance) override
 We needed this to integrate our optimization in our code to prevent breaking the inheritance hierachy. Will be removed, when we integrated the optimization properly. More...
 
- Public Member Functions inherited from Force
virtual ~Force ()=default
 

Private Attributes

double k
 
double r0
 

Constructor & Destructor Documentation

◆ HarmonicForce()

HarmonicForce::HarmonicForce ( double  k,
double  r0 
)

Initialise the harmonic force. This force acts between neighbors in a membrane.

Parameters
kStiffness constant.
r0Average bond length.

Member Function Documentation

◆ compute()

std::array< double, 3 > HarmonicForce::compute ( Particle target,
Particle source 
)
overridevirtual

Actual computation of the harmonic force occurring.

Parameters
targetParticle on which the harmonic force acts.
sourceParticle which exerts the harmonic force on the target.
Returns
3 dimensional force vector.

Computation of the harmonic force which exerts the source on the target.

Implements Force.

Here is the call graph for this function:

◆ computeOptimized()

std::array< double, 3 > HarmonicForce::computeOptimized ( Particle target,
Particle source,
std::array< double, 3 > &  difference,
double  distance 
)
overridevirtual

We needed this to integrate our optimization in our code to prevent breaking the inheritance hierachy. Will be removed, when we integrated the optimization properly.

Implements Force.

Member Data Documentation

◆ k

double HarmonicForce::k
private

◆ r0

double HarmonicForce::r0
private

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