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

# 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
    00044 class MolecularHessian: virtual public SavableState {
    00045   protected:
    00046     Ref<Molecule> mol_;
    00047     RefSCDimension d3natom_;
    00048     Ref<SCMatrixKit> matrixkit_;
    00049   public:
    00050     MolecularHessian();
    00051     MolecularHessian(const Ref<KeyVal>&);
    00052     MolecularHessian(StateIn&);
    00053     ~MolecularHessian();
    00054     void save_data_state(StateOut&);
    00055
    00056     RefSCDimension d3natom();
    00057     Ref<SCMatrixKit> matrixkit() const { return matrixkit_; }
    00058
    00059     // Return the cartesian hessian.
    00060     virtual RefSymmSCMatrix cartesian_hessian() = 0;
    00061
    00062     // Some MolecularHessian specializations require a molecular
    00063     //energy object.  The default implementations of these ignore
    00064     //the argument or return null.
    00065     virtual void set_energy(const Ref<MolecularEnergy> &energy);
    00066     virtual MolecularEnergy* energy() const;
    00067
    00068     // Find transformation matrix from cartesian to symmetry
    00069     // coordinates.
    00070     static RefSCMatrix cartesian_to_symmetry(const Ref<Molecule> &m,
    00071                                              Ref<PointGroup> pg = 0,
    00072                                              Ref<SCMatrixKit> kit = 0);
    00073
    00075     static void write_cartesian_hessian(const char *filename,
    00076                                         const Ref<Molecule> &m,
    00077                                         const RefSymmSCMatrix &hess);
    00078
    00080     static void read_cartesian_hessian(const char *filename,
    00081                                        const Ref<Molecule> &m,
    00082                                        const RefSymmSCMatrix &hess);
    00083 };
    00084
    00085
    00086 class ReadMolecularHessian: public MolecularHessian {
    00087   protected:
    00088     char *filename_;
    00089   public:
    00090     ReadMolecularHessian(const Ref<KeyVal>&);
    00091     ReadMolecularHessian(StateIn&);
    00092     ~ReadMolecularHessian();
    00093     void save_data_state(StateOut&);
    00094
    00095     RefSymmSCMatrix cartesian_hessian();
    00096 };
    00097
    00098 class GuessMolecularHessian: public MolecularHessian {
    00099   protected:
    00100     Ref<MolecularCoor> coor_;
    00101   public:
    00102     GuessMolecularHessian(const Ref<KeyVal>&);
    00103     GuessMolecularHessian(StateIn&);
    00104     ~GuessMolecularHessian();
    00105     void save_data_state(StateOut&);
    00106
    00107     RefSymmSCMatrix cartesian_hessian();
    00108 };
    00109
    00110 class DiagMolecularHessian: public MolecularHessian {
    00111   protected:
    00112     double diag_;
    00113   public:
    00114     DiagMolecularHessian(const Ref<KeyVal>&);
    00115     DiagMolecularHessian(StateIn&);
    00116     ~DiagMolecularHessian();
    00117     void save_data_state(StateOut&);
    00118
    00119     RefSymmSCMatrix cartesian_hessian();
    00120 };
    00121
    00122 }
    00123
    00124 #endif
    00125
    00126 // Local Variables:
    00127 // mode: c++
    00128 // c-file-style: "CLJ"
    00129 // End: