indigoX
dihedral.hpp
Go to the documentation of this file.
1 
2 #include "../utils/fwd_declares.hpp"
3 #include "../utils/quad.hpp"
4 
5 #include <array>
6 #include <cstdint>
7 #include <memory>
8 #include <string>
9 
10 #ifndef INDIGOX_CLASSES_DIHEDRAL_HPP
11 #define INDIGOX_CLASSES_DIHEDRAL_HPP
12 
13 namespace indigox {
14  class Dihedral {
16  friend class indigox::Molecule;
18  friend class cereal::access;
19 
20  public:
23  using DihedralAtoms = std::array<Atom, 4>;
25  using DihedralTypes = std::vector<FFDihedral>;
26 
27  private:
28  template <typename Archive>
29  void serialise(Archive &archive, const uint32_t version);
30 
31  public:
34 
35  private:
41  Dihedral(const Atom &a, const Atom &b, const Atom &c, const Atom &d,
42  const Molecule &m);
43 
44  public:
49  int64_t GetTag() const;
50  int64_t GetID() const;
51 
56  const Molecule &GetMolecule() const;
57 
60  const DihedralAtoms &GetAtoms() const;
61 
64  constexpr int64_t NumAtoms() const { return 4; }
65 
70  void SetTag(int64_t tag);
71 
77  int64_t GetIndex() const;
78 
81  int64_t NumTypes() const;
82  const DihedralTypes &GetTypes() const;
83  bool HasType() const;
84  void SetTypes(const DihedralTypes &types);
87  void AddType(const FFDihedral &type);
88  void RemoveType(const FFDihedral &type);
89  int32_t GetPriority() const;
90 
91  private:
92  void Reset();
93 
94  private:
95  struct Impl;
96  std::shared_ptr<Impl> m_data;
97  };
98 
99  std::ostream &operator<<(std::ostream &os, const Dihedral &dhd);
100 } // namespace indigox
101 
102 #endif /* INDIGOX_CLASSES_DIHEDRAL_HPP */
#define INDIGOX_GENERIC_PIMPL_CLASS_DEFAULTS(class_name)
Definition: fwd_declares.hpp:18
Definition: atom.hpp:13
friend class cereal::access
Friendship allows serialisation.
Definition: dihedral.hpp:18
Definition: forcefield.hpp:234
Namespace for all graph related functionality.
Definition: access.hpp:7
int64_t GetIndex() const
Get the index from the molecule.
const DihedralTypes & GetTypes() const
const DihedralAtoms & GetAtoms() const
Get the atoms of the dihedral.
std::vector< FFDihedral > DihedralTypes
Type for storing dihedral parameters.
Definition: dihedral.hpp:25
void SetTypes(const DihedralTypes &types)
bool HasType() const
void SetTag(int64_t tag)
Set the tag of this dihedral.
Definition: dihedral.hpp:14
Definition: molecule.hpp:15
int64_t NumTypes() const
Get the type of the dihedral.
#define INDIGOX_GENERIC_PIMPL_CLASS_OPERATORS(class_name, short_name)
Definition: fwd_declares.hpp:26
int64_t GetTag() const
Tag of the dihedral.
Dihedral()=default
void AddType(const FFDihedral &type)
Set the type of the dihedral.
std::ostream & operator<<(std::ostream &os, const Dihedral &dhd)
int32_t GetPriority() const
const Molecule & GetMolecule() const
Molecule this dihedral is associated with.
void RemoveType(const FFDihedral &type)
constexpr int64_t NumAtoms() const
Number of atoms this dihedral contains.
Definition: dihedral.hpp:64
int64_t GetID() const
std::array< Atom, 4 > DihedralAtoms
Container for storing IXAtom references assigned to an IXDihedral.
Definition: dihedral.hpp:23