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