Line data Source code
1 : // Copyright (C) 2015 Technische Universitaet Muenchen
2 : // This file is part of the Mamico project. For conditions of distribution
3 : // and use, please see the copyright notice in Mamico's main folder, or at
4 : // www5.in.tum.de/mamico
5 : #ifndef _MOLECULARDYNAMICS_COUPLING_INTERFACE_MOLECULE_H_
6 : #define _MOLECULARDYNAMICS_COUPLING_INTERFACE_MOLECULE_H_
7 :
8 : #include "tarch/la/Vector.h"
9 :
10 : namespace coupling {
11 : namespace interface {
12 : template <unsigned int dim> class Molecule;
13 : }
14 : } // namespace coupling
15 :
16 : /** This class provides interface to access a single molecule in the MD
17 : *simulation. The MaMiCo molecule in datastructures also inherits from this
18 : *class.
19 : * @brief interface to access a single molecule in the MD simulation.
20 : * @tparam dim Number of dimensions; it can be 1, 2 or 3
21 : * @author Philipp Neumann
22 : */
23 0 : template <unsigned int dim> class coupling::interface::Molecule {
24 : public:
25 : /** Destructor */
26 8 : virtual ~Molecule() {}
27 :
28 : /** returnsthe velocity of the molecule */
29 : virtual tarch::la::Vector<dim, double> getVelocity() const = 0;
30 :
31 : /** sets the velocity of the molecule
32 : * @param velocity
33 : */
34 : virtual void setVelocity(const tarch::la::Vector<dim, double>& velocity) = 0;
35 :
36 : /** returns the position of the molecule */
37 : virtual tarch::la::Vector<dim, double> getPosition() const = 0;
38 :
39 : /** sets the position of the molecule
40 : * @param position
41 : */
42 : virtual void setPosition(const tarch::la::Vector<dim, double>& position) = 0;
43 :
44 : /** sets the force acting on this molecule. This function is only called in
45 : *the USHER scheme so far If you want to set the force of a newly created
46 : *molecule, you need to implement this function.
47 : * @param force
48 : */
49 : virtual void setForce(const tarch::la::Vector<dim, double>& force) = 0;
50 :
51 : /** returns the force acting on this molecule.
52 : * @sa setForce
53 : */
54 : virtual tarch::la::Vector<dim, double> getForce() const = 0;
55 :
56 : /** returns the potential energy of the molecule */
57 : virtual double getPotentialEnergy() const = 0;
58 :
59 : /** sets the potential energy of the molecule
60 : * @param potentialEnergy
61 : */
62 : virtual void setPotentialEnergy(const double& potentialEnergy) = 0;
63 : };
64 : #endif // _MOLECULARDYNAMICS_COUPLING_INTERFACE_MOLECULE_H_
|