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 #ifdef __GNUG__
00029 #pragma interface
00030 #endif
00031
00032 #ifndef _chemistry_qc_int1e_h
00033 #define _chemistry_qc_int1e_h
00034
00035 #include <util/ref/ref.h>
00036 #include <chemistry/qc/basis/basis.h>
00037 #include <chemistry/qc/intv3/fjt.h>
00038 #include <chemistry/qc/intv3/array.h>
00039
00040 namespace sc {
00041
00042 class Integral;
00043
00047 class Int1eV3: public RefCount {
00048 protected:
00049 Integral *integral_;
00050
00051 Ref<GaussianBasisSet> bs1_;
00052 Ref<GaussianBasisSet> bs2_;
00053 double *fjttable_;
00054 Ref<FJT> fjt_;
00055 int bs1_shell_offset_;
00056 int bs2_shell_offset_;
00057 int bs1_func_offset_;
00058 int bs2_func_offset_;
00059 int bs1_prim_offset_;
00060 int bs2_prim_offset_;
00061
00062
00063 protected:
00064 double oo2zeta_a;
00065 double oo2zeta_b;
00066 double sMus[3];
00067 double sTs;
00068 double xi;
00069 double A[3];
00070 double B[3];
00071 double C[3];
00072 double ss;
00073 double PmA[3];
00074 double PmB[3];
00075 double PmC[3];
00076 double zeta;
00077 double oo2zeta;
00078 GaussianShell *gshell1, *gshell2;
00079 int exponent_weighted;
00080 int scale_shell_result;
00081 double result_scale_factor;
00082 int three_center;
00083 Ref<GaussianBasisSet> third_centers;
00084 int third_centernum;
00085 int init_order;
00086 double *buff;
00087 double *cartesianbuffer;
00088 double *cartesianbuffer_scratch;
00089 int mu;
00090 IntV3Arraydoublep3 inter;
00091 IntV3Arraydoublep3 efield_inter;
00092
00093 protected:
00094 void accum_shell_1der(
00095 double *buff, int ish, int jsh,
00096 Ref<GaussianBasisSet> dercs, int centernum,
00097 double (Int1eV3::*)(int,int,int,int,int,int,int,int)
00098 );
00099 void accum_shell_block_1der(
00100 double *buff, int ish, int jsh,
00101 Ref<GaussianBasisSet> dercs, int centernum,
00102 void (Int1eV3::*shell_block_function)
00103 (int gc1, int a, int gc2, int b,
00104 int gcsize2, int gcoff1, int gcoff2,
00105 double coef, double *buffer)
00106 );
00107 double comp_shell_overlap(int gc1, int i1, int j1, int k1,
00108 int gc2, int i2, int j2, int k2);
00109 double comp_prim_overlap(int i1, int j1, int k1,
00110 int i2, int j2, int k2);
00111 double comp_shell_kinetic(int gc1, int i1, int j1, int k1,
00112 int gc2, int i2, int j2, int k2);
00113 double comp_prim_kinetic(int i1, int j1, int k1,
00114 int i2, int j2, int k2);
00115 double comp_shell_nuclear(int gc1, int i1, int j1, int k1,
00116 int gc2, int i2, int j2, int k2);
00117 void accum_shell_efield(double *buff, int ish, int jsh);
00118 void accum_shell_block_efield(double *buff, int ish, int jsh);
00119 double comp_prim_nuclear(int i1, int j1, int k1,
00120 int i2, int j2, int k2, int m);
00121 void comp_shell_efield(double *efield,
00122 int gc1, int i1, int j1, int k1,
00123 int gc2, int i2, int j2, int k2);
00124 void comp_shell_block_efield(int gc1, int a, int gc2, int b,
00125 int gcsize2, int gcoff1, int gcoff2,
00126 double coef, double *buffer);
00127 double comp_prim_efield(int xyz, int i1, int j1, int k1,
00128 int i2, int j2, int k2, int m);
00129 void comp_shell_dipole(double* dipole,
00130 int gc1, int i1, int j1, int k1,
00131 int gc2, int i2, int j2, int k2);
00132 double comp_prim_dipole(int axis,
00133 int i1, int j1, int k1,
00134 int i2, int j2, int k2);
00135 void comp_shell_block_nuclear(int gc1, int a, int gc2, int b,
00136 int gcsize2, int gcoff1, int gcoff2,
00137 double coef, double *buffer);
00138 void comp_prim_block_nuclear(int a, int b);
00139 void comp_prim_block_nuclear_build_a(int a, int b, int m);
00140 void comp_prim_block_nuclear_build_b(int b, int m);
00141 void comp_prim_block_efield(int a, int b);
00142 void comp_prim_block_efield_build_a(int a, int b, int m);
00143 void comp_prim_block_efield_build_b(int b, int m);
00144
00145 protected:
00146 void int_accum_shell_overlap_1der(int ish, int jsh,
00147 Ref<GaussianBasisSet> dercs,
00148 int centernum);
00149 void int_done_1e();
00150 void int_initialize_1e(int flags, int order);
00151 #if 0
00152 double int_prim_overlap(shell_t *pshell1, shell_t *pshell2,
00153 double *pA, double *pB,
00154 int prim1, int prim2,
00155 int i1, int j1, int k1,
00156 int i2, int j2, int k2);
00157 #endif
00158 void int_accum_shell_kinetic(int ish, int jsh);
00159 void int_accum_shell_kinetic_1der(int ish, int jsh,
00160 Ref<GaussianBasisSet> dercs,
00161 int centernum);
00162 void int_accum_shell_nuclear_1der(int ish, int jsh,
00163 Ref<GaussianBasisSet> dercs,
00164 int centernum);
00165 void int_accum_shell_nuclear_hfc_1der(int ish, int jsh,
00166 Ref<GaussianBasisSet> dercs,
00167 int centernum);
00168 void int_accum_shell_nuclear_hf_1der(int ish, int jsh,
00169 Ref<GaussianBasisSet> dercs,
00170 int centernum);
00171 void int_accum_shell_nuclear_nonhf_1der(int ish, int jsh,
00172 Ref<GaussianBasisSet> dercs,
00173 int centernum);
00174 void int_accum_shell_efield(int ish, int jsh,
00175 double *position);
00176 void int_accum_shell_point_charge(int ish, int jsh,
00177 int ncharge, const double* charge,
00178 const double*const* position);
00179 void int_shell_nuclear_hf_1der(int ish, int jsh,
00180 Ref<GaussianBasisSet> dercs,
00181 int centernum);
00182 void int_shell_nuclear_nonhf_1der(int ish, int jsh,
00183 Ref<GaussianBasisSet> dercs,
00184 int centernum);
00185 void int_accum_shell_dipole(int ish, int jsh,
00186 double *com);
00187
00188
00189 protected:
00190 void int_initialize_offsets1();
00191 void int_done_offsets1();
00192
00193
00194 protected:
00195 double *source;
00196 int nsourcemax;
00197
00198 void transform_init();
00199 void transform_done();
00200 void source_space(int nsource);
00201 void copy_to_source(double *integrals, int nsource);
00202 void do_transform_1e(Integral *integ,
00203 double *integrals,
00204 GaussianShell *sh1, GaussianShell *sh2,
00205 int chunk);
00206 void transform_1e(Integral *integ,
00207 double *integrals, double *target,
00208 GaussianShell *sh1, GaussianShell *sh2, int chunk);
00209 void accum_transform_1e(Integral *integ,
00210 double *integrals, double *target,
00211 GaussianShell *sh1, GaussianShell *sh2, int chunk);
00212
00213
00214 void transform_1e(Integral*integ,
00215 double *integrals, double *target,
00216 GaussianShell *sh1, GaussianShell *sh2);
00217 void accum_transform_1e(Integral*integ,
00218 double *integrals, double *target,
00219 GaussianShell *sh1, GaussianShell *sh2);
00220 void transform_1e_xyz(Integral*integ,
00221 double *integrals, double *target,
00222 GaussianShell *sh1, GaussianShell *sh2);
00223 void accum_transform_1e_xyz(Integral*integ,
00224 double *integrals, double *target,
00225 GaussianShell *sh1, GaussianShell *sh2);
00226
00227 public:
00228 Int1eV3(Integral *,
00229 const Ref<GaussianBasisSet>&,
00230 const Ref<GaussianBasisSet>&,
00231 int order);
00232 ~Int1eV3();
00233
00234 double *buffer() { return buff; }
00235 Ref<GaussianBasisSet> basis() { if (bs1_==bs2_) return bs1_; return 0; }
00236 Ref<GaussianBasisSet> basis1() { return bs1_; }
00237 Ref<GaussianBasisSet> basis2() { return bs2_; }
00238
00239 void kinetic(int ish, int jsh);
00240 void nuclear_slow(int ish, int jsh);
00241 void nuclear(int ish, int jsh);
00242 void overlap(int ish, int jsh);
00243 void hcore(int ish, int jsh);
00244 void efield(int ish, int jsh, double position[3]);
00245 void point_charge(int ish, int jsh,
00246 int ncharge, const double* charge,
00247 const double*const* position);
00248 void dipole(int ish, int jsh,
00249 double *com);
00250
00251 void hcore_1der(int ish, int jsh,
00252 int dercs, int centernum);
00253 void kinetic_1der(int ish, int jsh,
00254 int dercs, int centernum);
00255 void nuclear_1der(int ish, int jsh,
00256 int dercs, int centernum);
00257 void overlap_1der(int ish, int jsh,
00258 int dercs, int centernum);
00259 };
00260
00261 }
00262
00263 #endif
00264
00265
00266
00267
00268