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_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
00041 class FinDispMolecularHessian: public MolecularHessian {
00042 protected:
00043 Ref<MolecularEnergy> mole_;
00044
00045
00046 Ref<PointGroup> displacement_point_group_;
00047
00048 Ref<PointGroup> original_point_group_;
00049
00050
00051 RefSCVector original_geometry_;
00052
00053 double disp_;
00054
00055 double accuracy_;
00056
00057 int ndisp_;
00058
00059 int nirrep_;
00060
00061 int restart_;
00062
00063 char *restart_file_;
00064
00065 int checkpoint_;
00066
00067 char *checkpoint_file_;
00068
00069 int only_totally_symmetric_;
00070
00071
00072 int eliminate_cubic_terms_;
00073
00074
00075 int do_null_displacement_;
00076
00077 int debug_;
00078
00079 RefSCMatrix symbasis_;
00080
00081 RefSCVector *gradients_;
00082
00083 void get_disp(int disp, int &irrep, int &index, double &coef);
00084 void do_hess_for_irrep(int irrep,
00085 const RefSymmSCMatrix &dhessian,
00086 const RefSymmSCMatrix &xhessian);
00087 void init();
00088 void restart();
00089 public:
00090 FinDispMolecularHessian(const Ref<MolecularEnergy>&);
00091 FinDispMolecularHessian(const Ref<KeyVal>&);
00092 FinDispMolecularHessian(StateIn&);
00093 ~FinDispMolecularHessian();
00094 void save_data_state(StateOut&);
00095
00098 RefSymmSCMatrix compute_hessian_from_gradients();
00099 int ndisplace() const;
00100 int ndisplacements_done() const { return ndisp_; }
00101 RefSCMatrix displacements(int irrep) const;
00102 void displace(int disp);
00103 void original_geometry();
00104 void set_gradient(int disp, const RefSCVector &grad);
00105 void checkpoint_displacements(StateOut&);
00106 void restore_displacements(StateIn&);
00107
00110 RefSymmSCMatrix cartesian_hessian();
00111
00113 void set_checkpoint(int c) { checkpoint_ = c; }
00115 int checkpoint() const { return checkpoint_; }
00116
00117 void set_energy(const Ref<MolecularEnergy> &energy);
00118 MolecularEnergy* energy() const;
00119
00120 Ref<SCMatrixKit> matrixkit() const { return mole_->matrixkit(); }
00121 RefSCDimension d3natom() const { return mole_->moldim(); }
00122 };
00123
00124 #endif
00125
00126
00127
00128
00129