- Main Page
- Related Pages
- Classes
- Files

- File List

# molfreq.h

    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 #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     // the number of frequencies per irrep
    00055     int *nfreq_;
    00056     // the frequencies for each irrep
    00057     double **freq_;
    00058
    00059     Ref<SCMatrixKit> kit_;
    00060     Ref<SCMatrixKit> symkit_;
    00061
    00062     // the symmetry blocked dimension for internal motions
    00063     RefSCDimension disym_;
    00064     // the cartesian dimension
    00065     RefSCDimension d3natom_;
    00066     // the blocked cartesian dimension
    00067     RefSCDimension bd3natom_;
    00068     // the normal coordinates
    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 // Local Variables:
    00163 // mode: c++
    00164 // c-file-style: "CLJ"
    00165 // End: