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 #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
00404
00405
00406