| [0b990d] | 1 | //
 | 
|---|
 | 2 | // eri.h
 | 
|---|
 | 3 | //
 | 
|---|
 | 4 | // Copyright (C) 2001 Edward Valeev
 | 
|---|
 | 5 | //
 | 
|---|
 | 6 | // Author: Edward Valeev <edward.valeev@chemistry.gatech.edu>
 | 
|---|
 | 7 | // Maintainer: EV
 | 
|---|
 | 8 | //
 | 
|---|
 | 9 | // This file is part of the SC Toolkit.
 | 
|---|
 | 10 | //
 | 
|---|
 | 11 | // The SC Toolkit is free software; you can redistribute it and/or modify
 | 
|---|
 | 12 | // it under the terms of the GNU Library General Public License as published by
 | 
|---|
 | 13 | // the Free Software Foundation; either version 2, or (at your option)
 | 
|---|
 | 14 | // any later version.
 | 
|---|
 | 15 | //
 | 
|---|
 | 16 | // The SC Toolkit is distributed in the hope that it will be useful,
 | 
|---|
 | 17 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
|---|
 | 18 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 | 
|---|
 | 19 | // GNU Library General Public License for more details.
 | 
|---|
 | 20 | //
 | 
|---|
 | 21 | // You should have received a copy of the GNU Library General Public License
 | 
|---|
 | 22 | // along with the SC Toolkit; see the file COPYING.LIB.  If not, write to
 | 
|---|
 | 23 | // the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
 | 
|---|
 | 24 | //
 | 
|---|
 | 25 | // The U.S. Government is granted a limited license as per AL 91-7.
 | 
|---|
 | 26 | //
 | 
|---|
 | 27 | 
 | 
|---|
 | 28 | #ifdef __GNUG__
 | 
|---|
 | 29 | #pragma interface
 | 
|---|
 | 30 | #endif
 | 
|---|
 | 31 | 
 | 
|---|
 | 32 | #ifndef _chemistry_qc_cints_eri_h
 | 
|---|
 | 33 | #define _chemistry_qc_cints_eri_h
 | 
|---|
 | 34 | 
 | 
|---|
 | 35 | #include <limits.h>
 | 
|---|
 | 36 | 
 | 
|---|
 | 37 | #include <util/ref/ref.h>
 | 
|---|
 | 38 | #include <chemistry/qc/basis/basis.h>
 | 
|---|
 | 39 | #include <chemistry/qc/cints/shellpairs.h>
 | 
|---|
 | 40 | #include <chemistry/qc/intv3/fjt.h>
 | 
|---|
 | 41 | #include <chemistry/qc/cints/int2e.h>
 | 
|---|
 | 42 | extern "C" {
 | 
|---|
 | 43 | #include <libint/libint.h>
 | 
|---|
 | 44 | }
 | 
|---|
 | 45 | 
 | 
|---|
 | 46 | namespace sc {
 | 
|---|
 | 47 | 
 | 
|---|
 | 48 | class Integral;
 | 
|---|
 | 49 | 
 | 
|---|
 | 50 | /** EriCints is a specialization of Int2eCints that computes electron repulsion integrals */
 | 
|---|
 | 51 | class EriCints: public Int2eCints {
 | 
|---|
 | 52 |   private:
 | 
|---|
 | 53 | 
 | 
|---|
 | 54 |     // Storage for target integrals
 | 
|---|
 | 55 |     double *target_ints_buffer_;
 | 
|---|
 | 56 | 
 | 
|---|
 | 57 |     /*--- Intermediate scratch arrays (may be used in new[] and delete[]) ---*/
 | 
|---|
 | 58 |     double *cart_ints_;       // cartesian integrals, in by-contraction-quartet order
 | 
|---|
 | 59 |     double *sphharm_ints_;    // transformed integrals, in by-contraction-quartet order
 | 
|---|
 | 60 |     double *perm_ints_;       // redundant target integrals in shell quartet order, shells permuted
 | 
|---|
 | 61 | 
 | 
|---|
 | 62 |     /*--- Pointers to scratch arrays (never used in new[] and delete[]) ---*/
 | 
|---|
 | 63 |     double *prim_ints_;       // this points to the appropriate location for raw integrals
 | 
|---|
 | 64 |     double *contr_quartets_;
 | 
|---|
 | 65 |     double *shell_quartet_;
 | 
|---|
 | 66 | 
 | 
|---|
 | 67 |     /*--- Precomputed data ---*/
 | 
|---|
 | 68 |     Ref<ShellPairsCints> shell_pairs12_;
 | 
|---|
 | 69 |     Ref<ShellPairsCints> shell_pairs34_;
 | 
|---|
 | 70 | 
 | 
|---|
 | 71 |     /*--- Internally used "interfaces" ---*/
 | 
|---|
 | 72 |     struct {
 | 
|---|
 | 73 |       int p12, p34, p13p24;           // flags indicating if functions were permuted
 | 
|---|
 | 74 |       ShellPairCints *shell_pair12, *shell_pair34;   // Shell pairs corresponding to the original
 | 
|---|
 | 75 |                                                      // (before permutation) order of shell
 | 
|---|
 | 76 |       int *op1, *op2, *op3, *op4;     // pointers to the primitive indices in the original order
 | 
|---|
 | 77 |       /////////// The rest of data has been permuted according to p12, p34, p13p24
 | 
|---|
 | 78 |       double A[3], B[3], C[3], D[3];
 | 
|---|
 | 79 |       double AB2, CD2;
 | 
|---|
 | 80 |       int gc1, gc2, gc3, gc4;
 | 
|---|
 | 81 |       int p1, p2, p3, p4;
 | 
|---|
 | 82 |       int am;
 | 
|---|
 | 83 |     } quartet_info_;
 | 
|---|
 | 84 |     void eri_quartet_data_(prim_data *Data, double scale);
 | 
|---|
 | 85 |     /*--- Compute engines ---*/
 | 
|---|
 | 86 |     Libint_t Libint_;
 | 
|---|
 | 87 |     Ref<FJT> Fm_Eval_;
 | 
|---|
 | 88 |   
 | 
|---|
 | 89 |   public:
 | 
|---|
 | 90 |     EriCints(Integral *,
 | 
|---|
 | 91 |              const Ref<GaussianBasisSet>&,
 | 
|---|
 | 92 |              const Ref<GaussianBasisSet>&,
 | 
|---|
 | 93 |              const Ref<GaussianBasisSet>&,
 | 
|---|
 | 94 |              const Ref<GaussianBasisSet>&,
 | 
|---|
 | 95 |              size_t storage);
 | 
|---|
 | 96 |     ~EriCints();
 | 
|---|
 | 97 | 
 | 
|---|
 | 98 |     double *buffer(TwoBodyInt::tbint_type te_type) const {
 | 
|---|
 | 99 |       if (te_type == TwoBodyInt::eri) return target_ints_buffer_;
 | 
|---|
 | 100 |       else return 0;
 | 
|---|
 | 101 |     }
 | 
|---|
 | 102 | 
 | 
|---|
 | 103 |     static size_t storage_required(const Ref<GaussianBasisSet>& b1,
 | 
|---|
 | 104 |                                    const Ref<GaussianBasisSet>& b2 = 0,
 | 
|---|
 | 105 |                                    const Ref<GaussianBasisSet>& b3 = 0,
 | 
|---|
 | 106 |                                    const Ref<GaussianBasisSet>& b4 = 0);
 | 
|---|
 | 107 |     
 | 
|---|
 | 108 |     // evaluate ERIs (Coulomb)
 | 
|---|
 | 109 |     void compute_quartet(int*, int*, int*, int*);
 | 
|---|
 | 110 | };
 | 
|---|
 | 111 | 
 | 
|---|
 | 112 | #include <chemistry/qc/cints/eri_quartet_data.h>
 | 
|---|
 | 113 | 
 | 
|---|
 | 114 | /* LibintStaticInterface is an initializer class for the static part
 | 
|---|
 | 115 |    of libint's interface (one per executable) */
 | 
|---|
 | 116 | class LibintStaticInterface {
 | 
|---|
 | 117 |     bool ready;
 | 
|---|
 | 118 | 
 | 
|---|
 | 119 |     public:
 | 
|---|
 | 120 |     LibintStaticInterface() { init_libint_base(); ready = true; }
 | 
|---|
 | 121 |     ~LibintStaticInterface() { ready = false; }
 | 
|---|
 | 122 | };
 | 
|---|
 | 123 | 
 | 
|---|
 | 124 | }
 | 
|---|
 | 125 | 
 | 
|---|
 | 126 | #endif
 | 
|---|
 | 127 | 
 | 
|---|
 | 128 | // Local Variables:
 | 
|---|
 | 129 | // mode: c++
 | 
|---|
 | 130 | // c-file-style: "CLJ"
 | 
|---|
 | 131 | // End:
 | 
|---|