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_gaussshell_h
00029 #define _chemistry_qc_basis_gaussshell_h
00030
00031 #ifdef __GNUC__
00032 #pragma interface
00033 #endif
00034
00035 #include <iostream>
00036 #include <util/state/state.h>
00037 #include <math/scmat/vector3.h>
00038 #include <util/keyval/keyval.h>
00039
00040 namespace sc {
00041
00042 class CartesianIter;
00043 class SphericalTransformIter;
00044 class Integral;
00045
00047 class GaussianShell: public SavableState
00048 {
00049 public:
00050 enum PrimitiveType { Normalized, Unnormalized };
00051 enum GaussianType { Cartesian, Pure };
00052 private:
00053 int nprim;
00054 int ncon;
00055 int* l;
00056 int* puream;
00057 double* exp;
00058 double** coef;
00059
00060
00061 int nfunc;
00062 int min_am_;
00063 int max_am_;
00064 int ncart_;
00065 int has_pure_;
00066 int* contr_to_func_;
00067 int* func_to_contr_;
00068 void init_computed_data();
00069
00070 double shell_normalization(int);
00071 void convert_coef();
00072 void normalize_shell();
00073 PrimitiveType keyval_init(const Ref<KeyVal>&,int,int);
00074 int test_monobound(double &r, double &bound) const;
00075 public:
00076
00077 static const char* amtypes;
00078 static const char* AMTYPES;
00079
00100 GaussianShell(
00101 int ncn,
00102 int nprm,
00103 double* e,
00104 int* am,
00105 int* pure,
00106 double** c,
00107 PrimitiveType pt = GaussianShell::Normalized,
00108 bool do_normalize_shell = true);
00113 GaussianShell(
00114 int ncn,
00115 int nprm,
00116 double* e,
00117 int* am,
00118 GaussianType pure,
00119 double** c,
00120 PrimitiveType pt = GaussianShell::Normalized);
00122 GaussianShell(const Ref<KeyVal>&);
00124 GaussianShell(StateIn&);
00128 GaussianShell(const Ref<KeyVal>&,int pure);
00129 ~GaussianShell();
00130 void save_data_state(StateOut&);
00132 int nprimitive() const { return nprim; }
00134 int ncontraction() const { return ncon; }
00136 int nfunction() const { return nfunc; }
00138 int max_angular_momentum() const { return max_am_; }
00140 int min_angular_momentum() const { return min_am_; }
00142 int max_cartesian() const;
00144 int am(int con) const { return l[con]; }
00146 int max_am() const { return max_am_; }
00148 int min_am() const { return min_am_; }
00150 char amchar(int con) const { return amtypes[l[con]]; }
00152 int nfunction(int con) const;
00154 int ncartesian() const { return ncart_; }
00157 int ncartesian_with_aminc(int aminc) const;
00159 int ncartesian(int con) const { return ((l[con]+2)*(l[con]+1))>>1; }
00161 int is_cartesian(int con) const { return !puream[con]; }
00163 int is_pure(int con) const { return puream[con]; }
00165 int has_pure() const { return has_pure_; }
00167 int contraction_to_function(int c) const { return contr_to_func_[c]; }
00169 int function_to_contraction(int f) const { return func_to_contr_[f]; }
00171 double coefficient_unnorm(int con,int prim) const {return coef[con][prim];}
00173 double coefficient_norm(int con,int prim) const;
00175 double exponent(int iprim) const { return exp[iprim]; }
00176
00179 int values(CartesianIter **, SphericalTransformIter **,
00180 const SCVector3& r, double* basis_values);
00183 int grad_values(CartesianIter **, SphericalTransformIter **,
00184 const SCVector3& R,
00185 double* g_values,
00186 double* basis_values=0) const;
00189 int hessian_values(CartesianIter **, SphericalTransformIter **,
00190 const SCVector3& R,
00191 double* h_values, double* g_values=0,
00192 double* basis_values=0) const;
00193
00197 double relative_overlap(const Ref<Integral>&,
00198 int con, int func1, int func2) const;
00203 double relative_overlap(int con,
00204 int a1, int b1, int c1,
00205 int a2, int b2, int c2) const;
00206
00208 int equiv(const GaussianShell* s) const;
00210 int equiv(const GaussianShell& s) const
00211 {
00212 return equiv(&s);
00213 }
00214
00215
00218 double extent(double threshold) const;
00219
00223 double monobound(double r) const;
00224
00225 void print(std::ostream& =ExEnv::out0()) const;
00226 };
00227
00228 }
00229
00230 #endif
00231
00232
00233
00234
00235