Molecular Dynamics  v0.4
Project for the Practical hosted by the Scientific Computing Chair
Force.h
Go to the documentation of this file.
1 //
2 // Created by daniel on 24.04.24.
3 //
4 
5 #pragma once
7 
14 class Force {
15 public:
25  virtual std::array<double, 3> compute(Particle &target, Particle &source) = 0;
26 
27  virtual ~Force() = default;
28 
34  virtual std::array<double, 3> computeOptimized(Particle &target, Particle &source, std::array<double, 3>& difference, double distance) = 0;
35 };
Interface representing the force that the source exerts on the target.
Definition: Force.h:14
virtual std::array< double, 3 > compute(Particle &target, Particle &source)=0
Actual computation of the force occurring.
virtual std::array< double, 3 > computeOptimized(Particle &target, Particle &source, std::array< double, 3 > &difference, double distance)=0
We needed this to integrate our optimization in our code to prevent breaking the inheritance hierachy...
virtual ~Force()=default
Definition: Particle.h:16