|
gaussbas.h00001 // 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 namespace sc { 00045 00046 class GaussianShell; 00047 class BasisFileSet; 00048 class Integral; 00049 00050 class CartesianIter; 00051 class SphericalTransformIter; 00052 00114 class GaussianBasisSet: public SavableState 00115 { 00116 private: 00117 char* name_; 00118 GaussianShell** shell_; 00119 Arrayint shell_to_function_; 00120 Arrayint function_to_shell_; 00121 00122 Ref<Molecule> molecule_; 00123 00124 Ref<SCMatrixKit> matrixkit_; 00125 Ref<SCMatrixKit> so_matrixkit_; 00126 RefSCDimension basisdim_; 00127 00128 int ncenter_; 00129 SSBArrayint shell_to_center_; 00130 SSBArrayint center_to_shell_; 00131 SSBArrayint center_to_nshell_; 00132 SSBArrayint center_to_nbasis_; 00133 00134 int nshell_; 00135 int nbasis_; 00136 int nprim_; 00137 00138 void recursively_get_shell(int&,Ref<KeyVal>&, 00139 const char*,const char*,BasisFileSet&, 00140 int,int,int); 00141 00142 void init(Ref<Molecule>&,Ref<KeyVal>&, 00143 BasisFileSet&, 00144 int have_userkeyval, 00145 int pure); 00146 void init2(int skip_ghosts=0); 00147 00148 protected: 00149 GaussianBasisSet(const GaussianBasisSet&); 00150 virtual void set_matrixkit(const Ref<SCMatrixKit>&); 00151 00152 public: 00154 class ValueData { 00155 protected: 00156 CartesianIter **civec_; 00157 SphericalTransformIter **sivec_; 00158 int maxam_; 00159 public: 00160 ValueData(const Ref<GaussianBasisSet> &, const Ref<Integral> &); 00161 ~ValueData(); 00162 CartesianIter **civec() { return civec_; } 00163 SphericalTransformIter **sivec() { return sivec_; } 00164 }; 00165 00276 GaussianBasisSet(const Ref<KeyVal>&); 00277 GaussianBasisSet(StateIn&); 00278 virtual ~GaussianBasisSet(); 00279 00280 void save_data_state(StateOut&); 00281 00283 const char* name() const { return name_; } 00284 00286 Ref<Molecule> molecule() const { return molecule_; } 00288 Ref<SCMatrixKit> matrixkit() { return matrixkit_; } 00290 Ref<SCMatrixKit> so_matrixkit() { return so_matrixkit_; } 00292 RefSCDimension basisdim() { return basisdim_; } 00293 00295 int ncenter() const; 00297 int nshell() const { return nshell_; } 00299 int nshell_on_center(int icenter) const; 00302 int shell_on_center(int icenter, int shell) const; 00304 int shell_to_center(int ishell) const { return shell_to_center_(ishell); } 00306 int nbasis() const { return nbasis_; } 00308 int nbasis_on_center(int icenter) const; 00310 int nprimitive() const { return nprim_; } 00311 00313 int max_nfunction_in_shell() const; 00316 int max_ncartesian_in_shell(int aminc=0) const; 00318 int max_angular_momentum() const; 00320 int max_ncontraction() const; 00323 int max_am_for_contraction(int con) const; 00325 int max_cartesian() const; 00326 00328 int shell_to_function(int i) const { return shell_to_function_(i); } 00330 int function_to_shell(int i) const; 00331 00333 const GaussianShell& operator()(int i) const { return *shell_[i]; } 00335 GaussianShell& operator()(int i) { return *shell_[i]; } 00337 const GaussianShell& operator[](int i) const { return *shell_[i]; } 00339 GaussianShell& operator[](int i) { return *shell_[i]; } 00341 const GaussianShell& shell(int i) const { return *shell_[i]; } 00343 GaussianShell& shell(int i) { return *shell_[i]; } 00344 00346 const GaussianShell& operator()(int icenter,int ishell) const; 00348 GaussianShell& operator()(int icenter,int ishell); 00350 const GaussianShell& shell(int i,int j) const { return operator()(i,j); } 00352 GaussianShell& shell(int i,int j) { return operator()(i,j); } 00353 00356 double r(int icenter,int xyz) const; 00357 00360 int values(const SCVector3& r, ValueData *, double* basis_values) const; 00365 int grad_values(const SCVector3& r, ValueData *, 00366 double*g_values,double* basis_values=0) const; 00371 int hessian_values(const SCVector3& r, ValueData *, double *h_values, 00372 double*g_values=0,double* basis_values=0) const; 00375 int shell_values(const SCVector3& r, int sh, 00376 ValueData *, double* basis_values) const; 00380 int grad_shell_values(const SCVector3& r, int sh, 00381 ValueData *, 00382 double*g_values, double* basis_values=0) const; 00386 int hessian_shell_values(const SCVector3& r, int sh, 00387 ValueData *, double *h_values, 00388 double*g_values=0,double* basis_values=0) const; 00389 00391 int equiv(const Ref<GaussianBasisSet> &b); 00392 00394 void print_brief(std::ostream& =ExEnv::out0()) const; 00396 void print(std::ostream& =ExEnv::out0()) const; 00397 }; 00398 00399 } 00400 00401 #endif 00402 00403 // Local Variables: 00404 // mode: c++ 00405 // c-file-style: "CLJ" 00406 // End: Generated at Fri Jan 10 08:14:08 2003 for MPQC 2.1.3 using the documentation package Doxygen 1.2.14. |