Scine::Swoose  2.1.0
This is the SCINE module Swoose.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Pages
BondedTerm.h
Go to the documentation of this file.
1 
8 #ifndef MOLECULARMECHANICS_BONDEDTERM_H
9 #define MOLECULARMECHANICS_BONDEDTERM_H
10 
11 #include "../Topology/BondType.h"
12 #include "Bond.h"
13 #include "InteractionTermBase.h"
14 #include <Utils/Typenames.h>
15 #include <string>
16 
17 namespace Scine {
18 
19 namespace Utils {
20 class AtomicSecondDerivativeCollection;
21 } // namespace Utils
22 
23 namespace MolecularMechanics {
29  public:
30  using AtomIndex = int;
32  BondedTerm(AtomIndex firstAtom, AtomIndex secondAtom, const Bond& bond, const BondType& typeOfBond);
34  ~BondedTerm();
35 
39  double evaluateBondTerm(const Utils::PositionCollection& positions, Utils::AtomicSecondDerivativeCollection& derivatives) const;
40 
44  BondType getTypeOfBond() const;
45 
49  int getFirstAtom() const;
50 
54  int getSecondAtom() const;
55 
56  private:
57  AtomIndex firstAtom_, secondAtom_;
58  Bond bond_;
59  BondType typeOfBond_;
60 };
61 
62 } // namespace MolecularMechanics
63 } // namespace Scine
64 
65 #endif // MOLECULARMECHANICS_BONDEDTERM_H
Describes a bond uniquely for given atom types. (useful for maps/unordered_maps)
Definition: BondType.h:25
BondedTerm(AtomIndex firstAtom, AtomIndex secondAtom, const Bond &bond, const BondType &typeOfBond)
Constructor from two atom indices and instances of Bond and BondType classes.
Definition: BondedTerm.cpp:16
int getFirstAtom() const
Getter for first atom.
Definition: BondedTerm.cpp:42
Class treating a bonded interaction, based solely on the bond length. (i.e. in 1 dimension) ...
Definition: Bond.h:19
double evaluateBondTerm(const Utils::PositionCollection &positions, Utils::AtomicSecondDerivativeCollection &derivatives) const
Evaluates energy contribution and adds the derivatives.
Definition: BondedTerm.cpp:22
Base class for all interaction terms.
Definition: InteractionTermBase.h:18
BondType getTypeOfBond() const
Getter for the bond type.
Definition: BondedTerm.cpp:38
int getSecondAtom() const
Getter for second atom.
Definition: BondedTerm.cpp:46
Class evaluating harmonic bonded interaction between two atoms.
Definition: BondedTerm.h:28