Molecular Dynamics Simulation  1.0
PairwiseForceSource.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <iostream>
4 
5 #include "particles/Particle.h"
6 
17  public:
23  virtual ~PairwiseForceSource() = default;
24 
34  virtual std::array<double, 3UL> calculateForce(const Particle& p, const Particle& q) const = 0;
35 
39  virtual explicit operator std::string() const = 0;
40 };
41 
42 // overload the << operator for the PairwiseForceSource class to allow easier printing
43 inline std::ostream& operator<<(std::ostream& os, const PairwiseForceSource& PairwiseForceSource) {
44  os << static_cast<std::string>(PairwiseForceSource);
45  return os;
46 }
std::ostream & operator<<(std::ostream &os, const PairwiseForceSource &PairwiseForceSource)
Interface for pairwise force source classes.
virtual ~PairwiseForceSource()=default
Virtual destructor for correct cleanup of derived classes.
virtual std::array< double, 3UL > calculateForce(const Particle &p, const Particle &q) const =0
Calculates the force a particle q exerts on another particle p.
Class to represent a particle.
Definition: Particle.h:26