<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> <title>MPQC: fdhess.h Source File</title> <link href="tabs.css" rel="stylesheet" type="text/css"> <link href="doxygen.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.5.9 --> <div class="navigation" id="top"> <div class="tabs"> <ul> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="pages.html"><span>Related Pages</span></a></li> <li><a href="annotated.html"><span>Classes</span></a></li> <li class="current"><a href="files.html"><span>Files</span></a></li> </ul> </div> <div class="tabs"> <ul> <li><a href="files.html"><span>File List</span></a></li> </ul> </div> <h1>fdhess.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">//</span> <a name="l00002"></a>00002 <span class="comment">// fdhess.h</span> <a name="l00003"></a>00003 <span class="comment">//</span> <a name="l00004"></a>00004 <span class="comment">// Copyright (C) 1997 Limit Point Systems, Inc.</span> <a name="l00005"></a>00005 <span class="comment">//</span> <a name="l00006"></a>00006 <span class="comment">// Author: Curtis Janssen <cljanss@limitpt.com></span> <a name="l00007"></a>00007 <span class="comment">// Maintainer: LPS</span> <a name="l00008"></a>00008 <span class="comment">//</span> <a name="l00009"></a>00009 <span class="comment">// This file is part of the SC Toolkit.</span> <a name="l00010"></a>00010 <span class="comment">//</span> <a name="l00011"></a>00011 <span class="comment">// The SC Toolkit is free software; you can redistribute it and/or modify</span> <a name="l00012"></a>00012 <span class="comment">// it under the terms of the GNU Library General Public License as published by</span> <a name="l00013"></a>00013 <span class="comment">// the Free Software Foundation; either version 2, or (at your option)</span> <a name="l00014"></a>00014 <span class="comment">// any later version.</span> <a name="l00015"></a>00015 <span class="comment">//</span> <a name="l00016"></a>00016 <span class="comment">// The SC Toolkit is distributed in the hope that it will be useful,</span> <a name="l00017"></a>00017 <span class="comment">// but WITHOUT ANY WARRANTY; without even the implied warranty of</span> <a name="l00018"></a>00018 <span class="comment">// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span> <a name="l00019"></a>00019 <span class="comment">// GNU Library General Public License for more details.</span> <a name="l00020"></a>00020 <span class="comment">//</span> <a name="l00021"></a>00021 <span class="comment">// You should have received a copy of the GNU Library General Public License</span> <a name="l00022"></a>00022 <span class="comment">// along with the SC Toolkit; see the file COPYING.LIB. If not, write to</span> <a name="l00023"></a>00023 <span class="comment">// the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.</span> <a name="l00024"></a>00024 <span class="comment">//</span> <a name="l00025"></a>00025 <span class="comment">// The U.S. Government is granted a limited license as per AL 91-7.</span> <a name="l00026"></a>00026 <span class="comment">//</span> <a name="l00027"></a>00027 <a name="l00028"></a>00028 <span class="preprocessor">#ifndef _chemistry_molecule_fdhess_h</span> <a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#define _chemistry_molecule_fdhess_h</span> <a name="l00030"></a>00030 <span class="preprocessor"></span> <a name="l00031"></a>00031 <span class="preprocessor">#ifdef __GNUC__</span> <a name="l00032"></a>00032 <span class="preprocessor"></span><span class="preprocessor">#pragma interface</span> <a name="l00033"></a>00033 <span class="preprocessor"></span><span class="preprocessor">#endif</span> <a name="l00034"></a>00034 <span class="preprocessor"></span> <a name="l00035"></a>00035 <span class="preprocessor">#include <iostream></span> <a name="l00036"></a>00036 <a name="l00037"></a>00037 <span class="preprocessor">#include <chemistry/molecule/hess.h></span> <a name="l00038"></a>00038 <span class="preprocessor">#include <chemistry/molecule/energy.h></span> <a name="l00039"></a>00039 <a name="l00040"></a>00040 <span class="keyword">namespace </span>sc { <a name="l00041"></a>00041 <a name="l00045"></a><a class="code" href="classsc_1_1FinDispMolecularHessian.html">00045</a> <span class="keyword">class </span><a class="code" href="classsc_1_1FinDispMolecularHessian.html" title="Computes the molecular hessian by finite displacements of gradients.">FinDispMolecularHessian</a>: <span class="keyword">public</span> <a class="code" href="classsc_1_1MolecularHessian.html" title="MolecularHessian is an abstract class that computes a molecule&#39;s second derivatives...">MolecularHessian</a> { <a name="l00046"></a>00046 <span class="keyword">protected</span>: <a name="l00047"></a>00047 <a class="code" href="classsc_1_1Ref.html">Ref<MolecularEnergy></a> mole_; <a name="l00048"></a>00048 <span class="comment">// In case molecule must be given in lower symmetry, its actual</span> <a name="l00049"></a>00049 <span class="comment">// symmetry and the symmetry used to compute displacements is this</span> <a name="l00050"></a>00050 <a class="code" href="classsc_1_1Ref.html">Ref<PointGroup></a> displacement_point_group_; <a name="l00051"></a>00051 <span class="comment">// The molecule's original point group for restoration at the end.</span> <a name="l00052"></a>00052 <a class="code" href="classsc_1_1Ref.html">Ref<PointGroup></a> original_point_group_; <a name="l00053"></a>00053 <span class="comment">// The molecule's original geometry for restoration at the end and</span> <a name="l00054"></a>00054 <span class="comment">//computing displacements.</span> <a name="l00055"></a>00055 <a class="code" href="classsc_1_1RefSCVector.html" title="The RefSCVector class is a smart pointer to an SCVector specialization.">RefSCVector</a> original_geometry_; <a name="l00056"></a>00056 <span class="comment">// the cartesian displacement size in bohr</span> <a name="l00057"></a>00057 <span class="keywordtype">double</span> disp_; <a name="l00058"></a>00058 <span class="comment">// the accuracy for gradient calculations</span> <a name="l00059"></a>00059 <span class="keywordtype">double</span> accuracy_; <a name="l00060"></a>00060 <span class="comment">// the number of completed displacements</span> <a name="l00061"></a>00061 <span class="keywordtype">int</span> ndisp_; <a name="l00062"></a>00062 <span class="comment">// the number of irreps in the displacement point group</span> <a name="l00063"></a>00063 <span class="keywordtype">int</span> nirrep_; <a name="l00064"></a>00064 <span class="comment">// whether or not to attempt a restart</span> <a name="l00065"></a>00065 <span class="keywordtype">int</span> restart_; <a name="l00066"></a>00066 <span class="comment">// the name of the restart file</span> <a name="l00067"></a>00067 <span class="keywordtype">char</span> *restart_file_; <a name="l00068"></a>00068 <span class="comment">// whether or not to checkpoint</span> <a name="l00069"></a>00069 <span class="keywordtype">int</span> checkpoint_; <a name="l00070"></a>00070 <span class="comment">// the name of the checkpoint file</span> <a name="l00071"></a>00071 <span class="keywordtype">char</span> *checkpoint_file_; <a name="l00072"></a>00072 <span class="comment">// only do the totally symmetric displacements</span> <a name="l00073"></a>00073 <span class="keywordtype">int</span> only_totally_symmetric_; <a name="l00074"></a>00074 <span class="comment">// eliminate the cubic terms by doing an extra displacement for</span> <a name="l00075"></a>00075 <span class="comment">//each of the totally symmetry coordinates</span> <a name="l00076"></a>00076 <span class="keywordtype">int</span> eliminate_cubic_terms_; <a name="l00077"></a>00077 <span class="comment">// use the gradient at the initial geometry to remove first order terms</span> <a name="l00078"></a>00078 <span class="comment">// (important if not at equilibrium geometry)</span> <a name="l00079"></a>00079 <span class="keywordtype">int</span> do_null_displacement_; <a name="l00080"></a>00080 <span class="comment">// print flag</span> <a name="l00081"></a>00081 <span class="keywordtype">int</span> debug_; <a name="l00082"></a>00082 <span class="comment">// a basis for the symmetrized cartesian coordinates</span> <a name="l00083"></a>00083 <a class="code" href="classsc_1_1RefSCMatrix.html" title="The RefSCMatrix class is a smart pointer to an SCMatrix specialization.">RefSCMatrix</a> symbasis_; <a name="l00084"></a>00084 <span class="comment">// the gradients at each of the displacements</span> <a name="l00085"></a>00085 <a class="code" href="classsc_1_1RefSCVector.html" title="The RefSCVector class is a smart pointer to an SCVector specialization.">RefSCVector</a> *gradients_; <a name="l00086"></a>00086 <a name="l00087"></a>00087 <span class="keywordtype">void</span> get_disp(<span class="keywordtype">int</span> disp, <span class="keywordtype">int</span> &irrep, <span class="keywordtype">int</span> &index, <span class="keywordtype">double</span> &coef); <a name="l00088"></a>00088 <span class="keywordtype">void</span> do_hess_for_irrep(<span class="keywordtype">int</span> irrep, <a name="l00089"></a>00089 <span class="keyword">const</span> <a class="code" href="classsc_1_1RefSymmSCMatrix.html" title="The RefSymmSCMatrix class is a smart pointer to an SCSymmSCMatrix specialization...">RefSymmSCMatrix</a> &dhessian, <a name="l00090"></a>00090 <span class="keyword">const</span> <a class="code" href="classsc_1_1RefSymmSCMatrix.html" title="The RefSymmSCMatrix class is a smart pointer to an SCSymmSCMatrix specialization...">RefSymmSCMatrix</a> &xhessian); <a name="l00091"></a>00091 <span class="keywordtype">void</span> init(); <a name="l00092"></a>00092 <span class="keywordtype">void</span> restart(); <a name="l00093"></a>00093 <span class="keyword">public</span>: <a name="l00094"></a>00094 <a class="code" href="classsc_1_1FinDispMolecularHessian.html" title="Computes the molecular hessian by finite displacements of gradients.">FinDispMolecularHessian</a>(<span class="keyword">const</span> <a class="code" href="classsc_1_1Ref.html">Ref<MolecularEnergy></a>&); <a name="l00150"></a>00150 <a class="code" href="classsc_1_1FinDispMolecularHessian.html" title="Computes the molecular hessian by finite displacements of gradients.">FinDispMolecularHessian</a>(<span class="keyword">const</span> <a class="code" href="classsc_1_1Ref.html">Ref<KeyVal></a>&); <a name="l00151"></a>00151 <a class="code" href="classsc_1_1FinDispMolecularHessian.html" title="Computes the molecular hessian by finite displacements of gradients.">FinDispMolecularHessian</a>(<a class="code" href="classsc_1_1StateIn.html" title="Restores objects that derive from SavableState.">StateIn</a>&); <a name="l00152"></a>00152 ~<a class="code" href="classsc_1_1FinDispMolecularHessian.html" title="Computes the molecular hessian by finite displacements of gradients.">FinDispMolecularHessian</a>(); <a name="l00153"></a>00153 <span class="keywordtype">void</span> <a class="code" href="classsc_1_1FinDispMolecularHessian.html#19e094414cf542dd6b9f32de64550d62" title="Save the base classes (with save_data_state) and the members in the same order that...">save_data_state</a>(<a class="code" href="classsc_1_1StateOut.html" title="Serializes objects that derive from SavableState.">StateOut</a>&); <a name="l00154"></a>00154 <a name="l00157"></a>00157 <a class="code" href="classsc_1_1RefSymmSCMatrix.html" title="The RefSymmSCMatrix class is a smart pointer to an SCSymmSCMatrix specialization...">RefSymmSCMatrix</a> <a class="code" href="classsc_1_1FinDispMolecularHessian.html#4fa9f8984a873db4b913c4b683c4c2cd" title="These members are used to compute a cartesian hessian from gradients at finite displacements...">compute_hessian_from_gradients</a>(); <a name="l00158"></a>00158 <span class="keywordtype">int</span> ndisplace() <span class="keyword">const</span>; <a name="l00159"></a>00159 <span class="keywordtype">int</span> ndisplacements_done()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> ndisp_; } <a name="l00160"></a>00160 <a class="code" href="classsc_1_1RefSCMatrix.html" title="The RefSCMatrix class is a smart pointer to an SCMatrix specialization.">RefSCMatrix</a> displacements(<span class="keywordtype">int</span> irrep) <span class="keyword">const</span>; <a name="l00161"></a>00161 <span class="keywordtype">void</span> displace(<span class="keywordtype">int</span> disp); <a name="l00162"></a>00162 <span class="keywordtype">void</span> original_geometry(); <a name="l00163"></a>00163 <span class="keywordtype">void</span> set_gradient(<span class="keywordtype">int</span> disp, <span class="keyword">const</span> <a class="code" href="classsc_1_1RefSCVector.html" title="The RefSCVector class is a smart pointer to an SCVector specialization.">RefSCVector</a> &grad); <a name="l00164"></a>00164 <span class="keywordtype">void</span> checkpoint_displacements(<a class="code" href="classsc_1_1StateOut.html" title="Serializes objects that derive from SavableState.">StateOut</a>&); <a name="l00165"></a>00165 <span class="keywordtype">void</span> restore_displacements(<a class="code" href="classsc_1_1StateIn.html" title="Restores objects that derive from SavableState.">StateIn</a>&); <a name="l00166"></a>00166 <a name="l00169"></a>00169 <a class="code" href="classsc_1_1RefSymmSCMatrix.html" title="The RefSymmSCMatrix class is a smart pointer to an SCSymmSCMatrix specialization...">RefSymmSCMatrix</a> <a class="code" href="classsc_1_1FinDispMolecularHessian.html#78708af6cf2d2d266775d23ea8440a60" title="This returns the cartesian hessian.">cartesian_hessian</a>(); <a name="l00170"></a>00170 <a name="l00172"></a><a class="code" href="classsc_1_1FinDispMolecularHessian.html#8c13294589322b470db3bca924893996">00172</a> <span class="keywordtype">void</span> <a class="code" href="classsc_1_1FinDispMolecularHessian.html#8c13294589322b470db3bca924893996" title="Set checkpoint option.">set_checkpoint</a>(<span class="keywordtype">int</span> c) { checkpoint_ = c; } <a name="l00174"></a><a class="code" href="classsc_1_1FinDispMolecularHessian.html#e1ccfef51fc1947a9f8577c104909d3b">00174</a> <span class="keywordtype">int</span> <a class="code" href="classsc_1_1FinDispMolecularHessian.html#e1ccfef51fc1947a9f8577c104909d3b" title="Return the current value of the checkpoint option.">checkpoint</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> checkpoint_; } <a name="l00175"></a>00175 <a name="l00176"></a>00176 <span class="keywordtype">void</span> <a class="code" href="classsc_1_1FinDispMolecularHessian.html#c4f0642ee6f81ee1b74d0efc209dc05f" title="Some MolecularHessian specializations require a molecular energy object.">set_energy</a>(<span class="keyword">const</span> <a class="code" href="classsc_1_1Ref.html">Ref<MolecularEnergy></a> &<a class="code" href="classsc_1_1FinDispMolecularHessian.html#cb664c201de90c23436d34f1de6b11e4" title="This returns a MolecularEnergy object, if used by this specialization.">energy</a>); <a name="l00177"></a>00177 <a class="code" href="classsc_1_1MolecularEnergy.html" title="The MolecularEnergy abstract class inherits from the Function class.">MolecularEnergy</a>* <a class="code" href="classsc_1_1FinDispMolecularHessian.html#cb664c201de90c23436d34f1de6b11e4" title="This returns a MolecularEnergy object, if used by this specialization.">energy</a>() <span class="keyword">const</span>; <a name="l00178"></a>00178 <a name="l00179"></a>00179 <a class="code" href="classsc_1_1Ref.html">Ref<SCMatrixKit></a> matrixkit()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> mole_->matrixkit(); } <a name="l00180"></a>00180 RefSCDimension d3natom()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> mole_->moldim(); } <a name="l00181"></a>00181 }; <a name="l00182"></a>00182 <a name="l00183"></a>00183 } <a name="l00184"></a>00184 <a name="l00185"></a>00185 <span class="preprocessor">#endif</span> <a name="l00186"></a>00186 <span class="preprocessor"></span> <a name="l00187"></a>00187 <span class="comment">// Local Variables:</span> <a name="l00188"></a>00188 <span class="comment">// mode: c++</span> <a name="l00189"></a>00189 <span class="comment">// c-file-style: "CLJ"</span> <a name="l00190"></a>00190 <span class="comment">// End:</span> </pre></div></div> <hr> <address> <small> Generated at Wed Oct 14 14:12:09 2009 for <a href="http://www.mpqc.org">MPQC</a> 2.3.1 using the documentation package <a href="http://www.doxygen.org">Doxygen</a> 1.5.9. </small> </address> </body> </html>