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 
59  {
60 
61  public:
62  class Entry;
63 
64  private:
65  typedef std::unordered_map<unsigned int, Entry> DataStorage;
66 
67  public:
71  typedef std::shared_ptr<MMFF94VanDerWaalsParameterTable> SharedPointer;
72 
77 
82  {
83 
84  public:
88  Entry();
89 
99  Entry(unsigned int atom_type, double atom_pol, double eff_el_num, double fact_a, double fact_g,
100  HDonorAcceptorType don_acc_type);
101 
106  unsigned int getAtomType() const;
107 
112  double getAtomicPolarizability() const;
113 
119 
124  double getFactorA() const;
125 
130  double getFactorG() const;
131 
137 
142  operator bool() const;
143 
144  private:
145  unsigned int atomType;
146  double polarizability;
147  double effElNumber;
148  double factA;
149  double factG;
150  HDonorAcceptorType donAccType;
151  bool initialized;
152  };
153 
157  typedef boost::transform_iterator<std::function<const Entry&(const DataStorage::value_type&)>,
158  DataStorage::const_iterator>
160 
164  typedef boost::transform_iterator<std::function<Entry&(DataStorage::value_type&)>,
165  DataStorage::iterator>
167 
172 
182  void addEntry(unsigned int atom_type, double atom_pol, double eff_el_num, double fact_a, double fact_g,
183  HDonorAcceptorType don_acc_type);
184 
190  const Entry& getEntry(unsigned int atom_type) const;
191 
196  std::size_t getNumEntries() const;
197 
201  void clear();
202 
208  bool removeEntry(unsigned int atom_type);
209 
216 
222 
228 
234 
240 
246 
252 
258 
264 
269  void setExponent(double value);
270 
275  void setBeta(double value);
276 
281  void setFactorB(double value);
282 
287  void setFactorDARAD(double value);
288 
293  void setFactorDAEPS(double value);
294 
300  double getExponent() const;
301 
307  double getFactorB() const;
308 
314  double getBeta() const;
315 
321  double getFactorDARAD() const;
322 
328  double getFactorDAEPS() const;
329 
334  void load(std::istream& is);
335 
339  void loadDefaults();
340 
345  static void set(const SharedPointer& table);
346 
351  static const SharedPointer& get();
352 
353  private:
354  static SharedPointer defaultTable;
355  DataStorage entries;
356  double exponent;
357  double factB;
358  double beta;
359  double factDARAD;
360  double factDAEPS;
361  };
362  } // namespace ForceField
363 } // namespace CDPL
364 
365 #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:54
Data structure for the storage of values associated with a single table entry.
Definition: MMFF94VanDerWaalsParameterTable.hpp:82
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 instance storing the given values.
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.
Data structure for the storage and lookup of MMFF94 interaction parameters.
Definition: MMFF94VanDerWaalsParameterTable.hpp:59
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:166
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:159
MMFF94VanDerWaalsInteraction::HDonorAcceptorType HDonorAcceptorType
Alias for the H-donor/-acceptor classification enum defined on MMFF94VanDerWaalsInteraction.
Definition: MMFF94VanDerWaalsParameterTable.hpp:76
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 MMFF94 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:71
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 a new (or overwrites an existing) entry for the numeric MMFF94 atom type atom_type that stores t...
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.