ergo
integrals_2el_utils.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 INTEGRALS_2EL_UTILS_HEADER
29 #define INTEGRALS_2EL_UTILS_HEADER
30 
31 
32 #include "organize_distrs.h"
33 #include "box_system.h"
34 
35 
43 };
44 
45 
46 #define MAX_NO_OF_BRANCHES 10
47 
48 
49 typedef struct
50 {
53  ergo_real maxMomentVectorNormList[MAX_MULTIPOLE_DEGREE_BASIC+1];
56 
57 
58 struct box_struct {
63  int branchIndexList[MAX_NO_OF_BRANCHES];
64  int branchCountList[MAX_NO_OF_BRANCHES];
68  ergo_real largestCSfactor; // Largest Cauchy-Schwartz factor in box
69  ergo_real multipoleEuclideanNormList[MAX_MULTIPOLE_DEGREE_BASIC+1];
70  box_struct();
71 };
72 
73 
74 typedef struct
75 {
80  ergo_real* partial_dmat_2; // used in non-symmetric case
82  ergo_real* partial_K_2; // used in non-symmetric case
84 
85 
86 
87 
88 ergo_real get_max_abs_vector_element(int n, const ergo_real* vector);
89 
90 void
92  int maxNoOfMonomials,
93  int basisFuncListCount_max,
94  JK_contribs_buffer_struct* bufferStruct);
95 
96 void
98 
99 int
100 get_related_integrals_h(const IntegralInfo & integralInfo,
101  const JK::ExchWeights & CAM_params,
102  int n1max, int noOfMonomials_1,
103  int n2max, int noOfMonomials_2,
104  ergo_real dx0,
105  ergo_real dx1,
106  ergo_real dx2,
107  ergo_real alpha1,
108  ergo_real alpha2,
109  ergo_real alpha0,
110  ergo_real* primitiveIntegralList,
111  ergo_real* primitiveIntegralList_work,
112  ergo_real resultPreFactor);
113 
114 void
117  ergo_real threshold,
118  ergo_real maxLimitingFactor,
119  ergo_real maxabsDmatelement);
120 
121 int
123  const IntegralInfo & integralInfo,
124  ergo_real threshold,
125  ergo_real* resultMaxLimitingFactor,
126  ergo_real maxDensityMatrixElement);
127 
128 int
130  const IntegralInfo & integralInfo,
131  ergo_real threshold,
132  DistributionSpecStructLabeled* resultList,
133  int maxCountDistrs,
134  ergo_real maxLimitingFactor,
135  const ergo_real* dens,
136  ergo_real maxDensityMatrixElement);
137 
138 int
141  ergo_real toplevelBoxSize,
142  BoxSystem & boxSystem);
143 
144 
145 
146 #endif
void free_buffers_needed_by_integral_code(JK_contribs_buffer_struct *bufferStruct)
Definition: integrals_2el_utils.cc:105
double ergo_real
Definition: realtype.h:53
ergo_real largestCSfactor
Definition: integrals_2el_utils.h:68
void allocate_buffers_needed_by_integral_code(const IntegralInfo &integralInfo, int maxNoOfMonomials, int basisFuncListCount_max, JK_contribs_buffer_struct *bufferStruct)
Definition: integrals_2el_utils.cc:79
Definition: box_system.h:42
ergo_real max_CS_factor
Definition: integrals_2el_utils.h:52
ergo_real * partial_dmat_2
Definition: integrals_2el_utils.h:80
box_struct_basic basicBox
Definition: integrals_2el_utils.h:59
basis_func_group_info_for_box * basisFuncGroupInfoList
Definition: integrals_2el_utils.h:67
distr_list_description_struct()
Definition: integrals_2el_utils.cc:54
multipole_struct_large multipole
Definition: integrals_2el_utils.h:40
int noOfBasisFuncs
Definition: integrals_2el_utils.h:65
int create_box_system_and_reorder_distrs(int distrCount, DistributionSpecStructLabeled *distrList, ergo_real toplevelBoxSize, BoxSystem &boxSystem)
Definition: integrals_2el_utils.cc:461
Definition: integral_info.h:130
int basisFuncGroupIndex
Definition: integrals_2el_utils.h:51
ergo_real get_max_abs_vector_element(int n, const ergo_real *vector)
Definition: integrals_2el_utils.cc:39
Contains coefficients needed for quick integral evaluation.
Definition: integral_info.h:81
int get_list_of_labeled_distrs_maxLimitingFactor(const BasisInfoStruct &basisInfo, const IntegralInfo &integralInfo, ergo_real threshold, ergo_real *resultMaxLimitingFactor, ergo_real maxDensityMatrixElement)
Definition: integrals_2el_utils.cc:222
ergo_real * partial_K_2
Definition: integrals_2el_utils.h:82
#define MAX_NO_OF_BRANCHES
Definition: integrals_2el_utils.h:46
Definition: integrals_2el_utils.h:58
int get_list_of_labeled_distrs(const BasisInfoStruct &basisInfo, const IntegralInfo &integralInfo, ergo_real threshold, DistributionSpecStructLabeled *resultList, int maxCountDistrs, ergo_real maxLimitingFactor, const ergo_real *dens, ergo_real maxDensityMatrixElement)
Definition: integrals_2el_utils.cc:322
Definition: basisinfo.h:111
Definition: organize_distrs.h:103
ergo_real totCharge
Definition: integrals_2el_utils.h:38
ergo_real * primitiveIntegralList_work
Definition: integrals_2el_utils.h:78
ergo_real * partial_dmat_1
Definition: integrals_2el_utils.h:79
Definition: integrals_2el_utils.h:36
Definition: multipole.h:43
int get_related_integrals_h(const IntegralInfo &integralInfo, const JK::ExchWeights &CAM_params, int n1max, int noOfMonomials_1, int n2max, int noOfMonomials_2, ergo_real dx0, ergo_real dx1, ergo_real dx2, ergo_real alpha1, ergo_real alpha2, ergo_real alpha0, ergo_real *primitiveIntegralList, ergo_real *primitiveIntegralList_work, ergo_real resultPreFactor)
Definition: integrals_2el_utils.cc:129
distr_list_description_struct distrListForK
Definition: integrals_2el_utils.h:60
#define MAX_MULTIPOLE_DEGREE_BASIC
Definition: multipole.h:39
ergo_real * partial_K_1
Definition: integrals_2el_utils.h:81
ergo_real multipolePoint[3]
Definition: integrals_2el_utils.h:39
distr_org_struct org
Definition: integrals_2el_utils.h:37
int noOfRelevantBasisFuncGroups
Definition: integrals_2el_utils.h:66
int maxMultipoleDegree
Definition: integrals_2el_utils.h:54
Definition: integrals_2el_utils.h:74
Definition: box_system.h:60
ergo_real maxMomentVectorNormForDistrsList[MAX_MULTIPOLE_DEGREE_BASIC+1]
Definition: integrals_2el_utils.h:41
Definition: basisinfo.h:52
Definition: integrals_2el_utils.h:49
ergo_real * primitiveIntegralList
Definition: integrals_2el_utils.h:77
ergo_real * summedIntegralList
Definition: integrals_2el_utils.h:76
void compute_extent_for_list_of_distributions(int n, DistributionSpecStructLabeled *distrList, ergo_real threshold, ergo_real maxLimitingFactor, ergo_real maxabsDmatelement)
Definition: integrals_2el_utils.cc:205