source: ThirdParty/mpqc_open/src/lib/chemistry/qc/intv3/obintv3.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: 6.9 KB
Line 
1//
2// obintv3.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 <chemistry/qc/intv3/obintv3.h>
29
30using namespace sc;
31
32////////////////////////////////////////////////////////////////////////////
33// OneBodyIntV3
34
35OneBodyIntV3::OneBodyIntV3(Integral* integral,
36 const Ref<GaussianBasisSet>&bs1,
37 const Ref<GaussianBasisSet>&bs2,
38 IntegralFunction ifunc):
39 OneBodyInt(integral,bs1,bs2)
40{
41 int1ev3_ = new Int1eV3(integral,bs1,bs2,0);
42 intfunc_ = ifunc;
43 buffer_ = int1ev3_->buffer();
44}
45
46OneBodyIntV3::~OneBodyIntV3()
47{
48}
49
50void
51OneBodyIntV3::compute_shell(int i, int j)
52{
53 (int1ev3_.pointer()->*intfunc_)(i, j);
54}
55
56bool
57OneBodyIntV3::cloneable()
58{
59 return true;
60}
61
62Ref<OneBodyInt>
63OneBodyIntV3::clone()
64{
65 return new OneBodyIntV3(integral_, bs1_, bs2_, intfunc_);
66}
67
68////////////////////////////////////////////////////////////////////////////
69// PointChargeIntV3
70
71PointChargeIntV3::PointChargeIntV3(
72 Integral *integral,
73 const Ref<GaussianBasisSet>&bs1,
74 const Ref<GaussianBasisSet>&bs2,
75 const Ref<PointChargeData>&dat):
76 OneBodyInt(integral,bs1,bs2),
77 data_(dat)
78{
79 int1ev3_ = new Int1eV3(integral,bs1,bs2,0);
80 buffer_ = int1ev3_->buffer();
81}
82
83PointChargeIntV3::~PointChargeIntV3()
84{
85}
86
87void
88PointChargeIntV3::compute_shell(int i,int j)
89{
90 int1ev3_->point_charge(i,j,
91 data_->ncharges(),
92 data_->charges(),
93 data_->positions());
94}
95
96////////////////////////////////////////////////////////////////////////////
97// EfieldDotVectorIntV3
98
99EfieldDotVectorIntV3::EfieldDotVectorIntV3(
100 Integral *integral,
101 const Ref<GaussianBasisSet>&bs1,
102 const Ref<GaussianBasisSet>&bs2,
103 const Ref<EfieldDotVectorData>&dat) :
104 OneBodyInt(integral,bs1,bs2),
105 data_(dat)
106{
107 int1ev3_ = new Int1eV3(integral,bs1,bs2,0);
108 buffer_ = int1ev3_->buffer();
109}
110
111EfieldDotVectorIntV3::~EfieldDotVectorIntV3()
112{
113}
114
115void
116EfieldDotVectorIntV3::compute_shell(int i,int j)
117{
118 int nbfi = basis1()->shell(i).nfunction();
119 int nbfj = basis2()->shell(j).nfunction();
120 int nint = nbfi*nbfj;
121 double *tmp;
122 int ii,jj;
123
124 int1ev3_->efield(i,j,data_->position);
125
126 tmp = int1ev3_->buffer();
127 for (ii=0; ii<nint; ii++) {
128 double tmpval = 0.0;
129 for (jj=0; jj<3; jj++) {
130 tmpval += *tmp++ * data_->vector[jj];
131 }
132 buffer_[ii] = tmpval;
133 }
134}
135
136////////////////////////////////////////////////////////////////////////////
137// DipoleIntV3
138
139DipoleIntV3::DipoleIntV3(Integral *integral,
140 const Ref<GaussianBasisSet>&bs1,
141 const Ref<GaussianBasisSet>&bs2,
142 const Ref<DipoleData>&dat) :
143 OneBodyInt(integral,bs1,bs2),
144 data_(dat)
145{
146 int1ev3_ = new Int1eV3(integral,bs1,bs2,0);
147 buffer_ = int1ev3_->buffer();
148 if (data_.null()) {
149 data_ = new DipoleData;
150 }
151}
152
153DipoleIntV3::~DipoleIntV3()
154{
155}
156
157void
158DipoleIntV3::compute_shell(int i,int j)
159{
160 int1ev3_->dipole(i,j,data_->origin);
161}
162
163////////////////////////////////////////////////////////////////////////////
164// OneBodyDerivIntV3
165
166OneBodyDerivIntV3::OneBodyDerivIntV3(Integral *integral,
167 const Ref<GaussianBasisSet>&bs1,
168 const Ref<GaussianBasisSet>&bs2,
169 IntegralFunction ifunc):
170 OneBodyDerivInt(integral,bs1,bs2)
171{
172 int1ev3_ = new Int1eV3(integral,bs1,bs2,1);
173 intfunc_ = ifunc;
174 buffer_ = int1ev3_->buffer();
175}
176
177OneBodyDerivIntV3::~OneBodyDerivIntV3()
178{
179}
180
181void
182OneBodyDerivIntV3::compute_shell(int i, int j, DerivCenters& c)
183{
184 (int1ev3_.pointer()->*intfunc_)(i,j,0,basis1()->shell_to_center(i));
185 c.clear();
186 c.add_center(0,basis1(),i);
187 c.add_omitted(1,basis2(),j);
188
189// temporary debugging stuff for cca integrals comparison
190// if( 1 ) {
191// std::cerr << "buffer for shell doublet (with dc):\n";
192// std::cerr << "shellnum1: " << i << std::endl;
193// GaussianShell* s1 = &( bs1->shell(i) );
194// int nc1 = s1->ncontraction();
195// for (int ii=0; ii<nc1; ++ii)
196// std::cerr << "am: " << s1->am(ii) << std::endl;
197// std::cerr << "shellnum2: " << j << std::endl;
198// GaussianShell* s2 = &( bs2->shell(j) );
199// int nc2 = s2->ncontraction();
200// for (int ii=0; ii<nc2; ++ii)
201// std::cerr << "am: " << s2->am(ii) << std::endl;
202//
203// int nfunc = s1->max_cartesian() * s2->max_cartesian();
204// std::cerr << "dx\n";
205// for( int ii=0; ii<nfunc; ++ii)
206// std::cerr << buffer_[ii] << std::endl;
207// std::cerr << "dy\n";
208// for( int ii=nfunc; ii<nfunc*2; ++ii)
209// std::cerr << buffer_[ii] << std::endl;
210// std::cerr << "dz\n";
211// for( int ii=nfunc*2; ii<nfunc*3; ++ii)
212// std::cerr << buffer_[ii] << std::endl;
213// }
214
215}
216
217void
218OneBodyDerivIntV3::compute_shell(int i, int j, int c)
219{
220 (int1ev3_.pointer()->*intfunc_)(i,j,0,c);
221
222// temporary debuging stuff for cca integrals comparison
223// if( 1 ) {
224// std::cerr << "doing center " << c << std::endl;
225// std::cerr << "buffer for shell doublet:\n";
226// std::cerr << "shellnum1: " << i << std::endl;
227// GaussianShell* s1 = &( bs1->shell(i) );
228// int nc1 = s1->ncontraction();
229// for (int ii=0; ii<nc1; ++ii)
230// std::cerr << "am: " << s1->am(ii) << std::endl;
231// std::cerr << "shellnum2: " << j << std::endl;
232// GaussianShell* s2 = &( bs2->shell(j) );
233// int nc2 = s2->ncontraction();
234// for (int ii=0; ii<nc2; ++ii)
235// std::cerr << "am: " << s2->am(ii) << std::endl;
236//
237// int nfunc = s1->max_cartesian() * s2->max_cartesian();
238// std::cerr << "dx\n";
239// for( int ii=0; ii<nfunc; ++ii)
240// std::cerr << buffer_[ii] << std::endl;
241// std::cerr << "dy\n";
242// for( int ii=nfunc; ii<nfunc*2; ++ii)
243// std::cerr << buffer_[ii] << std::endl;
244// std::cerr << "dz\n";
245// for( int ii=nfunc*2; ii<nfunc*3; ++ii)
246// std::cerr << buffer_[ii] << std::endl;
247// }
248
249}
250
251/////////////////////////////////////////////////////////////////////////////
252
253// Local Variables:
254// mode: c++
255// c-file-style: "CLJ"
256// End:
Note: See TracBrowser for help on using the repository browser.