Psi4
siminteri.h
Go to the documentation of this file.
1 /*
2  * @BEGIN LICENSE
3  *
4  * Psi4: an open-source quantum chemistry software package
5  *
6  * Copyright (c) 2007-2016 The Psi4 Developers.
7  *
8  * The copyrights for code used from other parties are included in
9  * the corresponding files.
10  *
11  * This program is free software; you can redistribute it and/or modify
12  * it under the terms of the GNU General Public License as published by
13  * the Free Software Foundation; either version 2 of the License, or
14  * (at your option) any later version.
15  *
16  * This program 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 General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License along
22  * with this program; if not, write to the Free Software Foundation, Inc.,
23  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24  *
25  * @END LICENSE
26  */
27 
28 #ifndef _psi4_libmints_siminteri_h
29 #define _psi4_libmints_siminteri_h
30 
31 #include "psi4/libmints/twobody.h"
32 
33 #include <simint/simint.h>
34 
35 namespace psi {
36 
37 
39 {
40  public:
41  typedef std::vector<simint_multi_shellpair> ShellPairVec;
42  typedef std::vector<simint_shell> ShellVec;
43 
44  SimintTwoElectronInt(const IntegralFactory * integral, int deriv=0, bool use_shell_pairs=false);
45  virtual ~SimintTwoElectronInt();
46 
47  virtual size_t compute_shell(const AOShellCombinationsIterator&) override;
48 
49  virtual size_t compute_shell(int, int, int, int) override;
50 
51  virtual void
52  compute_shell_blocks(int shellpair1, int shellpair2,
53  int npair1 = -1, int npair2 = -1) override;
54 
55  virtual size_t compute_shell_deriv1(int, int, int, int);
56 
57  virtual size_t compute_shell_deriv2(int, int, int, int);
58 
59  protected:
61 
62  private:
63  void create_blocks(void);
64 
65  int maxam_;
66  size_t batchsize_;
67  size_t allwork_size_;
69 
70  double * allwork_;
71  double * sharedwork_;
72 
73  // plain simint shells
74  // WARNING - these may be shared across threads, so
75  // they are const to prevent issues with threads
76  // changing data from under another thread
77  std::shared_ptr<const ShellVec> shells1_;
78  std::shared_ptr<const ShellVec> shells2_;
79  std::shared_ptr<const ShellVec> shells3_;
80  std::shared_ptr<const ShellVec> shells4_;
81 
82  // my shell pairs
83  std::shared_ptr<const ShellPairVec> single_spairs_bra_;
84  std::shared_ptr<const ShellPairVec> single_spairs_ket_;
85  std::shared_ptr<const ShellPairVec> multi_spairs_bra_;
86  std::shared_ptr<const ShellPairVec> multi_spairs_ket_;
87 
88 
89 };
90 
91 
93 {
94  protected:
95  SimintERI(const SimintERI & rhs);
96 
97  public:
98  virtual bool cloneable() const override { return true; };
99  virtual SimintERI * clone() const override { return new SimintERI(*this); }
100 
101  SimintERI(const IntegralFactory * integral, int deriv=0, bool use_shell_pairs=false);
102 };
103 
104 
105 
106 }
107 
108 #endif
Definition: integral.h:228
std::vector< simint_shell > ShellVec
Definition: siminteri.h:42
std::shared_ptr< const ShellPairVec > multi_spairs_ket_
Definition: siminteri.h:86
std::shared_ptr< const ShellVec > shells1_
Definition: siminteri.h:77
void create_blocks(void)
Definition: siminteri.cc:441
bool bra_same_
Definition: siminteri.h:68
const IntegralFactory * integral() const
Returns the integral factory used to create this object.
Definition: twobody.h:153
std::shared_ptr< const ShellVec > shells2_
Definition: siminteri.h:78
double * sharedwork_
Definition: siminteri.h:71
Definition: twobody.h:60
bool braket_same_
Definition: siminteri.h:68
Definition: siminteri.h:92
virtual SimintERI * clone() const override
Returns a clone of this object. By default throws an exception.
Definition: siminteri.h:99
size_t allwork_size_
Definition: siminteri.h:67
virtual size_t compute_shell_deriv2(int, int, int, int)
Compute the second derivatives.
Definition: siminteri.cc:286
size_t batchsize_
Definition: siminteri.h:66
std::vector< simint_multi_shellpair > ShellPairVec
Definition: siminteri.h:41
SimintTwoElectronInt(const IntegralFactory *integral, int deriv=0, bool use_shell_pairs=false)
Definition: siminteri.cc:162
virtual size_t compute_shell_deriv1(int, int, int, int)
Compute the first derivatives.
Definition: siminteri.cc:281
std::shared_ptr< const ShellVec > shells3_
Definition: siminteri.h:79
std::shared_ptr< const ShellPairVec > single_spairs_bra_
Definition: siminteri.h:83
bool ket_same_
Definition: siminteri.h:68
std::shared_ptr< const ShellVec > shells4_
Definition: siminteri.h:80
std::shared_ptr< const ShellPairVec > multi_spairs_bra_
Definition: siminteri.h:85
std::shared_ptr< const ShellPairVec > single_spairs_ket_
Definition: siminteri.h:84
int maxam_
Definition: siminteri.h:65
virtual bool cloneable() const override
Return true if the clone member can be called. By default returns false.
Definition: siminteri.h:98
Definition: integral.h:385
virtual size_t compute_shell(const AOShellCombinationsIterator &) override
Compute ERIs between 4 shells. Result is stored in buffer.
Definition: siminteri.cc:276
double * allwork_
Definition: siminteri.h:70
virtual void compute_shell_blocks(int shellpair1, int shellpair2, int npair1=-1, int npair2=-1) override
Definition: siminteri.cc:351
int deriv() const
Returns the derivative level this object is setup for.
Definition: twobody.h:147
SimintERI(const SimintERI &rhs)
Definition: siminteri.cc:531
Definition: siminteri.h:38
virtual ~SimintTwoElectronInt()
Definition: siminteri.cc:268