Chemical Data Processing Library C++ API - Version 1.4.0
MMFF94VanDerWaalsParameterTable.hpp
Go to the documentation of this file.
1 /*
2  * MMFF94VanDerWaalsParameterTable.hpp
3  *
4  * This file is part of the Chemical Data Processing Toolkit
5  *
6  * Copyright (C) 2003 Thomas Seidel <thomas.seidel@univie.ac.at>
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public License
19  * along with this library; see the file COPYING. If not, write to
20  * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21  * Boston, MA 02111-1307, USA.
22  */
23 
29 #ifndef CDPL_FORCEFIELD_MMFF94VANDERWAALSPARAMETERTABLE_HPP
30 #define CDPL_FORCEFIELD_MMFF94VANDERWAALSPARAMETERTABLE_HPP
31 
32 #include <iosfwd>
33 #include <cstddef>
34 #include <unordered_map>
35 #include <memory>
36 #include <functional>
37 
38 #include <boost/iterator/transform_iterator.hpp>
39 
42 
43 
44 namespace CDPL
45 {
46 
47  namespace ForceField
48  {
49 
58  {
59 
60  public:
61  class Entry;
62 
63  private:
64  typedef std::unordered_map<unsigned int, Entry> DataStorage;
65 
66  public:
68  typedef std::shared_ptr<MMFF94VanDerWaalsParameterTable> SharedPointer;
71 
76  {
77 
78  public:
82  Entry();
83 
93  Entry(unsigned int atom_type, double atom_pol, double eff_el_num, double fact_a, double fact_g,
94  HDonorAcceptorType don_acc_type);
95 
100  unsigned int getAtomType() const;
101 
106  double getAtomicPolarizability() const;
107 
113 
118  double getFactorA() const;
119 
124  double getFactorG() const;
125 
131 
136  operator bool() const;
137 
138  private:
139  unsigned int atomType;
140  double polarizability;
141  double effElNumber;
142  double factA;
143  double factG;
144  HDonorAcceptorType donAccType;
145  bool initialized;
146  };
147 
149  typedef boost::transform_iterator<std::function<const Entry&(const DataStorage::value_type&)>,
150  DataStorage::const_iterator>
152 
154  typedef boost::transform_iterator<std::function<Entry&(DataStorage::value_type&)>,
155  DataStorage::iterator>
157 
162 
172  void addEntry(unsigned int atom_type, double atom_pol, double eff_el_num, double fact_a, double fact_g,
173  HDonorAcceptorType don_acc_type);
174 
180  const Entry& getEntry(unsigned int atom_type) const;
181 
186  std::size_t getNumEntries() const;
187 
191  void clear();
192 
198  bool removeEntry(unsigned int atom_type);
199 
206 
212 
218 
224 
230 
236 
242 
248 
254 
259  void setExponent(double value);
260 
265  void setBeta(double value);
266 
271  void setFactorB(double value);
272 
277  void setFactorDARAD(double value);
278 
283  void setFactorDAEPS(double value);
284 
290  double getExponent() const;
291 
297  double getFactorB() const;
298 
304  double getBeta() const;
305 
311  double getFactorDARAD() const;
312 
318  double getFactorDAEPS() const;
319 
324  void load(std::istream& is);
325 
329  void loadDefaults();
330 
335  static void set(const SharedPointer& table);
336 
341  static const SharedPointer& get();
342 
343  private:
344  static SharedPointer defaultTable;
345  DataStorage entries;
346  double exponent;
347  double factB;
348  double beta;
349  double factDARAD;
350  double factDAEPS;
351  };
352  } // namespace ForceField
353 } // namespace CDPL
354 
355 #endif // CDPL_FORCEFIELD_MMFF94VANDERWAALSPARAMETERTABLE_HPP
Definition of the preprocessor macro CDPL_FORCEFIELD_API.
#define CDPL_FORCEFIELD_API
Tells the compiler/linker which classes, functions and variables are part of the library API.
Definition of class CDPL::ForceField::MMFF94VanDerWaalsInteraction.
HDonorAcceptorType
MMFF94 hydrogen-bond donor/acceptor classification of an atom.
Definition: MMFF94VanDerWaalsInteraction.hpp:51
A single per-atom-type Van der Waals parameter record.
Definition: MMFF94VanDerWaalsParameterTable.hpp:76
double getAtomicPolarizability() const
Returns the atomic polarizability parameter.
Entry()
Constructs an empty (uninitialized) Entry instance.
Entry(unsigned int atom_type, double atom_pol, double eff_el_num, double fact_a, double fact_g, HDonorAcceptorType don_acc_type)
Constructs an Entry for the numeric MMFF94 atom type atom_type.
HDonorAcceptorType getHDonorAcceptorType() const
Returns the H-donor/-acceptor classification associated with the numeric MMFF94 atom type.
double getFactorG() const
Returns the scaling factor G parameter.
double getFactorA() const
Returns the scaling factor A parameter.
unsigned int getAtomType() const
Returns the numeric MMFF94 atom type of the entry.
double getEffectiveElectronNumber() const
Returns the Slater-Kirkwood effective number of valence electrons parameter.
Lookup table mapping numeric MMFF94 atom types to per-atom-type Van der Waals parameters (atomic pola...
Definition: MMFF94VanDerWaalsParameterTable.hpp:58
static void set(const SharedPointer &table)
Replaces the process-wide default table by table.
EntryIterator removeEntry(const EntryIterator &it)
Removes the entry pointed to by the iterator it.
boost::transform_iterator< std::function< Entry &(DataStorage::value_type &)>, DataStorage::iterator > EntryIterator
A mutable iterator over the entries of the table.
Definition: MMFF94VanDerWaalsParameterTable.hpp:156
double getFactorB() const
Returns the value of the B factor used in the calculation of Van der Waals interaction energies.
MMFF94VanDerWaalsParameterTable()
Constructs an empty MMFF94VanDerWaalsParameterTable instance.
static const SharedPointer & get()
Returns the process-wide default table (lazily initialized on first call).
double getFactorDARAD() const
Returns the value of the DARAD factor used in the calculation of Van der Waals interaction energies.
boost::transform_iterator< std::function< const Entry &(const DataStorage::value_type &)>, DataStorage::const_iterator > ConstEntryIterator
A constant iterator over the entries of the table.
Definition: MMFF94VanDerWaalsParameterTable.hpp:151
MMFF94VanDerWaalsInteraction::HDonorAcceptorType HDonorAcceptorType
Alias for the H-donor/-acceptor classification enum defined on MMFF94VanDerWaalsInteraction.
Definition: MMFF94VanDerWaalsParameterTable.hpp:70
const Entry & getEntry(unsigned int atom_type) const
Returns the entry for the numeric MMFF94 atom type atom_type.
void setFactorDAEPS(double value)
Sets the global DAEPS factor used in the buffered 14-7 Van der Waals energy expression.
void setBeta(double value)
Sets the global beta value used in the buffered 14-7 Van der Waals energy expression.
void loadDefaults()
Loads the built-in default Van der Waals parameter entries and global scalar parameters.
ConstEntryIterator getEntriesEnd() const
Returns a constant iterator pointing one past the last entry.
void setFactorDARAD(double value)
Sets the global DARAD factor used in the buffered 14-7 Van der Waals energy expression.
void load(std::istream &is)
Loads table entries from the input stream is.
double getBeta() const
Returns the value of beta used in the calculation of Van der Waals interaction energies.
void clear()
Removes all entries from the table.
EntryIterator getEntriesBegin()
Returns a mutable iterator pointing to the beginning of the entry list.
ConstEntryIterator end() const
Returns a constant iterator pointing one past the last entry (alias of getEntriesEnd()).
std::shared_ptr< MMFF94VanDerWaalsParameterTable > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated MMFF94VanDerWaalsParameterTable i...
Definition: MMFF94VanDerWaalsParameterTable.hpp:68
double getFactorDAEPS() const
Returns the value of the DAEPS factor used in the calculation of Van der Waals interaction energies.
EntryIterator begin()
Returns a mutable iterator pointing to the beginning of the entry list (alias of getEntriesBegin()).
EntryIterator end()
Returns a mutable iterator pointing one past the last entry (alias of getEntriesEnd()).
ConstEntryIterator getEntriesBegin() const
Returns a constant iterator pointing to the beginning of the entry list.
void addEntry(unsigned int atom_type, double atom_pol, double eff_el_num, double fact_a, double fact_g, HDonorAcceptorType don_acc_type)
Adds (or overwrites) the entry for the numeric MMFF94 atom type atom_type.
void setFactorB(double value)
Sets the global B factor used in the buffered 14-7 Van der Waals energy expression.
EntryIterator getEntriesEnd()
Returns a mutable iterator pointing one past the last entry.
double getExponent() const
Returns the exponent used in the calculation of Van der Waals interaction energies.
bool removeEntry(unsigned int atom_type)
Removes the entry for the numeric MMFF94 atom type atom_type.
ConstEntryIterator begin() const
Returns a constant iterator pointing to the beginning of the entry list (alias of getEntriesBegin()).
void setExponent(double value)
Sets the global exponent used in the buffered 14-7 Van der Waals energy expression.
std::size_t getNumEntries() const
Returns the number of entries in the table.
The namespace of the Chemical Data Processing Library.