source: ThirdParty/mpqc_open/src/lib/chemistry/qc/intv3/tbintv3.cc@ 47b463

Action_Thermostats Add_AtomRandomPerturbation Add_RotateAroundBondAction Add_SelectAtomByNameAction Adding_Graph_to_ChangeBondActions Adding_MD_integration_tests Adding_StructOpt_integration_tests AutomationFragmentation_failures Candidate_v1.6.0 Candidate_v1.6.1 ChangeBugEmailaddress ChangingTestPorts ChemicalSpaceEvaluator Combining_Subpackages Debian_Package_split Debian_package_split_molecuildergui_only Disabling_MemDebug Docu_Python_wait EmpiricalPotential_contain_HomologyGraph_documentation Enable_parallel_make_install Enhance_userguide Enhanced_StructuralOptimization Enhanced_StructuralOptimization_continued Example_ManyWaysToTranslateAtom Exclude_Hydrogens_annealWithBondGraph FitPartialCharges_GlobalError Fix_ChronosMutex Fix_StatusMsg Fix_StepWorldTime_single_argument Fix_Verbose_Codepatterns ForceAnnealing_goodresults ForceAnnealing_oldresults ForceAnnealing_tocheck ForceAnnealing_with_BondGraph ForceAnnealing_with_BondGraph_continued ForceAnnealing_with_BondGraph_continued_betteresults ForceAnnealing_with_BondGraph_contraction-expansion GeometryObjects Gui_displays_atomic_force_velocity IndependentFragmentGrids_IntegrationTest JobMarket_RobustOnKillsSegFaults JobMarket_StableWorkerPool JobMarket_unresolvable_hostname_fix ODR_violation_mpqc_open PartialCharges_OrthogonalSummation PythonUI_with_named_parameters QtGui_reactivate_TimeChanged_changes Recreated_GuiChecks RotateToPrincipalAxisSystem_UndoRedo StoppableMakroAction Subpackage_levmar Subpackage_vmg ThirdParty_MPQC_rebuilt_buildsystem TremoloParser_IncreasedPrecision TremoloParser_MultipleTimesteps Ubuntu_1604_changes stable
Last change on this file since 47b463 was 860145, checked in by Frederik Heber <heber@…>, 8 years ago

Merge commit '0b990dfaa8c6007a996d030163a25f7f5fc8a7e7' as 'ThirdParty/mpqc_open'

  • Property mode set to 100644
File size: 5.8 KB
Line 
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
33using namespace sc;
34
35TwoBodyIntV3::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
48TwoBodyIntV3::~TwoBodyIntV3()
49{
50 integral_->adjust_storage(-int2ev3_->used_storage());
51}
52
53void
54TwoBodyIntV3::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
60int
61TwoBodyIntV3::log2_shell_bound(int is, int js, int ks, int ls)
62{
63 return int2ev3_->erep_4bound(is,js,ks,ls);
64}
65
66void
67TwoBodyIntV3::set_integral_storage(size_t storage)
68{
69 int2ev3_->init_storage(storage);
70}
71
72//////////////////////////////////////////////////////////////////////////
73
74TwoBodyThreeCenterIntV3::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
88TwoBodyThreeCenterIntV3::~TwoBodyThreeCenterIntV3()
89{
90 integral_->adjust_storage(-int2ev3_->used_storage());
91}
92
93void
94TwoBodyThreeCenterIntV3::compute_shell(int is, int js, int ks)
95{
96 int2ev3_->set_redundant(redundant());
97 int2ev3_->erep_3center(is,js,ks);
98}
99
100int
101TwoBodyThreeCenterIntV3::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
107void
108TwoBodyThreeCenterIntV3::set_integral_storage(size_t storage)
109{
110 int2ev3_->init_storage(storage);
111}
112
113//////////////////////////////////////////////////////////////////////////
114
115TwoBodyTwoCenterIntV3::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
128TwoBodyTwoCenterIntV3::~TwoBodyTwoCenterIntV3()
129{
130 integral_->adjust_storage(-int2ev3_->used_storage());
131}
132
133void
134TwoBodyTwoCenterIntV3::compute_shell(int is, int js)
135{
136 int2ev3_->set_redundant(redundant());
137 int2ev3_->erep_2center(is,js);
138}
139
140int
141TwoBodyTwoCenterIntV3::log2_shell_bound(int is, int js)
142{
143 throw std::runtime_error("TwoBodyTwoCenterIntv3: doesn't support bounds");
144 return 0;
145}
146
147void
148TwoBodyTwoCenterIntV3::set_integral_storage(size_t storage)
149{
150 int2ev3_->init_storage(storage);
151}
152
153//////////////////////////////////////////////////////////////////////////
154
155TwoBodyDerivIntV3::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
168TwoBodyDerivIntV3::~TwoBodyDerivIntV3()
169{
170 integral_->adjust_storage(-int2ev3_->used_storage());
171}
172
173void
174TwoBodyDerivIntV3::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
203int
204TwoBodyDerivIntV3::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:
Note: See TracBrowser for help on using the repository browser.