1 #ifndef OPENMPCD_PAIRPOTENTIALS_ADDITIVEPAIR_HPP
2 #define OPENMPCD_PAIRPOTENTIALS_ADDITIVEPAIR_HPP
4 #include <OpenMPCD/PairPotentials/Base.hpp>
11 namespace PairPotentials
17 template<
typename T = FP>
38 : potential1(potential1), potential2(potential2)
41 if(potential1 == NULL || potential2 == NULL)
57 return potential1->force(R) + potential2->force(R);
68 return potential1->potential(R) + potential2->potential(R);
72 const Base<T>*
const potential1;
73 const Base<T>*
const potential2;
78 #endif //OPENMPCD_PAIRPOTENTIALS_ADDITIVEPAIR_HPP
#define OPENMPCD_THROW(ExceptionType, message)
Throws the given ExceptionType, passing the given message along with file and line number information...
OPENMPCD_CUDA_HOST_AND_DEVICE Vector3D< T > force(const Vector3D< T > &R) const
Returns the force vector of the interaction for a given position vector.
#define OPENMPCD_CUDA_HOST_AND_DEVICE
Denotes a function to be callable both from the Host and from a CUDA Device.
OPENMPCD_CUDA_HOST_AND_DEVICE AdditivePair(const Base< T > *const potential1, const Base< T > *const potential2)
The constructor.
OPENMPCD_CUDA_HOST_AND_DEVICE T potential(const Vector3D< T > &R) const
Returns the potential of the interaction for a given position vector.
Abstract base class for pair potentials.
Represents a potential that consists of the sum of two other potentials.