File: Params.h

package info (click to toggle)
rdkit 201203-3
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 37,840 kB
  • sloc: cpp: 93,902; python: 51,897; java: 5,192; ansic: 3,497; xml: 2,499; sql: 1,641; yacc: 1,518; lex: 1,076; makefile: 325; fortran: 183; sh: 153; cs: 51
file content (101 lines) | stat: -rw-r--r-- 3,491 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
//
//  Copyright (C) 2004-2006 Rational Discovery LLC
//
//   @@ All Rights Reserved @@
//  This file is part of the RDKit.
//  The contents are covered by the terms of the BSD license
//  which is included in the file license.txt, found at the root
//  of the RDKit source tree.
//
#ifndef __RD_PARAMS_H__
#define __RD_PARAMS_H__

#include <string>
#include <map>

namespace ForceFields {
  namespace UFF {

    //! class to store atomic parameters for the Universal Force Field
    class AtomicParams {
    public:
      double r1;     //!<  valence bond radius
      double theta0; //!< valence angle
      double x1;     //!< vdW characteristic length
      double D1;     //!< vdW atomic energy
      double zeta;   //!< vdW scaling term
      double Z1;     //!< effective charge
      double V1;     //!< sp3 torsional barrier parameter
      double U1;     //!< torsional contribution for sp2-sp3 bonds
      double GMP_Xi; //!< GMP Electronegativity;
      double GMP_Hardness; //!< GMP Hardness
      double GMP_Radius;   //!< GMP Radius value
    };

  
    namespace Params {
      const double lambda=0.1332;       //!< scaling factor for rBO correction
      const double G=332.06;            //!< bond force constant prefactor
      const double amideBondOrder=1.41; //!< special case bond order for amide C-N bonds.
    };

    //! singleton class for retrieving UFF AtomParams
    /*!
      Use the singleton like this:
      
      \verbatim
      ParamCollection *params=ParamCollection::getParams();
      const AtomParams *ap=params("C_3");
      \endverbatim

      If you have your own parameter data, it can be supplied as a string:
      \verbatim
      ParamCollection *params=ParamCollection::getParams(myParamData);
      const AtomParams *ap=params("C_3");
      \endverbatim
      You are responsible for making sure that the data is in the correct
      format (see Params.cpp for an example).
      
    */
    class ParamCollection {
    public:
      //! gets a pointer to the singleton ParamCollection
      /*!
	\param paramData (optional) a string with parameter data. See
	 below for more information about this argument

	\return a pointer to the singleton ParamCollection

	<b>Notes:</b>
	  - do <b>not</b> delete the pointer returned here
	  - if the singleton ParamCollection has already been instantiated and
	    \c paramData is empty, the singleton will be returned.
	  - if \c paramData is empty and the singleton ParamCollection has
	    not yet been instantiated, the default UFF parameters (from Params.cpp)
	    will be used.
	  - if \c paramData is supplied, a new singleton will be instantiated.
	    The current instantiation (if there is one) will be deleted.
      */
      static ParamCollection *getParams(const std::string &paramData="");
      //! Looks up the parameters for a particular UFF key and returns them.
      /*!
	\return a pointer to the AtomicParams object, NULL on failure.
      */
      const AtomicParams *operator()(const std::string &symbol) const {
	std::map<std::string,AtomicParams>::const_iterator res;
	res=d_params.find(symbol);
	if(res!=d_params.end()){
	  return &((*res).second);
	}
	return 0;
      }
    private:
      //! to force this to be a singleton, the constructor must be private
      ParamCollection(std::string paramData);
      static class ParamCollection *ds_instance;    //!< the singleton
      std::map<std::string,AtomicParams> d_params;  //!< the parameter map
    };

  }
}
#endif