OpenMPCD
Null.hpp
Go to the documentation of this file.
1 /**
2  * @file
3  * Defines the `OpenMPCD::PairPotentials::Null` class.
4  */
5 
6 #ifndef OPENMPCD_PAIRPOTENTIALS_NULL_HPP
7 #define OPENMPCD_PAIRPOTENTIALS_NULL_HPP
8 
9 #include <OpenMPCD/PairPotentials/Base.hpp>
10 
11 namespace OpenMPCD
12 {
13 namespace PairPotentials
14 {
15 
16 /**
17  * Dummy interaction that represents a potential that is `0` everywhere, and
18  * hence does not give rise to a force.
19  */
20 template<typename T = FP>
21 class Null : public Base<T>
22 {
23 public:
24  /**
25  * The constructor.
26  */
28  Null()
29  {
30  }
31 
33  Vector3D<T> force(const Vector3D<T>&) const
34  {
35  return Vector3D<T>(0, 0, 0);
36  }
37 
39  T potential(const Vector3D<T>&) const
40  {
41  return 0;
42  }
43 }; //class Null
44 
45 } //namespace PairPotentials
46 } //namespace OpenMPCD
47 #endif //OPENMPCD_PAIRPOTENTIALS_NULL_HPP
OpenMPCD::Vector3D
3-dimensional vector.
Definition: Vector3D.hpp:38
OPENMPCD_CUDA_HOST_AND_DEVICE
#define OPENMPCD_CUDA_HOST_AND_DEVICE
Denotes a function to be callable both from the Host and from a CUDA Device.
Definition: Macros.hpp:15
OpenMPCD::PairPotentials::Null::Null
OPENMPCD_CUDA_HOST_AND_DEVICE Null()
The constructor.
Definition: Null.hpp:28
OpenMPCD::PairPotentials::Null
Dummy interaction that represents a potential that is 0 everywhere, and hence does not give rise to a...
Definition: Null.hpp:21
OpenMPCD::PairPotentials::Base
Abstract base class for pair potentials.
Definition: PairPotentials/Base.hpp:24