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-2018 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 
39  public:
40  typedef std::vector<simint_multi_shellpair> ShellPairVec;
41  typedef std::vector<simint_shell> ShellVec;
42 
43  SimintTwoElectronInt(const IntegralFactory* integral, int deriv = 0, bool use_shell_pairs = false);
44  virtual ~SimintTwoElectronInt();
45 
46  virtual size_t compute_shell(const AOShellCombinationsIterator&) override;
47 
48  virtual size_t compute_shell(int, int, int, int) override;
49 
50  virtual void compute_shell_blocks(int shellpair1, int shellpair2, int npair1 = -1, int npair2 = -1) override;
51 
52  virtual size_t compute_shell_deriv1(int, int, int, int);
53 
54  virtual size_t compute_shell_deriv2(int, int, int, int);
55 
56  protected:
58 
59  private:
60  void create_blocks(void);
61 
62  int maxam_;
63  size_t batchsize_;
64  size_t allwork_size_;
66 
67  double* allwork_;
68  double* sharedwork_;
69 
70  // plain simint shells
71  // WARNING - these may be shared across threads, so
72  // they are const to prevent issues with threads
73  // changing data from under another thread
74  std::shared_ptr<const ShellVec> shells1_;
75  std::shared_ptr<const ShellVec> shells2_;
76  std::shared_ptr<const ShellVec> shells3_;
77  std::shared_ptr<const ShellVec> shells4_;
78 
79  // my shell pairs
80  std::shared_ptr<const ShellPairVec> single_spairs_bra_;
81  std::shared_ptr<const ShellPairVec> single_spairs_ket_;
82  std::shared_ptr<const ShellPairVec> multi_spairs_bra_;
83  std::shared_ptr<const ShellPairVec> multi_spairs_ket_;
84 };
85 
87  protected:
88  SimintERI(const SimintERI& rhs);
89 
90  public:
91  virtual bool cloneable() const override { return true; };
92  virtual SimintERI* clone() const override { return new SimintERI(*this); }
93 
94  SimintERI(const IntegralFactory* integral, int deriv = 0, bool use_shell_pairs = false);
95 };
96 
97 } // namespace psi
98 
99 #endif
Definition: integral.h:223
std::vector< simint_shell > ShellVec
Definition: siminteri.h:41
std::shared_ptr< const ShellPairVec > multi_spairs_ket_
Definition: siminteri.h:83
std::shared_ptr< const ShellVec > shells1_
Definition: siminteri.h:74
void create_blocks(void)
Definition: siminteri.cc:381
bool bra_same_
Definition: siminteri.h:65
const IntegralFactory * integral() const
Returns the integral factory used to create this object.
Definition: twobody.h:150
std::shared_ptr< const ShellVec > shells2_
Definition: siminteri.h:75
double * sharedwork_
Definition: siminteri.h:68
Definition: twobody.h:60
bool braket_same_
Definition: siminteri.h:65
Definition: siminteri.h:86
virtual SimintERI * clone() const override
Returns a clone of this object. By default throws an exception.
Definition: siminteri.h:92
size_t allwork_size_
Definition: siminteri.h:64
virtual size_t compute_shell_deriv2(int, int, int, int)
Compute the second derivatives.
Definition: siminteri.cc:249
size_t batchsize_
Definition: siminteri.h:63
std::vector< simint_multi_shellpair > ShellPairVec
Definition: siminteri.h:40
SimintTwoElectronInt(const IntegralFactory *integral, int deriv=0, bool use_shell_pairs=false)
Definition: siminteri.cc:135
virtual size_t compute_shell_deriv1(int, int, int, int)
Compute the first derivatives.
Definition: siminteri.cc:245
std::shared_ptr< const ShellVec > shells3_
Definition: siminteri.h:76
std::shared_ptr< const ShellPairVec > single_spairs_bra_
Definition: siminteri.h:80
bool ket_same_
Definition: siminteri.h:65
std::shared_ptr< const ShellVec > shells4_
Definition: siminteri.h:77
std::shared_ptr< const ShellPairVec > multi_spairs_bra_
Definition: siminteri.h:82
std::shared_ptr< const ShellPairVec > single_spairs_ket_
Definition: siminteri.h:81
int maxam_
Definition: siminteri.h:62
virtual bool cloneable() const override
Return true if the clone member can be called. By default returns false.
Definition: siminteri.h:91
Definition: integral.h:374
virtual size_t compute_shell(const AOShellCombinationsIterator &) override
Compute ERIs between 4 shells. Result is stored in buffer.
Definition: siminteri.cc:241
double * allwork_
Definition: siminteri.h:67
virtual void compute_shell_blocks(int shellpair1, int shellpair2, int npair1=-1, int npair2=-1) override
Definition: siminteri.cc:303
int deriv() const
Returns the derivative level this object is setup for.
Definition: twobody.h:144
SimintERI(const SimintERI &rhs)
Definition: siminteri.cc:453
Definition: siminteri.h:38
virtual ~SimintTwoElectronInt()
Definition: siminteri.cc:235