indigoX
parameterised.hpp
Go to the documentation of this file.
1 #include "../utils/fwd_declares.hpp"
2 #include "../utils/numerics.hpp"
3 #include "../utils/quad.hpp"
4 #include "../utils/triple.hpp"
5 
6 #include <EASTL/vector_map.h>
7 #include <array>
8 #include <vector>
9 
10 #ifndef INDIGOX_CLASSES_PARAMETERISED_HPP
11 #define INDIGOX_CLASSES_PARAMETERISED_HPP
12 
13 namespace indigox {
14 
15  class ParamAtom {
16  public:
18  using TypeCounts = eastl::vector_map<FFAtom, size_t>;
20  using MappedCharge = std::vector<double>;
21  friend class ParamMolecule;
22 
23  public:
26 
27  public:
30  ParamAtom(const Atom &atm);
31 
32  public:
35  void MappedWith(const Atom &mapped);
36 
47  bool ApplyParameterisation(bool self_consistent);
48 
49  public:
52  int64_t NumSourceAtoms() const;
53 
56  const Atom &GetAtom() const;
57 
60  double MeanCharge() const;
61 
64  double MeadianCharge();
65 
68  double StandardDeviationCharge() const;
69 
72  const FFAtom &GetMostCommonType() const;
73 
74  const TypeCounts &GetMappedTypeCounts() const;
75  const MappedCharge &GetMappedCharges() const;
76 
77  private:
78  struct ParamAtomImpl;
79  std::shared_ptr<ParamAtomImpl> m_data;
80  };
81 
82  class ParamBond {
83  public:
85  using TypeCounts = eastl::vector_map<FFBond, size_t>;
87  using BondAtoms = std::pair<Atom, Atom>;
88  friend class ParamMolecule;
89 
90  public:
93 
94  public:
97  ParamBond(BondAtoms atms, const Bond &bnd);
98 
99  public:
102  void MappedWith(const Bond &mapped);
103 
113  bool ApplyParameterisation(bool self_consistent);
114 
115  public:
118  int64_t NumSourceBonds() const;
119 
122  const BondAtoms &GetAtoms() const;
123 
126  const Bond &GetBond() const;
127 
130  const FFBond &GetMostCommonType() const;
131 
132  const TypeCounts &GetMappedTypeCounts() const;
133 
134  private:
135  struct ParamBondImpl;
136  std::shared_ptr<ParamBondImpl> m_data;
137  };
138 
139  class ParamAngle {
140  public:
142  using TypeCounts = eastl::vector_map<FFAngle, size_t>;
145  friend class ParamMolecule;
146 
147  public:
150 
151  public:
154  ParamAngle(AngleAtoms atms, const Angle &ang);
155 
156  public:
159  void MappedWith(const Angle &mapped);
160 
170  bool ApplyParameterisation(bool self_consistent);
171 
172  public:
175  int64_t NumSourceAngles() const;
176 
179  const AngleAtoms &GetAtoms() const;
180 
183  const Angle &GetAngle() const;
184 
187  const FFAngle &GetMostCommonType() const;
188 
189  const TypeCounts &GetMappedTypeCounts() const;
190 
191  private:
192  struct ParamAngleImpl;
193  std::shared_ptr<ParamAngleImpl> m_data;
194  };
195 
197  public:
199  using TypeGroup = std::vector<FFDihedral>;
200  using TypeCounts = eastl::vector_map<TypeGroup, size_t>;
203 
204  friend class ParamMolecule;
205 
206  public:
209 
210  public:
213  ParamDihedral(DihedralAtoms atms, const Dihedral &dhd);
214 
215  public:
218  void MappedWith(const Dihedral &mapped);
219 
229  bool ApplyParameterisation(bool self_consistent);
230 
231  public:
234  int64_t NumSourceDihedral() const;
235 
238  const DihedralAtoms &GetAtoms() const;
239 
242  const Dihedral &GetDihedral() const;
243 
246  const TypeGroup &GetMostCommonType() const;
247 
248  const TypeCounts &GetMappedTypeCounts() const;
249 
250  private:
251  struct ParamDihedralImpl;
252  std::shared_ptr<ParamDihedralImpl> m_data;
253  };
254 
256  public:
258  using ParamAtoms = eastl::vector_map<Atom, uint32_t>;
260  using PBond = std::pair<Atom, Atom>;
262  using ParamBonds = eastl::vector_map<PBond, uint32_t>;
266  using ParamAngles = eastl::vector_map<PAngle, uint32_t>;
270  using ParamDihedrals = eastl::vector_map<PDihedral, uint32_t>;
271 
272  public:
275 
278  ParamMolecule(const Molecule &mol);
279 
280  public:
285  void ApplyParameteristion(bool self_consistent);
286 
287  public:
291  const ParamAtom &GetAtom(const Atom &atm) const;
292 
296  const ParamBond &GetBond(const Bond &bnd) const;
297 
301  const ParamBond &GetBond(const Atom &a, const Atom &b) const;
302 
306  const ParamAngle &GetAngle(const Angle &ang) const;
307 
311  const ParamAngle &GetAngle(const Atom &a, const Atom &b,
312  const Atom &c) const;
313 
317  const ParamDihedral &GetDihedral(const Dihedral &dhd);
318 
326  const ParamDihedral &GetDihedral(const Atom &a, const Atom &b,
327  const Atom &c, const Atom &d);
328 
329  const std::vector<ParamAtom> &GetAtoms() const;
330  const std::vector<ParamBond> &GetBonds() const;
331  const std::vector<ParamAngle> &GetAngles() const;
332  const std::vector<ParamDihedral> &GetDihedrals() const;
333 
334  private:
335  struct ParamMoleculeImpl;
336  std::shared_ptr<ParamMoleculeImpl> m_data;
337  };
338 
339 } // namespace indigox
340 
341 #endif /* INDIGOX_CLASSES_PARAMETERISED_HPP */
Definition: forcefield.hpp:18
Definition: forcefield.hpp:58
double MeanCharge() const
Get the mean of the charges.
const ParamAngle & GetAngle(const Angle &ang) const
Get the parameterisation of an angle.
#define INDIGOX_GENERIC_PIMPL_CLASS_DEFAULTS(class_name)
Definition: fwd_declares.hpp:18
void ApplyParameteristion(bool self_consistent)
Applies the current parameterisation state.
const std::vector< ParamAtom > & GetAtoms() const
Definition: bond.hpp:11
eastl::vector_map< Atom, uint32_t > ParamAtoms
Container type to hold parameterised atoms.
Definition: parameterised.hpp:258
const BondAtoms & GetAtoms() const
Get the atoms this parameterises the bond between.
eastl::vector_map< FFAngle, size_t > TypeCounts
Type giving counts of each mapped angle type.
Definition: parameterised.hpp:142
bool ApplyParameterisation(bool self_consistent)
Apply the parameterisation.
Definition: atom.hpp:13
void MappedWith(const Angle &mapped)
Obtain details from mapped angles.
const DihedralAtoms & GetAtoms() const
Get the atoms this parameterises the angle between.
const Angle & GetAngle() const
Get the angle that is parameterised.
const TypeCounts & GetMappedTypeCounts() const
const Bond & GetBond() const
Get the bond that is parameterised.
double StandardDeviationCharge() const
Get the standard deviation of the charges.
const Atom & GetAtom() const
Get the atom this parameterises.
const FFAtom & GetMostCommonType() const
Get the mode of mapped atom types.
eastl::vector_map< PDihedral, uint32_t > ParamDihedrals
Container type to hold parameterised dihedrals.
Definition: parameterised.hpp:270
const Dihedral & GetDihedral() const
Get the dihedral that is parameterised.
const TypeCounts & GetMappedTypeCounts() const
bool ApplyParameterisation(bool self_consistent)
Apply the parameterisation.
const ParamAtom & GetAtom(const Atom &atm) const
Get the parameterisation of an atom.
Namespace for all graph related functionality.
Definition: access.hpp:7
void MappedWith(const Dihedral &mapped)
Obtain details from mapped dihedral.
const TypeCounts & GetMappedTypeCounts() const
Definition: angle.hpp:12
const std::vector< ParamBond > & GetBonds() const
int64_t NumSourceBonds() const
Calculates the number of mapped bonds.
const ParamDihedral & GetDihedral(const Dihedral &dhd)
Get the parameterisation of a dihedral.
std::pair< Atom, Atom > BondAtoms
Type giving the atoms this parameterised bond is between.
Definition: parameterised.hpp:87
const std::vector< ParamAngle > & GetAngles() const
const ParamBond & GetBond(const Bond &bnd) const
Get the parameterisation of a bond.
int64_t NumSourceAtoms() const
Calculates the number of mapped atoms.
eastl::vector_map< FFBond, size_t > TypeCounts
Type giving counts of each mapped bond type.
Definition: parameterised.hpp:85
Definition: triple.hpp:11
bool ApplyParameterisation(bool self_consistent)
Apply the parameterisation.
const AngleAtoms & GetAtoms() const
Get the atoms this parameterises the angle between.
Definition: dihedral.hpp:14
void MappedWith(const Atom &mapped)
Obtain details from mapped atom.
Definition: molecule.hpp:15
std::pair< Atom, Atom > PBond
Type defining bonds.
Definition: parameterised.hpp:260
Definition: parameterised.hpp:196
#define INDIGOX_GENERIC_PIMPL_CLASS_OPERATORS(class_name, short_name)
Definition: fwd_declares.hpp:26
eastl::vector_map< FFAtom, size_t > TypeCounts
Type giving counts of each mapped atom type.
Definition: parameterised.hpp:18
std::vector< FFDihedral > TypeGroup
Type giving counts of each mapped dihedral type.
Definition: parameterised.hpp:199
const FFBond & GetMostCommonType() const
Get the mode of mapped bond types.
const MappedCharge & GetMappedCharges() const
Definition: parameterised.hpp:139
const TypeGroup & GetMostCommonType() const
Get the mode of mapped bond types.
int64_t NumSourceDihedral() const
Calculate the number of mapped dihedrals.
eastl::vector_map< PAngle, uint32_t > ParamAngles
Container type to hold parameterised angles.
Definition: parameterised.hpp:266
int64_t NumSourceAngles() const
Calculate the number of mapped angles.
eastl::vector_map< PBond, uint32_t > ParamBonds
Container type to hold parameterised bonds.
Definition: parameterised.hpp:262
Definition: parameterised.hpp:15
std::vector< double > MappedCharge
Type giving all mapped charges.
Definition: parameterised.hpp:20
const std::vector< ParamDihedral > & GetDihedrals() const
const TypeCounts & GetMappedTypeCounts() const
Definition: parameterised.hpp:255
Definition: parameterised.hpp:82
const FFAngle & GetMostCommonType() const
Get the mode of mapped bond types.
Definition: forcefield.hpp:151
Definition: quad.hpp:12
void MappedWith(const Bond &mapped)
Obtain details from mapped bonds.
eastl::vector_map< TypeGroup, size_t > TypeCounts
Definition: parameterised.hpp:200
double MeadianCharge()
Get the median of the charges.
bool ApplyParameterisation(bool self_consistent)
Apply the parameterisation.