Molecular Dynamics  v0.4
Project for the Practical hosted by the Scientific Computing Chair
Gravity.h
Go to the documentation of this file.
1 //
2 // Created by daniel on 24.04.24.
3 //
4 
5 #pragma once
6 
8 
9 #include "utils/ArrayUtils.h"
10 
11 
17 class Gravity : public Force {
18 public:
28  std::array<double, 3> compute(Particle &target, Particle &source) override;
29 
35  std::array<double, 3> computeOptimized(Particle &target, Particle &source, std::array<double, 3>& difference, double distance) override;
36 };
Interface representing the force that the source exerts on the target.
Definition: Force.h:14
Implementation of the gravitational force.
Definition: Gravity.h:17
std::array< double, 3 > compute(Particle &target, Particle &source) override
Actual computation of the gravitational force occurring.
Definition: Gravity.cpp:6
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...
Definition: Gravity.cpp:11
Definition: Particle.h:16