ergo
integral_info.h
Go to the documentation of this file.
1 /* Ergo, version 3.4, a program for linear scaling electronic structure
2  * calculations.
3  * Copyright (C) 2014 Elias Rudberg, Emanuel H. Rubensson, and Pawel Salek.
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  *
18  * Primary academic reference:
19  * Kohn−Sham Density Functional Theory Electronic Structure Calculations
20  * with Linearly Scaling Computational Time and Memory Usage,
21  * Elias Rudberg, Emanuel H. Rubensson, and Pawel Salek,
22  * J. Chem. Theory Comput. 7, 340 (2011),
23  * <http://dx.doi.org/10.1021/ct100611z>
24  *
25  * For further information about Ergo, see <http://www.ergoscf.org>.
26  */
27 
28 #ifndef BASISINFO_BASIC_HEADER
29 #define BASISINFO_BASIC_HEADER
30 
31 
32 #include "realtype.h"
33 #include "monomial_info.h"
35 #include "boysfunction.h"
36 
37 #ifndef BASIS_FUNC_POLY_MAX_DEGREE
38 #error The constant BASIS_FUNC_POLY_MAX_DEGREE must be defined.
39 #endif
40 #if BASIS_FUNC_POLY_MAX_DEGREE<6
41 #define MAX_NO_OF_TERMS_IN_BASIS_FUNC_POLY 12
42 #define MAX_NO_OF_POLY_12_TERMS 180
43 #define MAX_NO_OF_BASIS_FUNC_POLYS 50
44 #else
45 #define MAX_NO_OF_TERMS_IN_BASIS_FUNC_POLY 16
46 #define MAX_NO_OF_POLY_12_TERMS 360
47 #define MAX_NO_OF_BASIS_FUNC_POLYS 100
48 #endif
49 
50 typedef struct
51 {
53  char monomialInts[4]; /* nx, ny, nz */
56 
57 typedef struct
58 {
59  int noOfTerms;
63 
64 typedef struct
65 {
66  int id_1;
67  int id_2;
70 
71 typedef struct
72 {
73  int noOfTerms;
76 
82 {
83  private:
87  IntegralInfo(); // This is to make it forbidden to create it without argument.
88  public:
92  void init();
93  ergo_real BoysFunction(int n, ergo_real x) const;
95  int n2max,
96  ergo_real a,
97  ergo_real* A,
98  ergo_real* result) const;
100  int n2max,
101  ergo_real a,
102  ergo_real* A,
103  ergo_real* result) const;
105  ergo_real a,
106  ergo_real* result) const;
108  ergo_real a,
109  ergo_real* result) const;
111  ergo_real a,
112  i_j_val_struct* result) const;
113 
114  IntegralInfo(bool initialize);
115  ~IntegralInfo();
116 
117  // Stuff needed for Chunks&Tasks usage
118  IntegralInfo(const IntegralInfo & ii);
119  void write_to_buffer ( char * dataBuffer, size_t const bufferSize ) const;
120  size_t get_size() const;
121  void assign_from_buffer ( char const * dataBuffer, size_t const bufferSize);
122 };
123 
124 
125 namespace JK {
126 /* Struct ExchWeights holds parameters for CAM-style range-separated HF
127  exchange. We use the following short-long range split
128  (alpha+beta*erf(mu*r))*HF_exchange.
129  */
131 {
138  alpha(0),
139  beta(0),
140  mu(0),
141  computeRangeSeparatedExchange(0)
142  {}
143 
144 };
145 
146 };
147 
148 
149 int get_poly_info_from_shell_type(int* polyid_start, int* poly_count, int shellType);
150 
152 
153 int get_shell_type_from_basis_func_poly_id(int basfuncpolyid);
154 
155 
156 #endif
#define A
Definition: monomial_info.h:46
BoysFunctionManager boysFunctionManager
Definition: integral_info.h:84
double ergo_real
Definition: realtype.h:53
#define MAX_NO_OF_TERMS_IN_BASIS_FUNC_POLY
Definition: integral_info.h:41
int get_hermite_conversion_matrix_right_sparse(int nmax, ergo_real a, i_j_val_struct *result) const
Definition: integral_info.cc:272
ergo_real mu
Definition: integral_info.h:134
int id_2
Definition: integral_info.h:67
int noOfTerms
Definition: integral_info.h:59
~IntegralInfo()
Definition: integral_info.cc:299
ExchWeights()
Definition: integral_info.h:137
#define MAX_NO_OF_POLY_12_TERMS
Definition: integral_info.h:42
Definition: integral_info.h:57
int monomialID
Definition: integral_info.h:54
int noOfTerms
Definition: integral_info.h:73
ergo_real coeff
Definition: integral_info.h:52
ergo_real beta
Definition: integral_info.h:133
int get_hermite_conversion_matrix_left(int nmax, ergo_real a, ergo_real *result) const
Definition: integral_info.cc:266
Definition: simple_sparse_mat.h:32
Definition: integral_info.h:130
Contains coefficients needed for quick integral evaluation.
Definition: integral_info.h:81
int get_no_of_basis_func_polys_used_from_no_of_shell_types(int no_of_shell_types)
void write_to_buffer(char *dataBuffer, size_t const bufferSize) const
Function needed for Chunks&Tasks usage.
Definition: integral_info.cc:316
int id_1
Definition: integral_info.h:66
hermite_conversion_info_struct hermite_conversion_info
Definition: integral_info.h:85
int multiply_by_hermite_conversion_matrix_from_right(int n1max, int n2max, ergo_real a, ergo_real *A, ergo_real *result) const
Definition: integral_info.cc:244
monomial_info_struct monomial_info
Definition: integral_info.h:91
void assign_from_buffer(char const *dataBuffer, size_t const bufferSize)
Function needed for Chunks&Tasks usage.
Definition: integral_info.cc:354
int get_poly_info_from_shell_type(int *polyid_start, int *poly_count, int shellType)
Definition: hermite_conversion_prep.h:60
bool initialized
Definition: integral_info.h:86
int multiply_by_hermite_conversion_matrix_from_left(int n1max, int n2max, ergo_real a, ergo_real *A, ergo_real *result) const
Definition: integral_info.cc:252
Definition: integral_info.h:50
basis_func_poly_struct basis_func_poly_list[MAX_NO_OF_BASIS_FUNC_POLYS]
Definition: integral_info.h:89
#define MAX_NO_OF_BASIS_FUNC_POLYS
Definition: integral_info.h:43
int get_shell_type_from_basis_func_poly_id(int basfuncpolyid)
Definition: integral_info.h:125
void init()
Definition: integral_info.cc:278
int get_hermite_conversion_matrix_right(int nmax, ergo_real a, ergo_real *result) const
Definition: integral_info.cc:260
int computeRangeSeparatedExchange
shortcut for |beta| != 0
Definition: integral_info.h:135
ergo_real scaledSolidHarmonicPrefactor
Definition: integral_info.h:61
int no_of_basis_func_polys
Definition: integral_info.h:90
Definition: integral_info.h:64
ergo_real coeff
Definition: integral_info.h:68
size_t get_size() const
Function needed for Chunks&Tasks usage.
Definition: integral_info.cc:344
ergo_real BoysFunction(int n, ergo_real x) const
Definition: integral_info.cc:238
ergo_real alpha
Definition: integral_info.h:132
Definition: boysfunction.h:47
Definition: integral_info.h:71