# hess.h

    00001 //
    00002 // hess.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_hess_h
    00029 #define _chemistry_molecule_hess_h
    00030
    00031 #ifdef __GNUC__
    00032 #pragma interface
    00033 #endif
    00034
    00035 #include <iostream>
    00036
    00037 #include <chemistry/molecule/molecule.h>
    00038 #include <chemistry/molecule/coor.h>
    00039
    00040 namespace sc {
    00041
    00042 class MolecularEnergy;
    00043
    00047 class MolecularHessian: virtual public SavableState {
    00048   protected:
    00049     Ref<Molecule> mol_;
    00050     RefSCDimension d3natom_;
    00051     Ref<SCMatrixKit> matrixkit_;
    00052   public:
    00053     MolecularHessian();
    00063     MolecularHessian(const Ref<KeyVal>&);
    00064     MolecularHessian(StateIn&);
    00065     ~MolecularHessian();
    00066     void save_data_state(StateOut&);
    00067
    00068     RefSCDimension d3natom();
    00069     Ref<SCMatrixKit> matrixkit() const { return matrixkit_; }
    00070
    00072     virtual RefSymmSCMatrix cartesian_hessian() = 0;
    00073
    00077     virtual void set_energy(const Ref<MolecularEnergy> &energy);
    00080     virtual MolecularEnergy* energy() const;
    00081
    00084     static RefSCMatrix cartesian_to_symmetry(const Ref<Molecule> &m,
    00085                                              Ref<PointGroup> pg = 0,
    00086                                              Ref<SCMatrixKit> kit = 0);
    00087
    00089     static void write_cartesian_hessian(const char *filename,
    00090                                         const Ref<Molecule> &m,
    00091                                         const RefSymmSCMatrix &hess);
    00092
    00094     static void read_cartesian_hessian(const char *filename,
    00095                                        const Ref<Molecule> &m,
    00096                                        const RefSymmSCMatrix &hess);
    00097 };
    00098
    00099
    00102 class ReadMolecularHessian: public MolecularHessian {
    00103   protected:
    00104     char *filename_;
    00105   public:
    00119     ReadMolecularHessian(const Ref<KeyVal>&);
    00120     ReadMolecularHessian(StateIn&);
    00121     ~ReadMolecularHessian();
    00122     void save_data_state(StateOut&);
    00123
    00125     RefSymmSCMatrix cartesian_hessian();
    00126 };
    00127
    00130 class GuessMolecularHessian: public MolecularHessian {
    00131   protected:
    00132     Ref<MolecularCoor> coor_;
    00133   public:
    00148     GuessMolecularHessian(const Ref<KeyVal>&);
    00149     GuessMolecularHessian(StateIn&);
    00150     ~GuessMolecularHessian();
    00151     void save_data_state(StateOut&);
    00152
    00154     RefSymmSCMatrix cartesian_hessian();
    00155 };
    00156
    00159 class DiagMolecularHessian: public MolecularHessian {
    00160   protected:
    00161     double diag_;
    00162   public:
    00175     DiagMolecularHessian(const Ref<KeyVal>&);
    00176     DiagMolecularHessian(StateIn&);
    00177     ~DiagMolecularHessian();
    00178     void save_data_state(StateOut&);
    00179
    00181     RefSymmSCMatrix cartesian_hessian();
    00182 };
    00183
    00184 }
    00185
    00186 #endif
    00187
    00188 // Local Variables:
    00189 // mode: c++
    00190 // c-file-style: "CLJ"
    00191 // End: