Main Page   Class Hierarchy   Compound List   File List   Compound Members   Related Pages  

gaussbas.h

00001 //
00002 // gaussbas.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_qc_basis_gaussbas_h
00029 #define _chemistry_qc_basis_gaussbas_h
00030 
00031 #ifdef __GNUC__
00032 #pragma interface
00033 #endif
00034 
00035 #include <iostream>
00036 
00037 #include <util/state/state.h>
00038 #include <util/state/array.h>
00039 #include <util/keyval/keyval.h>
00040 #include <math/scmat/matrix.h>
00041 #include <math/scmat/vector3.h>
00042 #include <chemistry/molecule/molecule.h>
00043 
00044 class GaussianShell;
00045 class BasisFileSet;
00046 class Integral;
00047 
00048 class CartesianIter;
00049 class SphericalTransformIter;
00050 
00112 class GaussianBasisSet: public SavableState
00113 {
00114   private:
00115     char* name_;
00116     GaussianShell** shell_;
00117     Arrayint shell_to_function_;
00118     Arrayint function_to_shell_;
00119 
00120     Ref<Molecule> molecule_;
00121 
00122     Ref<SCMatrixKit> matrixkit_;
00123     Ref<SCMatrixKit> so_matrixkit_;
00124     RefSCDimension basisdim_;
00125 
00126     int ncenter_;
00127     SSBArrayint shell_to_center_;
00128     SSBArrayint center_to_shell_;
00129     SSBArrayint center_to_nshell_;
00130     SSBArrayint center_to_nbasis_;
00131 
00132     int nshell_;
00133     int nbasis_;
00134     int nprim_;
00135 
00136     void recursively_get_shell(int&,Ref<KeyVal>&,
00137                                const char*,const char*,BasisFileSet&,
00138                                int,int,int);
00139 
00140     void init(Ref<Molecule>&,Ref<KeyVal>&,
00141               BasisFileSet&,
00142               int have_userkeyval,
00143               int pure);
00144     void init2(int skip_ghosts=0);
00145     
00146   protected:
00147     GaussianBasisSet(const GaussianBasisSet&);
00148     virtual void set_matrixkit(const Ref<SCMatrixKit>&);
00149     
00150   public:
00152     class ValueData {
00153       protected:
00154         CartesianIter **civec_;
00155         SphericalTransformIter **sivec_;
00156         int maxam_;
00157       public:
00158         ValueData(const Ref<GaussianBasisSet> &, const Ref<Integral> &);
00159         ~ValueData();
00160         CartesianIter **civec() { return civec_; }
00161         SphericalTransformIter **sivec() { return sivec_; }
00162     };
00163 
00274     GaussianBasisSet(const Ref<KeyVal>&);
00275     GaussianBasisSet(StateIn&);
00276     virtual ~GaussianBasisSet();
00277 
00278     void save_data_state(StateOut&);
00279 
00281     const char* name() const { return name_; }
00282 
00284     Ref<Molecule> molecule() const { return molecule_; }
00286     Ref<SCMatrixKit> matrixkit() { return matrixkit_; }
00288     Ref<SCMatrixKit> so_matrixkit() { return so_matrixkit_; }
00290     RefSCDimension basisdim() { return basisdim_; }
00291 
00293     int ncenter() const;
00295     int nshell() const { return nshell_; }
00297     int nshell_on_center(int icenter) const;
00300     int shell_on_center(int icenter, int shell) const;
00302     int shell_to_center(int ishell) const { return shell_to_center_(ishell); }
00304     int nbasis() const { return nbasis_; }
00306     int nbasis_on_center(int icenter) const;
00308     int nprimitive() const { return nprim_; }
00309 
00311     int max_nfunction_in_shell() const;
00314     int max_ncartesian_in_shell(int aminc=0) const;
00316     int max_angular_momentum() const;
00318     int max_ncontraction() const;
00321     int max_am_for_contraction(int con) const;
00323     int max_cartesian() const;
00324 
00326     int shell_to_function(int i) const { return shell_to_function_(i); }
00328     int function_to_shell(int i) const;
00329 
00331     const GaussianShell& operator()(int i) const { return *shell_[i]; }
00333     GaussianShell& operator()(int i) { return *shell_[i]; }
00335     const GaussianShell& operator[](int i) const { return *shell_[i]; }
00337     GaussianShell& operator[](int i) { return *shell_[i]; }
00339     const GaussianShell& shell(int i) const { return *shell_[i]; }
00341     GaussianShell& shell(int i) { return *shell_[i]; }
00342 
00344     const GaussianShell& operator()(int icenter,int ishell) const;
00346     GaussianShell& operator()(int icenter,int ishell);
00348     const GaussianShell& shell(int i,int j) const { return operator()(i,j); }
00350     GaussianShell& shell(int i,int j) { return operator()(i,j); }
00351 
00354     double r(int icenter,int xyz) const;
00355     
00358     int values(const SCVector3& r, ValueData *, double* basis_values) const;
00363     int grad_values(const SCVector3& r, ValueData *,
00364                     double*g_values,double* basis_values=0) const;
00369     int hessian_values(const SCVector3& r, ValueData *, double *h_values,
00370                        double*g_values=0,double* basis_values=0) const;
00373     int shell_values(const SCVector3& r, int sh,
00374                      ValueData *, double* basis_values) const;
00378     int grad_shell_values(const SCVector3& r, int sh,
00379                           ValueData *,
00380                           double*g_values, double* basis_values=0) const;
00384     int hessian_shell_values(const SCVector3& r, int sh,
00385                        ValueData *, double *h_values,
00386                        double*g_values=0,double* basis_values=0) const;
00387 
00389     int equiv(const Ref<GaussianBasisSet> &b);
00390 
00392     void print_brief(std::ostream& =ExEnv::out()) const;
00394     void print(std::ostream& =ExEnv::out()) const;
00395 };
00396 
00397 
00398 
00399 #endif
00400 
00401 // Local Variables:
00402 // mode: c++
00403 // c-file-style: "CLJ"
00404 // End:

Generated at Thu Oct 4 18:08:44 2001 for MPQC 2.0.0 using the documentation package Doxygen 1.2.5.