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_SIMPLEMDMOLECULE_H_
6 : #define _MOLECULARDYNAMICS_COUPLING_INTERFACE_SIMPLEMDMOLECULE_H_
7 :
8 : #include "coupling/interface/Molecule.h"
9 : #include "simplemd/MolecularDynamicsDefinitions.h"
10 : #include "simplemd/Molecule.h"
11 :
12 : namespace coupling {
13 : namespace interface {
14 : class SimpleMDMolecule;
15 : }
16 : } // namespace coupling
17 :
18 : /** interface to access molecule of SimpleMD.
19 : * @author Philipp Neumann
20 : */
21 : class coupling::interface::SimpleMDMolecule : public coupling::interface::Molecule<MD_DIM> {
22 : public:
23 20 : SimpleMDMolecule(simplemd::Molecule* myMolecule) : _myMolecule(myMolecule) {}
24 8 : virtual ~SimpleMDMolecule() {}
25 :
26 0 : void setMolecule(simplemd::Molecule* newMolecule) { _myMolecule = newMolecule; }
27 :
28 : /** returns/ sets the velocity of the molecule */
29 0 : virtual tarch::la::Vector<MD_DIM, double> getVelocity() const { return _myMolecule->getConstVelocity(); }
30 10628820 : virtual void setVelocity(const tarch::la::Vector<MD_DIM, double>& velocity) { _myMolecule->setVelocity(velocity); }
31 :
32 : /** returns/ sets the position of the molecule */
33 0 : virtual tarch::la::Vector<MD_DIM, double> getPosition() const { return _myMolecule->getConstPosition(); }
34 :
35 0 : virtual void setPosition(const tarch::la::Vector<MD_DIM, double>& position) { _myMolecule->setPosition(position); }
36 :
37 : /** sets the force acting on this molecule. This function is only called in the USHER
38 : * scheme so far If you want to set the force of a newly created molecule,
39 : * you need to implement this function.
40 : */
41 10628820 : virtual void setForce(const tarch::la::Vector<MD_DIM, double>& force) { _myMolecule->setForce(force); }
42 0 : virtual tarch::la::Vector<MD_DIM, double> getForce() const { return _myMolecule->getConstForce(); }
43 :
44 : /** returns/ sets the potential energy of the molecule */
45 0 : virtual double getPotentialEnergy() const { return _myMolecule->getPotentialEnergy(); }
46 0 : virtual void setPotentialEnergy(const double& potentialEnergy) { _myMolecule->setPotentialEnergy(potentialEnergy); }
47 :
48 : private:
49 : simplemd::Molecule* _myMolecule;
50 : };
51 : #endif // _MOLECULARDYNAMICS_COUPLING_INTERFACE_SIMPLEMDMOLECULE_H_
|