[0b990d] | 1 | //
|
---|
| 2 | // gpetite.cc --- implementation of GPetite4 and helpers
|
---|
| 3 | //
|
---|
| 4 | // Copyright (C) 1996 Limit Point Systems, Inc.
|
---|
| 5 | //
|
---|
| 6 | // Author: Curtis Janssen <cljanss@ca.sandia.gov>
|
---|
| 7 | // Maintainer: SNL
|
---|
| 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 __GNUC__
|
---|
| 29 | #pragma implementation
|
---|
| 30 | #endif
|
---|
| 31 |
|
---|
| 32 | #include <util/misc/formio.h>
|
---|
| 33 |
|
---|
| 34 | #include <chemistry/qc/basis/basis.h>
|
---|
| 35 | #include <chemistry/qc/basis/gpetite.h>
|
---|
| 36 |
|
---|
| 37 | using namespace std;
|
---|
| 38 | using namespace sc;
|
---|
| 39 |
|
---|
| 40 | ////////////////////////////////////////////////////////////////////////////
|
---|
| 41 |
|
---|
| 42 | canonical_aaaa::canonical_aaaa()
|
---|
| 43 | {
|
---|
| 44 | }
|
---|
| 45 |
|
---|
| 46 | canonical_aaaa::canonical_aaaa(const Ref<GaussianBasisSet> bi,
|
---|
| 47 | const Ref<GaussianBasisSet> bj,
|
---|
| 48 | const Ref<GaussianBasisSet> bk,
|
---|
| 49 | const Ref<GaussianBasisSet> bl)
|
---|
| 50 | {
|
---|
| 51 | }
|
---|
| 52 |
|
---|
| 53 | ////////////////////////////////////////////////////////////////////////////
|
---|
| 54 |
|
---|
| 55 | canonical_aabc::canonical_aabc(const Ref<GaussianBasisSet> bi,
|
---|
| 56 | const Ref<GaussianBasisSet> bj,
|
---|
| 57 | const Ref<GaussianBasisSet> bk,
|
---|
| 58 | const Ref<GaussianBasisSet> bl)
|
---|
| 59 | {
|
---|
| 60 | nk_ = bk->nshell();
|
---|
| 61 | nl_ = bl->nshell();
|
---|
| 62 | }
|
---|
| 63 |
|
---|
| 64 | ////////////////////////////////////////////////////////////////////////////
|
---|
| 65 |
|
---|
| 66 |
|
---|
| 67 | canonical_aabb::canonical_aabb(const Ref<GaussianBasisSet> bi,
|
---|
| 68 | const Ref<GaussianBasisSet> bj,
|
---|
| 69 | const Ref<GaussianBasisSet> bk,
|
---|
| 70 | const Ref<GaussianBasisSet> bl)
|
---|
| 71 | {
|
---|
| 72 | int ni = bi->nshell();
|
---|
| 73 | nij_ = (ni*long(ni+1))>>1;
|
---|
| 74 | }
|
---|
| 75 |
|
---|
| 76 | ////////////////////////////////////////////////////////////////////////////
|
---|
| 77 |
|
---|
| 78 | canonical_abcd::canonical_abcd(const Ref<GaussianBasisSet> bi,
|
---|
| 79 | const Ref<GaussianBasisSet> bj,
|
---|
| 80 | const Ref<GaussianBasisSet> bk,
|
---|
| 81 | const Ref<GaussianBasisSet> bl)
|
---|
| 82 | {
|
---|
| 83 | ni_ = bi->nshell();
|
---|
| 84 | nj_ = bj->nshell();
|
---|
| 85 | nk_ = bk->nshell();
|
---|
| 86 | }
|
---|
| 87 |
|
---|
| 88 |
|
---|
| 89 | /////////////////////////////////////////////////////////////////////////////
|
---|
| 90 |
|
---|
| 91 | GenPetite4::GenPetite4(const Ref<GaussianBasisSet> &b1,
|
---|
| 92 | const Ref<GaussianBasisSet> &b2,
|
---|
| 93 | const Ref<GaussianBasisSet> &b3,
|
---|
| 94 | const Ref<GaussianBasisSet> &b4)
|
---|
| 95 | {
|
---|
| 96 | int **atom_map;
|
---|
| 97 | b1_ = b1;
|
---|
| 98 | b2_ = b2;
|
---|
| 99 | b3_ = b3;
|
---|
| 100 | b4_ = b4;
|
---|
| 101 |
|
---|
| 102 | ng_ = b1->molecule()->point_group()->char_table().order();
|
---|
| 103 | if (b2->molecule()->point_group()->char_table().order() != ng_
|
---|
| 104 | || b3->molecule()->point_group()->char_table().order() != ng_
|
---|
| 105 | || b4->molecule()->point_group()->char_table().order() != ng_) {
|
---|
| 106 | throw std::runtime_error("GPetite4: not all point groups are the same");
|
---|
| 107 | }
|
---|
| 108 | c1_ = (ng_ == 1);
|
---|
| 109 |
|
---|
| 110 | atom_map = compute_atom_map(b1);
|
---|
| 111 | shell_map_i_ = compute_shell_map(atom_map,b1);
|
---|
| 112 | delete_atom_map(atom_map,b1);
|
---|
| 113 |
|
---|
| 114 | atom_map = compute_atom_map(b2);
|
---|
| 115 | shell_map_j_ = compute_shell_map(atom_map,b2);
|
---|
| 116 | delete_atom_map(atom_map,b2);
|
---|
| 117 |
|
---|
| 118 | atom_map = compute_atom_map(b3);
|
---|
| 119 | shell_map_k_ = compute_shell_map(atom_map,b3);
|
---|
| 120 | delete_atom_map(atom_map,b3);
|
---|
| 121 |
|
---|
| 122 | atom_map = compute_atom_map(b4);
|
---|
| 123 | shell_map_l_ = compute_shell_map(atom_map,b4);
|
---|
| 124 | delete_atom_map(atom_map,b4);
|
---|
| 125 | }
|
---|
| 126 |
|
---|
| 127 | GenPetite4::~GenPetite4() {
|
---|
| 128 | delete_shell_map(shell_map_i_,b1_);
|
---|
| 129 | delete_shell_map(shell_map_j_,b2_);
|
---|
| 130 | delete_shell_map(shell_map_k_,b3_);
|
---|
| 131 | delete_shell_map(shell_map_l_,b4_);
|
---|
| 132 | }
|
---|
| 133 |
|
---|
| 134 | /////////////////////////////////////////////////////////////////////////////
|
---|
| 135 |
|
---|
| 136 | template <class C4> GPetite4<C4>::GPetite4(const Ref<GaussianBasisSet> &b1,
|
---|
| 137 | const Ref<GaussianBasisSet> &b2,
|
---|
| 138 | const Ref<GaussianBasisSet> &b3,
|
---|
| 139 | const Ref<GaussianBasisSet> &b4,
|
---|
| 140 | const C4& c): GenPetite4(b1,b2,b3,b4), c_(c)
|
---|
| 141 | {
|
---|
| 142 | }
|
---|
| 143 |
|
---|
| 144 | template <class C4> GPetite4<C4>::~GPetite4()
|
---|
| 145 | {
|
---|
| 146 | }
|
---|
| 147 |
|
---|
| 148 | /////////////////////////////////////////////////////////////////////////////
|
---|
| 149 |
|
---|
| 150 | Ref<GenPetite4>
|
---|
| 151 | sc::construct_gpetite(const Ref<GaussianBasisSet> &b1,
|
---|
| 152 | const Ref<GaussianBasisSet> &b2,
|
---|
| 153 | const Ref<GaussianBasisSet> &b3,
|
---|
| 154 | const Ref<GaussianBasisSet> &b4)
|
---|
| 155 | {
|
---|
| 156 | if (b1 == b2 && b1 == b3 && b1 == b4) {
|
---|
| 157 | canonical_aaaa c4(b1,b2,b3,b4);
|
---|
| 158 | return new GPetite4<canonical_aaaa>(b1,b2,b3,b4,c4);
|
---|
| 159 | }
|
---|
| 160 | else if (b1 == b2 && b3 != b4) {
|
---|
| 161 | canonical_aabc c4(b1,b2,b3,b4);
|
---|
| 162 | return new GPetite4<canonical_aabc>(b1,b2,b3,b4,c4);
|
---|
| 163 | }
|
---|
| 164 | else if (b1 == b2 && b3 == b4) {
|
---|
| 165 | canonical_aabb c4(b1,b2,b3,b4);
|
---|
| 166 | return new GPetite4<canonical_aabb>(b1,b2,b3,b4,c4);
|
---|
| 167 | }
|
---|
| 168 | else {
|
---|
| 169 | canonical_abcd c4(b1,b2,b3,b4);
|
---|
| 170 | return new GPetite4<canonical_abcd>(b1,b2,b3,b4,c4);
|
---|
| 171 | }
|
---|
| 172 | }
|
---|
| 173 |
|
---|
| 174 | /////////////////////////////////////////////////////////////////////////////
|
---|
| 175 |
|
---|
| 176 | // Local Variables:
|
---|
| 177 | // mode: c++
|
---|
| 178 | // c-file-style: "ETS"
|
---|
| 179 | // End:
|
---|