Google

Main Page   Class Hierarchy   Compound List   File List   Compound Members   Related Pages  

fdhess.h

00001 //
00002 // fdhess.h
00003 //
00004 // Copyright (C) 1997 Limit Point Systems, Inc.
00005 //
00006 // Author: Curtis Janssen <cljanss@limitpt.com>
00007 // Maintainer: LPS
00008 //
00009 // This file is part of the SC Toolkit.
00010 //
00011 // The SC Toolkit is free software; you can redistribute it and/or modify
00012 // it under the terms of the GNU Library General Public License as published by
00013 // the Free Software Foundation; either version 2, or (at your option)
00014 // any later version.
00015 //
00016 // The SC Toolkit is distributed in the hope that it will be useful,
00017 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00018 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019 // GNU Library General Public License for more details.
00020 //
00021 // You should have received a copy of the GNU Library General Public License
00022 // along with the SC Toolkit; see the file COPYING.LIB.  If not, write to
00023 // the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
00024 //
00025 // The U.S. Government is granted a limited license as per AL 91-7.
00026 //
00027 
00028 #ifndef _chemistry_molecule_fdhess_h
00029 #define _chemistry_molecule_fdhess_h
00030 
00031 #ifdef __GNUC__
00032 #pragma interface
00033 #endif
00034 
00035 #include <iostream>
00036 
00037 #include <chemistry/molecule/hess.h>
00038 #include <chemistry/molecule/energy.h>
00039 
00040 namespace sc {
00041 
00043 class FinDispMolecularHessian: public MolecularHessian {
00044   protected:
00045     Ref<MolecularEnergy> mole_;
00046     // In case molecule must be given in lower symmetry, its actual
00047     // symmetry and the symmetry used to compute displacements is this
00048     Ref<PointGroup> displacement_point_group_;
00049     // The molecule's original point group for restoration at the end.
00050     Ref<PointGroup> original_point_group_;
00051     // The molecule's original geometry for restoration at the end and
00052     //computing displacements.
00053     RefSCVector original_geometry_;
00054     // the cartesian displacement size in bohr
00055     double disp_;
00056     // the accuracy for gradient calculations
00057     double accuracy_;
00058     // the number of completed displacements
00059     int ndisp_;
00060     // the number of irreps in the displacement point group
00061     int nirrep_;
00062     // whether or not to attempt a restart
00063     int restart_;
00064     // the name of the restart file
00065     char *restart_file_;
00066     // whether or not to checkpoint
00067     int checkpoint_;
00068     // the name of the checkpoint file
00069     char *checkpoint_file_;
00070     // only do the totally symmetric displacements
00071     int only_totally_symmetric_;
00072     // eliminate the cubic terms by doing an extra displacement for
00073     //each of the totally symmetry coordinates
00074     int eliminate_cubic_terms_;
00075     // use the gradient at the initial geometry to remove first order terms
00076     // (important if not at equilibrium geometry)
00077     int do_null_displacement_;
00078     // print flag
00079     int debug_;
00080     // a basis for the symmetrized cartesian coordinates
00081     RefSCMatrix symbasis_;
00082     // the gradients at each of the displacements
00083     RefSCVector *gradients_;
00084 
00085     void get_disp(int disp, int &irrep, int &index, double &coef);
00086     void do_hess_for_irrep(int irrep,
00087                            const RefSymmSCMatrix &dhessian,
00088                            const RefSymmSCMatrix &xhessian);
00089     void init();
00090     void restart();
00091   public:
00092     FinDispMolecularHessian(const Ref<MolecularEnergy>&);
00093     FinDispMolecularHessian(const Ref<KeyVal>&);
00094     FinDispMolecularHessian(StateIn&);
00095     ~FinDispMolecularHessian();
00096     void save_data_state(StateOut&);
00097 
00100     RefSymmSCMatrix compute_hessian_from_gradients();
00101     int ndisplace() const;
00102     int ndisplacements_done() const { return ndisp_; }
00103     RefSCMatrix displacements(int irrep) const;
00104     void displace(int disp);
00105     void original_geometry();
00106     void set_gradient(int disp, const RefSCVector &grad);
00107     void checkpoint_displacements(StateOut&);
00108     void restore_displacements(StateIn&);
00109 
00112     RefSymmSCMatrix cartesian_hessian();
00113 
00115     void set_checkpoint(int c) { checkpoint_ = c; }
00117     int checkpoint() const { return checkpoint_; }
00118 
00119     void set_energy(const Ref<MolecularEnergy> &energy);
00120     MolecularEnergy* energy() const;
00121 
00122     Ref<SCMatrixKit> matrixkit() const { return mole_->matrixkit(); }
00123     RefSCDimension d3natom() const { return mole_->moldim(); }
00124 };
00125 
00126 }
00127 
00128 #endif
00129 
00130 // Local Variables:
00131 // mode: c++
00132 // c-file-style: "CLJ"
00133 // End:

Generated at Fri Jan 10 08:14:08 2003 for MPQC 2.1.3 using the documentation package Doxygen 1.2.14.