ergo
integral_info.h
Go to the documentation of this file.
1 /* Ergo, version 3.7, a program for linear scaling electronic structure
2  * calculations.
3  * Copyright (C) 2018 Elias Rudberg, Emanuel H. Rubensson, Pawel Salek,
4  * and Anastasia Kruchinina.
5  *
6  * This program is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program. If not, see <http://www.gnu.org/licenses/>.
18  *
19  * Primary academic reference:
20  * Ergo: An open-source program for linear-scaling electronic structure
21  * calculations,
22  * Elias Rudberg, Emanuel H. Rubensson, Pawel Salek, and Anastasia
23  * Kruchinina,
24  * SoftwareX 7, 107 (2018),
25  * <http://dx.doi.org/10.1016/j.softx.2018.03.005>
26  *
27  * For further information about Ergo, see <http://www.ergoscf.org>.
28  */
29 
38 #ifndef BASISINFO_BASIC_HEADER
39 #define BASISINFO_BASIC_HEADER
40 
41 
42 #include "realtype.h"
43 #include "monomial_info.h"
45 #include "boysfunction.h"
46 #include "multipole_prep.h"
47 #include "mm_limit_table.h"
48 
49 #ifndef BASIS_FUNC_POLY_MAX_DEGREE
50 #error The constant BASIS_FUNC_POLY_MAX_DEGREE must be defined.
51 #endif
52 #if BASIS_FUNC_POLY_MAX_DEGREE<6
53 #define MAX_NO_OF_TERMS_IN_BASIS_FUNC_POLY 12
54 #define MAX_NO_OF_POLY_12_TERMS 180
55 #define MAX_NO_OF_BASIS_FUNC_POLYS 50
56 #else
57 #define MAX_NO_OF_TERMS_IN_BASIS_FUNC_POLY 16
58 #define MAX_NO_OF_POLY_12_TERMS 360
59 #define MAX_NO_OF_BASIS_FUNC_POLYS 100
60 #endif
61 
62 typedef struct
63 {
65  char monomialInts[4]; /* nx, ny, nz */
68 
69 typedef struct
70 {
71  int noOfTerms;
75 
76 typedef struct
77 {
78  int id_1;
79  int id_2;
82 
83 typedef struct
84 {
85  int noOfTerms;
88 
94 {
95  private:
101  IntegralInfo(); // This is to make it forbidden to create it without argument.
102  public:
106  void init();
107  ergo_real BoysFunction(int n, ergo_real x) const;
108  ergo_real BoysFunction_expensive(int n, ergo_real x, int noOfIntegrationIntervals) const;
110  const MMLimitTable & GetMMLimitTable() const { return mmLimitTable; }
112  int n2max,
113  ergo_real a,
114  ergo_real* A,
115  ergo_real* result) const;
117  int n2max,
118  ergo_real a,
119  ergo_real* A,
120  ergo_real* result) const;
122  ergo_real a,
123  ergo_real* result) const;
125  ergo_real a,
126  ergo_real* result) const;
128  ergo_real a,
129  i_j_val_struct* result) const;
130 
131  IntegralInfo(bool initialize);
132  ~IntegralInfo();
133 
134  // Stuff needed for Chunks&Tasks usage
135  IntegralInfo(const IntegralInfo & ii);
136  void write_to_buffer ( char * dataBuffer, size_t const bufferSize ) const;
137  size_t get_size() const;
138  void assign_from_buffer ( char const * dataBuffer, size_t const bufferSize);
139 };
140 
141 
142 namespace JK {
143 /* Struct ExchWeights holds parameters for CAM-style range-separated HF
144  exchange. We use the following short-long range split
145  (alpha+beta*erf(mu*r))*HF_exchange.
146  */
148 {
155  alpha(0),
156  beta(0),
157  mu(0),
159  {}
160 
161 };
162 
163 }
164 
165 
166 int get_poly_info_from_shell_type(int* polyid_start, int* poly_count, int shellType);
167 
169 
170 int get_shell_type_from_basis_func_poly_id(int basfuncpolyid);
171 
172 
173 #endif
#define A
Definition: monomial_info.h:57
BoysFunctionManager boysFunctionManager
Definition: integral_info.h:96
double ergo_real
Definition: realtype.h:69
#define MAX_NO_OF_TERMS_IN_BASIS_FUNC_POLY
Definition: integral_info.h:53
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:261
MultipolePrepManager multipolePrep
Definition: integral_info.h:97
ergo_real mu
Definition: integral_info.h:151
int id_2
Definition: integral_info.h:79
This file contains preparatory stuff for computing multipole moments and related things.
int noOfTerms
Definition: integral_info.h:71
~IntegralInfo()
Definition: integral_info.cc:312
ExchWeights()
Definition: integral_info.h:154
#define MAX_NO_OF_POLY_12_TERMS
Definition: integral_info.h:54
Definition: integral_info.h:69
int monomialID
Definition: integral_info.h:66
int noOfTerms
Definition: integral_info.h:85
ergo_real coeff
Definition: integral_info.h:64
ergo_real beta
Definition: integral_info.h:150
Definition: simple_sparse_mat.h:42
Definition: integral_info.h:147
ergo_real BoysFunction_expensive(int n, ergo_real x, int noOfIntegrationIntervals) const
Definition: integral_info.cc:249
Definition: multipole_prep.h:69
Definition of the main floating-point datatype used; the ergo_real type.
MMLimitTable class used to predict the magnitude of contributions when using truncated multipole expa...
Contains coefficients needed for quick integral evaluation.
Definition: integral_info.h:93
int get_no_of_basis_func_polys_used_from_no_of_shell_types(int no_of_shell_types)
int id_1
Definition: integral_info.h:78
hermite_conversion_info_struct hermite_conversion_info
Definition: integral_info.h:99
Code used to organize monomials; contributions like x, y, z, xy, xz etc.
size_t get_size() const
Function needed for Chunks&Tasks usage.
Definition: integral_info.cc:365
monomial_info_struct monomial_info
Definition: integral_info.h:105
void assign_from_buffer(char const *dataBuffer, size_t const bufferSize)
Function needed for Chunks&Tasks usage.
Definition: integral_info.cc:377
int get_poly_info_from_shell_type(int *polyid_start, int *poly_count, int shellType)
Definition: hermite_conversion_prep.h:71
bool initialized
Definition: integral_info.h:100
Code for Boys function evaluation.
ergo_real BoysFunction(int n, ergo_real x) const
Definition: integral_info.cc:243
Definition: integral_info.h:62
basis_func_poly_struct basis_func_poly_list[MAX_NO_OF_BASIS_FUNC_POLYS]
Definition: integral_info.h:103
#define MAX_NO_OF_BASIS_FUNC_POLYS
Definition: integral_info.h:55
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:253
int get_shell_type_from_basis_func_poly_id(int basfuncpolyid)
Definition: integral_info.h:142
void init()
Definition: integral_info.cc:287
void write_to_buffer(char *dataBuffer, size_t const bufferSize) const
Function needed for Chunks&Tasks usage.
Definition: integral_info.cc:331
int computeRangeSeparatedExchange
shortcut for |beta| != 0
Definition: integral_info.h:152
ergo_real scaledSolidHarmonicPrefactor
Definition: integral_info.h:73
const MultipolePrepManager & GetMultipolePrep() const
Definition: integral_info.h:109
const MMLimitTable & GetMMLimitTable() const
Definition: integral_info.h:110
int get_hermite_conversion_matrix_right(int nmax, ergo_real a, ergo_real *result) const
Definition: integral_info.cc:269
Code for conversion between integrals computed for Hermite Gaussians and Cartesian Gaussians...
int no_of_basis_func_polys
Definition: integral_info.h:104
Definition: integral_info.h:76
ergo_real coeff
Definition: integral_info.h:80
MMLimitTable mmLimitTable
Definition: integral_info.h:98
ergo_real alpha
Definition: integral_info.h:149
Definition: boysfunction.h:73
int get_hermite_conversion_matrix_left(int nmax, ergo_real a, ergo_real *result) const
Definition: integral_info.cc:275
Definition: integral_info.h:83
int get_hermite_conversion_matrix_right_sparse(int nmax, ergo_real a, i_j_val_struct *result) const
Definition: integral_info.cc:281
Definition: mm_limit_table.h:45