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 #ifdef __GNUC__
00029 #pragma interface
00030 #endif
00031
00032 #ifndef _chemistry_molecule_molfreq_h
00033 #define _chemistry_molecule_molfreq_h
00034
00035 #include <iostream>
00036 #include <math/scmat/matrix.h>
00037 #include <util/render/animate.h>
00038 #include <chemistry/molecule/energy.h>
00039 #include <chemistry/molecule/molrender.h>
00040 #include <chemistry/molecule/coor.h>
00041
00042 namespace sc {
00043
00044 class MolFreqAnimate;
00045
00048 class MolecularFrequencies: public SavableState {
00049 private:
00050 Ref<Molecule> mol_;
00051 Ref<PointGroup> pg_;
00052 int debug_;
00053 int nirrep_;
00054
00055 int *nfreq_;
00056
00057 double **freq_;
00058
00059 Ref<SCMatrixKit> kit_;
00060 Ref<SCMatrixKit> symkit_;
00061
00062
00063 RefSCDimension disym_;
00064
00065 RefSCDimension d3natom_;
00066
00067 RefSCDimension bd3natom_;
00068
00069 RefSCMatrix normco_;
00070
00071 void do_freq_for_irrep(int irrep,
00072 const RefDiagSCMatrix &m,
00073 const RefSymmSCMatrix &dhessian,
00074 const RefSCMatrix &dtranst);
00075 public:
00102 MolecularFrequencies(const Ref<KeyVal> &);
00103 MolecularFrequencies(StateIn &);
00104 ~MolecularFrequencies();
00105 void save_data_state(StateOut&);
00106
00108 Ref<Molecule> molecule() const { return mol_; }
00109
00111 void compute_frequencies(const RefSymmSCMatrix &xhessian);
00112
00114 int nirrep() const { return nirrep_; }
00115
00118 int nfreq(int irrep) const { return nfreq_[irrep]; }
00119
00122 double freq(int irrep, int i) const { return freq_[irrep][i]; }
00123
00126 RefSCMatrix normal_coordinates() { return normco_; }
00127
00130 void thermochemistry(int degeneracy, double temp=298.15, double pres=1.0);
00131
00132 void animate(const Ref<Render>&, const Ref<MolFreqAnimate>&);
00133
00134 Ref<SCMatrixKit> matrixkit() { return kit_; }
00135 Ref<SCMatrixKit> symmatrixkit() { return symkit_; }
00136 };
00137
00138
00139
00140 class MolFreqAnimate: public AnimatedObject {
00141 private:
00142 Ref<RenderedMolecule> renmol_;
00143 Ref<MolecularFrequencies> molfreq_;
00144 Ref<MolecularEnergy> dependent_mole_;
00145 int irrep_;
00146 int mode_;
00147 int nframe_;
00148 double disp_;
00149 public:
00150 MolFreqAnimate(const Ref<KeyVal> &);
00151 virtual ~MolFreqAnimate();
00152
00153 void set_mode(int i, int j) { irrep_ = i; mode_ = j; }
00154 int nobject();
00155 Ref<RenderedObject> object(int iobject);
00156 };
00157
00158 }
00159
00160 #endif
00161
00162
00163
00164
00165