|
MPQC
3.0.0-alpha
|
00001 // 00002 // molfreq.h 00003 // 00004 // Copyright (C) 1996 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_molfreq_h 00029 #define _chemistry_molecule_molfreq_h 00030 00031 #include <iostream> 00032 #include <math/scmat/matrix.h> 00033 #include <util/render/animate.h> 00034 #include <chemistry/molecule/energy.h> 00035 #include <chemistry/molecule/molrender.h> 00036 #include <chemistry/molecule/coor.h> 00037 00038 namespace sc { 00039 00040 class MolFreqAnimate; 00041 00044 class MolecularFrequencies: public SavableState { 00045 private: 00046 Ref<Molecule> mol_; 00047 Ref<PointGroup> pg_; 00048 int debug_; 00049 int nirrep_; 00050 // the number of frequencies per irrep 00051 int *nfreq_; 00052 // the frequencies for each irrep 00053 double **freq_; 00054 00055 Ref<SCMatrixKit> kit_; 00056 Ref<SCMatrixKit> symkit_; 00057 00058 // the symmetry blocked dimension for internal motions 00059 RefSCDimension disym_; 00060 // the cartesian dimension 00061 RefSCDimension d3natom_; 00062 // the blocked cartesian dimension 00063 RefSCDimension bd3natom_; 00064 // the normal coordinates 00065 RefSCMatrix normco_; 00066 00067 void do_freq_for_irrep(int irrep, 00068 const RefDiagSCMatrix &m, 00069 const RefSymmSCMatrix &dhessian, 00070 const RefSCMatrix &dtranst); 00071 public: 00091 MolecularFrequencies(const Ref<KeyVal> &); 00092 MolecularFrequencies(const Ref<Molecule>&); 00093 MolecularFrequencies(StateIn &); 00094 ~MolecularFrequencies(); 00095 void save_data_state(StateOut&); 00096 00098 Ref<Molecule> molecule() const { return mol_; } 00099 00101 void compute_frequencies(const RefSymmSCMatrix &xhessian); 00102 00104 int nirrep() const { return nirrep_; } 00105 00108 int nfreq(int irrep) const { return nfreq_[irrep]; } 00109 00112 double freq(int irrep, int i) const { return freq_[irrep][i]; } 00113 00116 RefSCMatrix normal_coordinates() { return normco_; } 00117 00120 void thermochemistry(int degeneracy, double temp=298.15, double pres=1.0); 00121 00122 void animate(const Ref<Render>&, const Ref<MolFreqAnimate>&); 00123 00124 Ref<SCMatrixKit> matrixkit() { return kit_; } 00125 Ref<SCMatrixKit> symmatrixkit() { return symkit_; } 00126 }; 00127 00128 00129 00130 class MolFreqAnimate: public AnimatedObject { 00131 private: 00132 Ref<RenderedMolecule> renmol_; 00133 Ref<MolecularFrequencies> molfreq_; 00134 Ref<MolecularEnergy> dependent_mole_; 00135 int irrep_; 00136 int mode_; 00137 int nframe_; 00138 double disp_; 00139 public: 00140 MolFreqAnimate(const Ref<KeyVal> &); 00141 virtual ~MolFreqAnimate(); 00142 00143 void set_mode(int i, int j) { irrep_ = i; mode_ = j; } 00144 int nobject(); 00145 Ref<RenderedObject> object(int iobject); 00146 }; 00147 00148 } 00149 00150 #endif 00151 00152 // Local Variables: 00153 // mode: c++ 00154 // c-file-style: "CLJ" 00155 // End: