| [0b990d] | 1 | //
 | 
|---|
 | 2 | // print2e.cc
 | 
|---|
 | 3 | //
 | 
|---|
 | 4 | // Copyright (C) 1996 Limit Point Systems, Inc.
 | 
|---|
 | 5 | //
 | 
|---|
 | 6 | // Author: Curtis Janssen <cljanss@limitpt.com>
 | 
|---|
 | 7 | // Maintainer: LPS
 | 
|---|
 | 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 | #include <util/misc/formio.h>
 | 
|---|
 | 29 | #include <chemistry/qc/intv3/macros.h>
 | 
|---|
 | 30 | #include <chemistry/qc/intv3/int2e.h>
 | 
|---|
 | 31 | 
 | 
|---|
 | 32 | using namespace std;
 | 
|---|
 | 33 | using namespace sc;
 | 
|---|
 | 34 | 
 | 
|---|
 | 35 | /* Prints out an integral buffer given
 | 
|---|
 | 36 |  * fp = where to print
 | 
|---|
 | 37 |  * buffer = the integrals (>>> nonredundant <<<)
 | 
|---|
 | 38 |  * c1 = centers structure for center 1
 | 
|---|
 | 39 |  * s1 = shell number on center 1
 | 
|---|
 | 40 |  * ...
 | 
|---|
 | 41 |  * This prints out integrals using the offset arrays in the
 | 
|---|
 | 42 |  * centers structure.  Only nonzero integrals are printed.
 | 
|---|
 | 43 |  */
 | 
|---|
 | 44 | void
 | 
|---|
 | 45 | Int2eV3::int_offset_print(ostream &o,
 | 
|---|
 | 46 |                           double *buffer,
 | 
|---|
 | 47 |                           Ref<GaussianBasisSet> c1, int s1,
 | 
|---|
 | 48 |                           Ref<GaussianBasisSet> c2, int s2,
 | 
|---|
 | 49 |                           Ref<GaussianBasisSet> c3, int s3,
 | 
|---|
 | 50 |                           Ref<GaussianBasisSet> c4, int s4)
 | 
|---|
 | 51 | {
 | 
|---|
 | 52 |   int nfunc1,nfunc2,nfunc3,nfunc4;
 | 
|---|
 | 53 | 
 | 
|---|
 | 54 |   nfunc1 = c1->shell(s1).nfunction();
 | 
|---|
 | 55 |   nfunc2 = c1->shell(s2).nfunction();
 | 
|---|
 | 56 |   nfunc3 = c1->shell(s3).nfunction();
 | 
|---|
 | 57 |   nfunc4 = c1->shell(s4).nfunction();
 | 
|---|
 | 58 | 
 | 
|---|
 | 59 |   int_offset_print_n(o,buffer,nfunc1,nfunc2,nfunc3,nfunc4
 | 
|---|
 | 60 |     ,bs1_func_offset_ + c1->shell_to_function(s1)
 | 
|---|
 | 61 |     ,bs2_func_offset_ + c2->shell_to_function(s2)
 | 
|---|
 | 62 |     ,bs3_func_offset_ + c3->shell_to_function(s3)
 | 
|---|
 | 63 |     ,bs4_func_offset_ + c4->shell_to_function(s4)
 | 
|---|
 | 64 |     ,(c2==c1)&&(s2==s1)
 | 
|---|
 | 65 |     ,(c3==c1)&&(s3==s1) && (c4==c2)&&(s4==s2)
 | 
|---|
 | 66 |     ,(c4==c3)&&(s4==s3)
 | 
|---|
 | 67 |     );
 | 
|---|
 | 68 |   }
 | 
|---|
 | 69 | 
 | 
|---|
 | 70 | /* Prints out an integrals buffer given the number of functions
 | 
|---|
 | 71 |  * on each center and shell equivalency information.
 | 
|---|
 | 72 |  * fp = where to print
 | 
|---|
 | 73 |  * buffer = the integrals (>>> nonredundant <<<)
 | 
|---|
 | 74 |  * n1 = number of functions in shell 1
 | 
|---|
 | 75 |  * ...
 | 
|---|
 | 76 |  * o1 = the basis function offset for shell1
 | 
|---|
 | 77 |  * ...
 | 
|---|
 | 78 |  * e12 = shell 1 == shell 2
 | 
|---|
 | 79 |  * e13e24 = (shell 1 == shell 3) && (shell 2 == shell 4)
 | 
|---|
 | 80 |  * e34 = shell 3 == shell 4
 | 
|---|
 | 81 |  */
 | 
|---|
 | 82 | void
 | 
|---|
 | 83 | Int2eV3::int_offset_print_n(ostream &o, double *buffer,
 | 
|---|
 | 84 |                             int n1, int n2, int n3, int n4,
 | 
|---|
 | 85 |                             int o1, int o2, int o3, int o4,
 | 
|---|
 | 86 |                             int e12, int e13e24, int e34)
 | 
|---|
 | 87 | {
 | 
|---|
 | 88 |   int i,j,k,l;
 | 
|---|
 | 89 |   int index;
 | 
|---|
 | 90 | 
 | 
|---|
 | 91 |   index = 0;
 | 
|---|
 | 92 |   for (i=0; i<=INT_MAX1(n1); i++) {
 | 
|---|
 | 93 |     for (j=0; j<=INT_MAX2(e12,i,n2); j++) {
 | 
|---|
 | 94 |       for (k=0; k<=INT_MAX3(e13e24,i,n3); k++) {
 | 
|---|
 | 95 |         for (l=0; l<=INT_MAX4(e13e24,e34,i,j,k,n4); l++) {
 | 
|---|
 | 96 |           if (INT_NONZERO(buffer[index]))
 | 
|---|
 | 97 |             o << scprintf(" (%2d %2d|%2d %2d) = %11.7f",
 | 
|---|
 | 98 |                           o1+i,o2+j,o3+k,o4+l,buffer[index])
 | 
|---|
 | 99 |               << endl;
 | 
|---|
 | 100 |           index++;
 | 
|---|
 | 101 |           }
 | 
|---|
 | 102 |         }
 | 
|---|
 | 103 |       }
 | 
|---|
 | 104 |     }
 | 
|---|
 | 105 |   }
 | 
|---|
 | 106 | 
 | 
|---|
 | 107 | /* Prints out an integral buffer given
 | 
|---|
 | 108 |  * fp = where to print
 | 
|---|
 | 109 |  * buffer = the integrals (>>> nonredundant <<<)
 | 
|---|
 | 110 |  * c1 = centers structure for center 1
 | 
|---|
 | 111 |  * s1 = shell number on center 1
 | 
|---|
 | 112 |  * ...
 | 
|---|
 | 113 |  */
 | 
|---|
 | 114 | void
 | 
|---|
 | 115 | Int2eV3::int_print(ostream &o, double *buffer,
 | 
|---|
 | 116 |                    Ref<GaussianBasisSet> c1, int s1,
 | 
|---|
 | 117 |                    Ref<GaussianBasisSet> c2, int s2,
 | 
|---|
 | 118 |                    Ref<GaussianBasisSet> c3, int s3,
 | 
|---|
 | 119 |                    Ref<GaussianBasisSet> c4, int s4)
 | 
|---|
 | 120 | {
 | 
|---|
 | 121 |   int nfunc1,nfunc2,nfunc3,nfunc4;
 | 
|---|
 | 122 | 
 | 
|---|
 | 123 |   nfunc1 = c1->shell(s1).nfunction();
 | 
|---|
 | 124 |   nfunc2 = c1->shell(s2).nfunction();
 | 
|---|
 | 125 |   nfunc3 = c1->shell(s3).nfunction();
 | 
|---|
 | 126 |   nfunc4 = c1->shell(s4).nfunction();
 | 
|---|
 | 127 | 
 | 
|---|
 | 128 |   int_print_n(o,buffer,nfunc1,nfunc2,nfunc3,nfunc4
 | 
|---|
 | 129 |     ,(c2==c1)&&(s2==s1)
 | 
|---|
 | 130 |     ,(c3==c1)&&(s3==s1) && (c4==c2)&&(s4==s2)
 | 
|---|
 | 131 |     ,(c4==c3)&&(s4==s3)
 | 
|---|
 | 132 |     );
 | 
|---|
 | 133 |   }
 | 
|---|
 | 134 | 
 | 
|---|
 | 135 | /* Prints out an integrals buffer given the number of functions
 | 
|---|
 | 136 |  * on each center and shell equivalency information.
 | 
|---|
 | 137 |  * fp = where to print
 | 
|---|
 | 138 |  * buffer = the integrals (>>> nonredundant <<<)
 | 
|---|
 | 139 |  * n1 = number of functions in shell 1
 | 
|---|
 | 140 |  * ...
 | 
|---|
 | 141 |  * e12 = shell 1 == shell 2
 | 
|---|
 | 142 |  * e13e24  = (shell 1 == shell 3) && (shell 2 == shell 4)
 | 
|---|
 | 143 |  * e34 = shell 3 == shell 4
 | 
|---|
 | 144 |  */
 | 
|---|
 | 145 | void
 | 
|---|
 | 146 | Int2eV3::int_print_n(ostream &o, double *buffer,
 | 
|---|
 | 147 |                      int n1, int n2, int n3, int n4,
 | 
|---|
 | 148 |                      int e12, int e13e24, int e34)
 | 
|---|
 | 149 | {
 | 
|---|
 | 150 |   int i,j,k,l;
 | 
|---|
 | 151 |   int index;
 | 
|---|
 | 152 | 
 | 
|---|
 | 153 |   index = 0;
 | 
|---|
 | 154 |   for (i=0; i<=INT_MAX1(n1); i++) {
 | 
|---|
 | 155 |     for (j=0; j<=INT_MAX2(e12,i,n2); j++) {
 | 
|---|
 | 156 |       for (k=0; k<=INT_MAX3(e13e24,i,n3); k++) {
 | 
|---|
 | 157 |         for (l=0; l<=INT_MAX4(e13e24,e34,i,j,k,n4); l++) {
 | 
|---|
 | 158 |           if (INT_NONZERO(buffer[index]))
 | 
|---|
 | 159 |             o << scprintf(" (%2d %2d|%2d %2d) = (%4d) = %11.7f",
 | 
|---|
 | 160 |                           i,j,k,l,index,buffer[index])
 | 
|---|
 | 161 |               << endl;
 | 
|---|
 | 162 |           index++;
 | 
|---|
 | 163 |           }
 | 
|---|
 | 164 |         }
 | 
|---|
 | 165 |       }
 | 
|---|
 | 166 |     }
 | 
|---|
 | 167 |   }
 | 
|---|
 | 168 | 
 | 
|---|
 | 169 | void
 | 
|---|
 | 170 | Int2eV3::int_print_intermediates(ostream &o)
 | 
|---|
 | 171 | {
 | 
|---|
 | 172 |   o << "The integral intermediates:" << endl;
 | 
|---|
 | 173 | 
 | 
|---|
 | 174 |   o << "  int_prim_zeta:" << endl;
 | 
|---|
 | 175 |   int_prim_zeta.print(o);
 | 
|---|
 | 176 | 
 | 
|---|
 | 177 |   o << "  int_prim_k:" << endl;
 | 
|---|
 | 178 |   int_prim_k.print(o);
 | 
|---|
 | 179 | 
 | 
|---|
 | 180 |   o << "  int_prim_oo2zeta:" << endl;
 | 
|---|
 | 181 |   int_prim_oo2zeta.print(o);
 | 
|---|
 | 182 | 
 | 
|---|
 | 183 |   o << "  int_prim_p:" << endl;
 | 
|---|
 | 184 |   int_prim_p.print(o);
 | 
|---|
 | 185 |   }
 | 
|---|
 | 186 | 
 | 
|---|
 | 187 | /////////////////////////////////////////////////////////////////////////////
 | 
|---|
 | 188 | 
 | 
|---|
 | 189 | // Local Variables:
 | 
|---|
 | 190 | // mode: c++
 | 
|---|
 | 191 | // c-file-style: "CLJ-CONDENSED"
 | 
|---|
 | 192 | // End:
 | 
|---|