Molecular Dynamics Simulation
1.0
src
physics
pairwiseforces
PairwiseForceSource.h
Go to the documentation of this file.
1
#pragma once
2
3
#include <iostream>
4
5
#include "
particles/Particle.h
"
6
16
class
PairwiseForceSource
{
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
}
operator<<
std::ostream & operator<<(std::ostream &os, const PairwiseForceSource &PairwiseForceSource)
Definition:
PairwiseForceSource.h:43
Particle.h
PairwiseForceSource
Interface for pairwise force source classes.
Definition:
PairwiseForceSource.h:16
PairwiseForceSource::~PairwiseForceSource
virtual ~PairwiseForceSource()=default
Virtual destructor for correct cleanup of derived classes.
PairwiseForceSource::calculateForce
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.
Particle
Class to represent a particle.
Definition:
Particle.h:26
Generated by
1.9.1