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

Implementation of the gravitational force. More...

#include <Gravity.h>

Inheritance diagram for Gravity:
Inheritance graph
Collaboration diagram for Gravity:
Collaboration graph

Public Member Functions

std::array< double, 3 > compute (Particle &target, Particle &source) override
 Actual computation of the gravitational 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
 

Detailed Description

Implementation of the gravitational force.

The gravitational force is one example of a force which might act between two particles in space.

Member Function Documentation

◆ compute()

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

Actual computation of the gravitational force occurring.

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

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

Implements Force.

Here is the call graph for this function:

◆ computeOptimized()

std::array< double, 3 > Gravity::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.


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