Chemical Data Processing Library C++ API - Version 1.2.0
MMFF94ChargeCalculator.hpp
Go to the documentation of this file.
1 /*
2  * MMFF94ChargeCalculator.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_MMFF94CHARGECALCULATOR_HPP
30 #define CDPL_FORCEFIELD_MMFF94CHARGECALCULATOR_HPP
31 
32 #include <cstddef>
33 #include <memory>
34 
41 #include "CDPL/Util/Array.hpp"
42 #include "CDPL/Util/BitSet.hpp"
43 
44 
45 namespace CDPL
46 {
47 
48  namespace Chem
49  {
50 
51  class MolecularGraph;
52  class Atom;
53  } // namespace Chem
54 
55  namespace ForceField
56  {
57 
59  {
60 
61  public:
62  typedef std::shared_ptr<MMFF94ChargeCalculator> SharedPointer;
63 
65 
66  MMFF94ChargeCalculator(const Chem::MolecularGraph& molgraph, Util::DArray& charges, bool strict);
67 
69 
71 
73 
75 
77 
79 
81 
83 
120  void calculate(const Chem::MolecularGraph& molgraph, Util::DArray& charges, bool strict);
121 
123 
124  private:
129 
130  typedef std::vector<std::size_t> AtomIndexList;
131 
132  void init(const Chem::MolecularGraph& molgraph, Util::DArray& charges);
133 
134  void assignFormalCharges();
135  void distFormalNeighborCharges(const Chem::Atom& atom, const FormChargeDefEntry& entry);
136  void distFormalAromAtomCharges(const Chem::Atom& atom, const FormChargeDefEntry& entry);
137 
138  void calcPartialCharges(Util::DArray& charges, bool strict) const;
139  double getBondChargeIncrement(unsigned int bnd_type_idx, unsigned int atom_type1, unsigned int atom_type2,
140  const PBCIEntry& pbci_entry1, const PBCIEntry& pbci_entry2) const;
141 
146  MMFF94RingSetFunction aromRingSetFunc;
147  MMFF94NumericAtomTypeFunction numAtomTypeFunc;
148  MMFF94SymbolicAtomTypeFunction symAtomTypeFunc;
149  MMFF94BondTypeIndexFunction bondTypeIdxFunc;
150  Util::DArray formCharges;
151  Util::BitSet assFormChargeMask;
152  AtomIndexList atomList;
153  const Chem::MolecularGraph* molGraph;
154  };
155  } // namespace ForceField
156 } // namespace CDPL
157 
158 #endif // CDPL_FORCEFIELD_MMFF94CHARGECALCULATOR_HPP
Definition of the class CDPL::Util::Array.
Definition of the type CDPL::Util::BitSet.
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 the class CDPL::ForceField::MMFF94AtomTypePropertyTable.
Definition of the class CDPL::ForceField::MMFF94BondChargeIncrementTable.
Definition of the class CDPL::ForceField::MMFF94FormalAtomChargeDefinitionTable.
Definition of the class CDPL::ForceField::MMFF94PartialBondChargeIncrementTable.
Type definition of generic wrapper classes for storing user-defined functions for the retrieval of MM...
Atom.
Definition: Atom.hpp:52
MolecularGraph.
Definition: MolecularGraph.hpp:52
Definition: MMFF94AtomTypePropertyTable.hpp:62
std::shared_ptr< MMFF94AtomTypePropertyTable > SharedPointer
Definition: MMFF94AtomTypePropertyTable.hpp:59
Definition: MMFF94BondChargeIncrementTable.hpp:63
std::shared_ptr< MMFF94BondChargeIncrementTable > SharedPointer
Definition: MMFF94BondChargeIncrementTable.hpp:60
Definition: MMFF94ChargeCalculator.hpp:59
void setFormalChargeDefinitionTable(const MMFF94FormalAtomChargeDefinitionTable::SharedPointer &table)
const Util::DArray & getFormalCharges() const
void setAromaticRingSetFunction(const MMFF94RingSetFunction &func)
void setSymbolicAtomTypeFunction(const MMFF94SymbolicAtomTypeFunction &func)
void calculate(const Chem::MolecularGraph &molgraph, Util::DArray &charges, bool strict)
Calculates MMFF94 partial charges for the atoms of a molecular graph.
std::shared_ptr< MMFF94ChargeCalculator > SharedPointer
Definition: MMFF94ChargeCalculator.hpp:62
MMFF94ChargeCalculator(const Chem::MolecularGraph &molgraph, Util::DArray &charges, bool strict)
void setNumericAtomTypeFunction(const MMFF94NumericAtomTypeFunction &func)
void setAtomTypePropertyTable(const MMFF94AtomTypePropertyTable::SharedPointer &table)
void setPartialBondChargeIncrementTable(const MMFF94PartialBondChargeIncrementTable::SharedPointer &table)
void setBondTypeIndexFunction(const MMFF94BondTypeIndexFunction &func)
void setBondChargeIncrementTable(const MMFF94BondChargeIncrementTable::SharedPointer &table)
Definition: MMFF94FormalAtomChargeDefinitionTable.hpp:64
std::shared_ptr< MMFF94FormalAtomChargeDefinitionTable > SharedPointer
Definition: MMFF94FormalAtomChargeDefinitionTable.hpp:61
Definition: MMFF94PartialBondChargeIncrementTable.hpp:62
std::shared_ptr< MMFF94PartialBondChargeIncrementTable > SharedPointer
Definition: MMFF94PartialBondChargeIncrementTable.hpp:59
std::function< unsigned int(const Chem::Atom &)> MMFF94NumericAtomTypeFunction
A generic wrapper class used to store a user-defined numeric MMFF94 atom type function.
Definition: MMFF94PropertyFunctions.hpp:56
std::function< const Chem::FragmentList::SharedPointer &(const Chem::MolecularGraph &)> MMFF94RingSetFunction
A generic wrapper class used to store a user-defined MMFF94 ring set function.
Definition: MMFF94PropertyFunctions.hpp:76
std::function< unsigned int(const Chem::Bond &)> MMFF94BondTypeIndexFunction
A generic wrapper class used to store a user-defined MMFF94 bond type index function.
Definition: MMFF94PropertyFunctions.hpp:71
std::function< const std::string &(const Chem::Atom &)> MMFF94SymbolicAtomTypeFunction
A generic wrapper class used to store a user-defined symbolic MMFF94 atom type function.
Definition: MMFF94PropertyFunctions.hpp:61
Array< double > DArray
An array of double precision floating-point numbers.
Definition: Array.hpp:587
boost::dynamic_bitset BitSet
A dynamic bitset class.
Definition: BitSet.hpp:46
The namespace of the Chemical Data Processing Library.