ergo
integrals_2el_utils.h
Go to the documentation of this file.
1/* Ergo, version 3.8.2, a program for linear scaling electronic structure
2 * calculations.
3 * Copyright (C) 2023 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
37
38#ifndef INTEGRALS_2EL_UTILS_HEADER
39#define INTEGRALS_2EL_UTILS_HEADER
40
41
42#include "organize_distrs.h"
43#include "organize_distrs_mm.h"
44#include "box_system.h"
45
46
47#define MAX_NO_OF_BRANCHES 10
48
49
50/* Struct used for storing result matrix contributions when e.g. the J
51 kernel routine is used with Chunks and Tasks. */
53 struct RowColVal {
54 int row;
55 int col;
57 };
58 static const int nVectorsMax = 40;
63 std::vector<RowColVal> * vList[nVectorsMax];
66 void addContrib(int row, int col, ergo_real value);
67 const RowColVal & fetchNextContrib(int & currVecIndexForFetch, int & indexInCurrVecForFetch) const;
68};
69
70
83
84
94
95
97
98void
100 int maxNoOfMonomials,
101 int basisFuncListCount_max,
102 JK_contribs_buffer_struct* bufferStruct);
103
104void
106
107int
108get_related_integrals_h(const IntegralInfo & integralInfo,
109 const JK::ExchWeights & CAM_params,
110 int n1max, int noOfMonomials_1,
111 int n2max, int noOfMonomials_2,
112 ergo_real dx0,
113 ergo_real dx1,
114 ergo_real dx2,
115 ergo_real alpha1,
116 ergo_real alpha2,
117 ergo_real alpha0,
118 ergo_real* primitiveIntegralList,
119 ergo_real* primitiveIntegralList_work,
120 ergo_real resultPreFactor);
121
122void
125 ergo_real threshold,
126 ergo_real maxLimitingFactor,
127 ergo_real maxabsDmatelement);
128
129int
131 const IntegralInfo & integralInfo,
132 ergo_real threshold,
133 ergo_real* resultMaxLimitingFactor,
134 ergo_real maxDensityMatrixElement);
135
136int
138 const IntegralInfo & integralInfo,
139 ergo_real threshold,
141 int maxCountDistrs,
142 ergo_real maxLimitingFactor,
143 const ergo_real* dens,
144 ergo_real maxDensityMatrixElement);
145
146int
149 ergo_real toplevelBoxSize,
150 BoxSystem & boxSystem);
151
152
153
154#endif
BoxSystem class representing a hierarchical data structure of boxes in 3D space (an oct-tree).
Definition box_system.h:71
Contains coefficients needed for quick integral evaluation.
Definition integral_info.h:94
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:252
#define MAX_NO_OF_BRANCHES
Definition integrals_2el_utils.h:47
ergo_real get_max_abs_vector_element(int n, const ergo_real *vector)
Definition integrals_2el_utils.cc:103
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:176
void free_buffers_needed_by_integral_code(JK_contribs_buffer_struct *bufferStruct)
Definition integrals_2el_utils.cc:152
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:126
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:269
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:369
int create_box_system_and_reorder_distrs(int distrCount, DistributionSpecStructLabeled *distrList, ergo_real toplevelBoxSize, BoxSystem &boxSystem)
Definition integrals_2el_utils.cc:508
Code for organizing a given set of primitive Gaussian distributions (typically coming from basis func...
Code for organizing a given set of primitive Gaussian distributions (typically coming from basis func...
double ergo_real
Definition realtype.h:69
Definition basisinfo.h:112
Definition basisinfo.h:58
Definition integral_info.h:148
Definition integrals_2el_utils.h:85
ergo_real * partial_dmat_2
Definition integrals_2el_utils.h:90
ergo_real * summedIntegralList
Definition integrals_2el_utils.h:86
ergo_real * partial_K_1
Definition integrals_2el_utils.h:91
ergo_real * partial_dmat_1
Definition integrals_2el_utils.h:89
ergo_real * primitiveIntegralList
Definition integrals_2el_utils.h:87
ergo_real * primitiveIntegralList_work
Definition integrals_2el_utils.h:88
ergo_real * partial_K_2
Definition integrals_2el_utils.h:92
Definition integrals_2el_utils.h:53
int row
Definition integrals_2el_utils.h:54
ergo_real value
Definition integrals_2el_utils.h:56
int col
Definition integrals_2el_utils.h:55
~ResultMatContrib()
Definition integrals_2el_utils.cc:62
int currContribCount
Definition integrals_2el_utils.h:60
void addContrib(int row, int col, ergo_real value)
Definition integrals_2el_utils.cc:67
int indexInCurrVec
Definition integrals_2el_utils.h:61
int currVecReservedSize
Definition integrals_2el_utils.h:62
ResultMatContrib()
Definition integrals_2el_utils.cc:51
std::vector< RowColVal > * vList[nVectorsMax]
Definition integrals_2el_utils.h:63
const RowColVal & fetchNextContrib(int &currVecIndexForFetch, int &indexInCurrVecForFetch) const
Definition integrals_2el_utils.cc:86
static const int nVectorsMax
Definition integrals_2el_utils.h:58
int currVecIndex
Definition integrals_2el_utils.h:59
Definition box_system.h:53
int branchIndexListForJ[MAX_NO_OF_BRANCHES]
Definition integrals_2el_utils.h:76
distr_list_description_struct distrListForK
Definition integrals_2el_utils.h:79
distr_list_description_struct branchListForJ[MAX_NO_OF_BRANCHES]
Definition integrals_2el_utils.h:75
int branchCountListForJ[MAX_NO_OF_BRANCHES]
Definition integrals_2el_utils.h:77
box_struct()
Definition integrals_2el_utils.cc:118
box_struct_basic basicBox
Definition integrals_2el_utils.h:73
Definition organize_distrs_mm.h:63