00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
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 class MolecularEnergy;
00041
00042 class MolecularHessian: virtual public SavableState {
00043 protected:
00044 Ref<Molecule> mol_;
00045 RefSCDimension d3natom_;
00046 Ref<SCMatrixKit> matrixkit_;
00047 public:
00048 MolecularHessian();
00049 MolecularHessian(const Ref<KeyVal>&);
00050 MolecularHessian(StateIn&);
00051 ~MolecularHessian();
00052 void save_data_state(StateOut&);
00053
00054 RefSCDimension d3natom();
00055 Ref<SCMatrixKit> matrixkit() const { return matrixkit_; }
00056
00057
00058 virtual RefSymmSCMatrix cartesian_hessian() = 0;
00059
00060
00061
00062
00063 virtual void set_energy(const Ref<MolecularEnergy> &energy);
00064 virtual MolecularEnergy* energy() const;
00065
00066
00067
00068 static RefSCMatrix cartesian_to_symmetry(const Ref<Molecule> &m,
00069 Ref<PointGroup> pg = 0,
00070 Ref<SCMatrixKit> kit = 0);
00071
00073 static void write_cartesian_hessian(const char *filename,
00074 const Ref<Molecule> &m,
00075 const RefSymmSCMatrix &hess);
00076
00078 static void read_cartesian_hessian(const char *filename,
00079 const Ref<Molecule> &m,
00080 const RefSymmSCMatrix &hess);
00081 };
00082
00083
00084 class ReadMolecularHessian: public MolecularHessian {
00085 protected:
00086 char *filename_;
00087 public:
00088 ReadMolecularHessian(const Ref<KeyVal>&);
00089 ReadMolecularHessian(StateIn&);
00090 ~ReadMolecularHessian();
00091 void save_data_state(StateOut&);
00092
00093 RefSymmSCMatrix cartesian_hessian();
00094 };
00095
00096 class GuessMolecularHessian: public MolecularHessian {
00097 protected:
00098 Ref<MolecularCoor> coor_;
00099 public:
00100 GuessMolecularHessian(const Ref<KeyVal>&);
00101 GuessMolecularHessian(StateIn&);
00102 ~GuessMolecularHessian();
00103 void save_data_state(StateOut&);
00104
00105 RefSymmSCMatrix cartesian_hessian();
00106 };
00107
00108 class DiagMolecularHessian: public MolecularHessian {
00109 protected:
00110 double diag_;
00111 public:
00112 DiagMolecularHessian(const Ref<KeyVal>&);
00113 DiagMolecularHessian(StateIn&);
00114 ~DiagMolecularHessian();
00115 void save_data_state(StateOut&);
00116
00117 RefSymmSCMatrix cartesian_hessian();
00118 };
00119
00120 #endif
00121
00122
00123
00124
00125