[0b990d] | 1 | //
|
---|
| 2 | // tbintv3.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 <stdexcept>
|
---|
| 29 |
|
---|
| 30 | #include <chemistry/qc/intv3/tbintv3.h>
|
---|
| 31 | #include <chemistry/qc/basis/integral.h>
|
---|
| 32 |
|
---|
| 33 | using namespace sc;
|
---|
| 34 |
|
---|
| 35 | TwoBodyIntV3::TwoBodyIntV3(Integral*integral,
|
---|
| 36 | const Ref<GaussianBasisSet>& b1,
|
---|
| 37 | const Ref<GaussianBasisSet>& b2,
|
---|
| 38 | const Ref<GaussianBasisSet>& b3,
|
---|
| 39 | const Ref<GaussianBasisSet>& b4,
|
---|
| 40 | size_t storage):
|
---|
| 41 | TwoBodyInt(integral,b1,b2,b3,b4)
|
---|
| 42 | {
|
---|
| 43 | int2ev3_ = new Int2eV3(integral,b1,b2,b3,b4,0,storage);
|
---|
| 44 | buffer_ = int2ev3_->buffer();
|
---|
| 45 | integral_->adjust_storage(int2ev3_->used_storage());
|
---|
| 46 | }
|
---|
| 47 |
|
---|
| 48 | TwoBodyIntV3::~TwoBodyIntV3()
|
---|
| 49 | {
|
---|
| 50 | integral_->adjust_storage(-int2ev3_->used_storage());
|
---|
| 51 | }
|
---|
| 52 |
|
---|
| 53 | void
|
---|
| 54 | TwoBodyIntV3::compute_shell(int is, int js, int ks, int ls)
|
---|
| 55 | {
|
---|
| 56 | int2ev3_->set_redundant(redundant());
|
---|
| 57 | int2ev3_->erep(is,js,ks,ls);
|
---|
| 58 | }
|
---|
| 59 |
|
---|
| 60 | int
|
---|
| 61 | TwoBodyIntV3::log2_shell_bound(int is, int js, int ks, int ls)
|
---|
| 62 | {
|
---|
| 63 | return int2ev3_->erep_4bound(is,js,ks,ls);
|
---|
| 64 | }
|
---|
| 65 |
|
---|
| 66 | void
|
---|
| 67 | TwoBodyIntV3::set_integral_storage(size_t storage)
|
---|
| 68 | {
|
---|
| 69 | int2ev3_->init_storage(storage);
|
---|
| 70 | }
|
---|
| 71 |
|
---|
| 72 | //////////////////////////////////////////////////////////////////////////
|
---|
| 73 |
|
---|
| 74 | TwoBodyThreeCenterIntV3::TwoBodyThreeCenterIntV3(
|
---|
| 75 | Integral*integral,
|
---|
| 76 | const Ref<GaussianBasisSet>& b1,
|
---|
| 77 | const Ref<GaussianBasisSet>& b2,
|
---|
| 78 | const Ref<GaussianBasisSet>& b3,
|
---|
| 79 | size_t storage):
|
---|
| 80 | TwoBodyThreeCenterInt(integral,b1,b2,b3)
|
---|
| 81 | {
|
---|
| 82 | Ref<GaussianBasisSet> null;
|
---|
| 83 | int2ev3_ = new Int2eV3(integral,b1,b2,b3,null,0,storage);
|
---|
| 84 | buffer_ = int2ev3_->buffer();
|
---|
| 85 | integral_->adjust_storage(int2ev3_->used_storage());
|
---|
| 86 | }
|
---|
| 87 |
|
---|
| 88 | TwoBodyThreeCenterIntV3::~TwoBodyThreeCenterIntV3()
|
---|
| 89 | {
|
---|
| 90 | integral_->adjust_storage(-int2ev3_->used_storage());
|
---|
| 91 | }
|
---|
| 92 |
|
---|
| 93 | void
|
---|
| 94 | TwoBodyThreeCenterIntV3::compute_shell(int is, int js, int ks)
|
---|
| 95 | {
|
---|
| 96 | int2ev3_->set_redundant(redundant());
|
---|
| 97 | int2ev3_->erep_3center(is,js,ks);
|
---|
| 98 | }
|
---|
| 99 |
|
---|
| 100 | int
|
---|
| 101 | TwoBodyThreeCenterIntV3::log2_shell_bound(int is, int js, int ks)
|
---|
| 102 | {
|
---|
| 103 | throw std::runtime_error("TwoBodyThreeCenterIntv3: doesn't support bounds");
|
---|
| 104 | return 0;
|
---|
| 105 | }
|
---|
| 106 |
|
---|
| 107 | void
|
---|
| 108 | TwoBodyThreeCenterIntV3::set_integral_storage(size_t storage)
|
---|
| 109 | {
|
---|
| 110 | int2ev3_->init_storage(storage);
|
---|
| 111 | }
|
---|
| 112 |
|
---|
| 113 | //////////////////////////////////////////////////////////////////////////
|
---|
| 114 |
|
---|
| 115 | TwoBodyTwoCenterIntV3::TwoBodyTwoCenterIntV3(
|
---|
| 116 | Integral*integral,
|
---|
| 117 | const Ref<GaussianBasisSet>& b1,
|
---|
| 118 | const Ref<GaussianBasisSet>& b2,
|
---|
| 119 | size_t storage):
|
---|
| 120 | TwoBodyTwoCenterInt(integral,b1,b2)
|
---|
| 121 | {
|
---|
| 122 | Ref<GaussianBasisSet> null;
|
---|
| 123 | int2ev3_ = new Int2eV3(integral,b1,null,b2,null,0,storage);
|
---|
| 124 | buffer_ = int2ev3_->buffer();
|
---|
| 125 | integral_->adjust_storage(int2ev3_->used_storage());
|
---|
| 126 | }
|
---|
| 127 |
|
---|
| 128 | TwoBodyTwoCenterIntV3::~TwoBodyTwoCenterIntV3()
|
---|
| 129 | {
|
---|
| 130 | integral_->adjust_storage(-int2ev3_->used_storage());
|
---|
| 131 | }
|
---|
| 132 |
|
---|
| 133 | void
|
---|
| 134 | TwoBodyTwoCenterIntV3::compute_shell(int is, int js)
|
---|
| 135 | {
|
---|
| 136 | int2ev3_->set_redundant(redundant());
|
---|
| 137 | int2ev3_->erep_2center(is,js);
|
---|
| 138 | }
|
---|
| 139 |
|
---|
| 140 | int
|
---|
| 141 | TwoBodyTwoCenterIntV3::log2_shell_bound(int is, int js)
|
---|
| 142 | {
|
---|
| 143 | throw std::runtime_error("TwoBodyTwoCenterIntv3: doesn't support bounds");
|
---|
| 144 | return 0;
|
---|
| 145 | }
|
---|
| 146 |
|
---|
| 147 | void
|
---|
| 148 | TwoBodyTwoCenterIntV3::set_integral_storage(size_t storage)
|
---|
| 149 | {
|
---|
| 150 | int2ev3_->init_storage(storage);
|
---|
| 151 | }
|
---|
| 152 |
|
---|
| 153 | //////////////////////////////////////////////////////////////////////////
|
---|
| 154 |
|
---|
| 155 | TwoBodyDerivIntV3::TwoBodyDerivIntV3(Integral*integral,
|
---|
| 156 | const Ref<GaussianBasisSet>& b1,
|
---|
| 157 | const Ref<GaussianBasisSet>& b2,
|
---|
| 158 | const Ref<GaussianBasisSet>& b3,
|
---|
| 159 | const Ref<GaussianBasisSet>& b4,
|
---|
| 160 | size_t storage):
|
---|
| 161 | TwoBodyDerivInt(integral,b1,b2,b3,b4)
|
---|
| 162 | {
|
---|
| 163 | int2ev3_ = new Int2eV3(integral,b1,b2,b3,b4,1,storage);
|
---|
| 164 | buffer_ = int2ev3_->buffer();
|
---|
| 165 | integral_->adjust_storage(int2ev3_->used_storage());
|
---|
| 166 | }
|
---|
| 167 |
|
---|
| 168 | TwoBodyDerivIntV3::~TwoBodyDerivIntV3()
|
---|
| 169 | {
|
---|
| 170 | integral_->adjust_storage(-int2ev3_->used_storage());
|
---|
| 171 | }
|
---|
| 172 |
|
---|
| 173 | void
|
---|
| 174 | TwoBodyDerivIntV3::compute_shell(int is, int js, int ks, int ls,
|
---|
| 175 | DerivCenters&c)
|
---|
| 176 | {
|
---|
| 177 | int center;
|
---|
| 178 | der_centersv3_t dercenters;
|
---|
| 179 | int sh[4], sz[4];
|
---|
| 180 |
|
---|
| 181 | sh[0]=is; sh[1]=js; sh[2]=ks; sh[3]=ls;
|
---|
| 182 |
|
---|
| 183 | int2ev3_->erep_all1der(sh,sz,&dercenters);
|
---|
| 184 |
|
---|
| 185 | c.clear();
|
---|
| 186 | for (int i=0; i<dercenters.n; i++) {
|
---|
| 187 | if (dercenters.cs[i] == int2ev3_->pcs1()) center = 0;
|
---|
| 188 | else if (dercenters.cs[i] == int2ev3_->pcs2()) center = 1;
|
---|
| 189 | else if (dercenters.cs[i] == int2ev3_->pcs3()) center = 2;
|
---|
| 190 | else center = 3;
|
---|
| 191 | c.add_center(center,dercenters.num[i]);
|
---|
| 192 | }
|
---|
| 193 | if (dercenters.n) {
|
---|
| 194 | if (dercenters.ocs == int2ev3_->pcs1()) center = 0;
|
---|
| 195 | else if (dercenters.ocs == int2ev3_->pcs2()) center = 1;
|
---|
| 196 | else if (dercenters.ocs == int2ev3_->pcs3()) center = 2;
|
---|
| 197 | else center = 3;
|
---|
| 198 | c.add_omitted(center,dercenters.onum);
|
---|
| 199 | }
|
---|
| 200 | }
|
---|
| 201 |
|
---|
| 202 |
|
---|
| 203 | int
|
---|
| 204 | TwoBodyDerivIntV3::log2_shell_bound(int is, int js, int ks, int ls)
|
---|
| 205 | {
|
---|
| 206 | return int2ev3_->erep_4bound_1der(is,js,ks,ls);
|
---|
| 207 | }
|
---|
| 208 |
|
---|
| 209 | /////////////////////////////////////////////////////////////////////////////
|
---|
| 210 |
|
---|
| 211 | // Local Variables:
|
---|
| 212 | // mode: c++
|
---|
| 213 | // c-file-style: "CLJ"
|
---|
| 214 | // End:
|
---|