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 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head><meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>Open Babel: OBChargeModel Class Reference</title>
<link href="/site.css" rel="stylesheet" type="text/css">
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="search/search.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!--#include file="header.html" -->
<!-- Generated by Doxygen 1.7.2 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="index.shtml"><span>Main Page</span></a></li>
<li><a href="pages.shtml"><span>Related Pages</span></a></li>
<li><a href="modules.shtml"><span>Modules</span></a></li>
<li><a href="namespaces.shtml"><span>Namespaces</span></a></li>
<li class="current"><a href="annotated.shtml"><span>Classes</span></a></li>
<li><a href="files.shtml"><span>Files</span></a></li>
<li><a href="examples.shtml"><span>Examples</span></a></li>
<li id="searchli">
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
<div class="tabs2">
<ul class="tablist">
<li><a href="annotated.shtml"><span>Class List</span></a></li>
<li><a href="classes.shtml"><span>Class Index</span></a></li>
<li><a href="hierarchy.shtml"><span>Class Hierarchy</span></a></li>
<li><a href="functions.shtml"><span>Class Members</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="headertitle">
<h1>OBChargeModel Class Reference</h1> </div>
</div>
<div class="contents">
<!-- doxytag: class="OBChargeModel" -->
<p>Atomic partial charge models.
<a href="#_details">More...</a></p>
<p><code>#include <<a class="el" href="chargemodel_8h_source.shtml">openbabel/chargemodel.h</a>></code></p>
<table class="memberdecls">
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<p>Atomic partial charge models. </p>
<dl class="since"><dt><b>Since:</b></dt><dd>version 2.3</dd></dl>
<p>Classes derived from <a class="el" href="classOBChargeModel.shtml" title="Atomic partial charge models.">OBChargeModel</a> implement different atomic partial charge models. It is intended to allow assinging partial charges beyond the traditional Gasteiger-Marsili sigma charges previously used in Open Babel. A --partialcharge method is provided for the babel command-line, allowing you to override the Gasteiger charge assignment and use other charge models.</p>
<p>The advantage of plugin classes is that no existing code has to be modified when a new class is added. You can list those that are present by babel -L charges or from a menu item in the GUI.</p>
<p>Any <a class="el" href="classOBChargeModel.shtml" title="Atomic partial charge models.">OBChargeModel</a> derived class works like other plugins and needs to to have a constructor, a function returning a short description, and a ComputeCharges() function which does the work. A single global instance of the class needs to be instantiated to define the ID, by which the class is subsequently accessed.</p>
<p>Once ComputeCharges() has been called, the atoms of the molecule can be queried for partial or formal charges using OBAtom::GetPartialCharge() or in vector form from the model itself:</p>
<div class="fragment"><pre class="fragment"> OBMol inputMolecule;
<a class="code" href="classOBChargeModel.shtml" title="Atomic partial charge models.">OBChargeModel</a> *mmffCharges = OBChargeModel::FindType(<span class="stringliteral">"mmff94"</span>);
<span class="keyword">const</span> std::vector<double> partialCharges;
<span class="keywordflow">if</span> (mmffCharges && mmffCharges->ComputeCharges(inputMolecule)) {
partialCharges = mmffCharges->GetPartialCharges();
}
</pre></div><p>Note: Formal charges are also returned as floating point values, since some charge models consider delocalized charges (e.g., 0.5 for an O in a carboxylate CO2- group).</p>
<div class="fragment"><pre class="fragment"> <a class="code" href="classOBChargeModel.shtml" title="Atomic partial charge models.">OBChargeModel</a> *gasteiger = OBChargeModel::FindType(<span class="stringliteral">"gasteiger"</span>);
<span class="keywordflow">if</span> (gasteiger) {
cout << <span class="stringliteral">" gasteiger: "</span> << dipoleMagnitude(gasteiger->GetDipoleMoment(mol));
}
</pre></div><p>By default, Open Babel 2.3 includes Gasteiger and MMFF94 partial charges. If the Eigen matrix library is found when compiling, the QEq and QTPIE methods will be added. Future releases will likely add additional charge models. </p>
<hr/>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="chargemodel_8h_source.shtml">chargemodel.h</a></li>
</ul>
</div>
<!--- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark"> </span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark"> </span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark"> </span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark"> </span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark"> </span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark"> </span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark"> </span>Friends</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark"> </span>Defines</a></div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
</div><!-- end content -->
<!--#include file="footer.html" -->
<div id="footer">
<hr size="1">
<img src="http://openbabel.org/babel256.png" width="136" height="127" alt="" style="float: left;" />
<p>This file is part of the documentation for <a href="http://openbabel.org/wiki/">Open Babel</a>, version 2.3.</p>
<div class="bottom">
Documentation copyright © 1998-2007, the <a href="http://openbabel.org/wiki/THANKS">Open Babel Developers</a>.<br>
Open Babel is hosted by: <a href="http://sourceforge.net">
<img src="http://sourceforge.net/sflogo.php?group_id=40728"
width="88" height="31" border="0" alt="SourceForge Logo"></a><br>
Generated on Fri Oct 22 2010 14:36:03 by <a href="http://www.doxygen.org/"><img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.7.2.
</div>
</body>
</html>
|