integrals_2el_utils.h

Go to the documentation of this file.
00001 /* Ergo, version 3.2, a program for linear scaling electronic structure
00002  * calculations.
00003  * Copyright (C) 2012 Elias Rudberg, Emanuel H. Rubensson, and Pawel Salek.
00004  * 
00005  * This program is free software: you can redistribute it and/or modify
00006  * it under the terms of the GNU General Public License as published by
00007  * the Free Software Foundation, either version 3 of the License, or
00008  * (at your option) any later version.
00009  * 
00010  * This program is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  * GNU General Public License for more details.
00014  * 
00015  * You should have received a copy of the GNU General Public License
00016  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
00017  * 
00018  * Primary academic reference:
00019  * Kohn−Sham Density Functional Theory Electronic Structure Calculations 
00020  * with Linearly Scaling Computational Time and Memory Usage,
00021  * Elias Rudberg, Emanuel H. Rubensson, and Pawel Salek,
00022  * J. Chem. Theory Comput. 7, 340 (2011),
00023  * <http://dx.doi.org/10.1021/ct100611z>
00024  * 
00025  * For further information about Ergo, see <http://www.ergoscf.org>.
00026  */
00027 
00028 #ifndef INTEGRALS_2EL_UTILS_HEADER
00029 #define INTEGRALS_2EL_UTILS_HEADER
00030 
00031 
00032 #include "organize_distrs.h"
00033 #include "box_system.h"
00034 
00035 
00036 struct distr_list_description_struct {
00037   distr_org_struct org;
00038   ergo_real totCharge;
00039   ergo_real multipolePoint[3];
00040   multipole_struct_large multipole;
00041   ergo_real maxMomentVectorNormForDistrsList[MAX_MULTIPOLE_DEGREE_BASIC+1];
00042   distr_list_description_struct();
00043 };
00044 
00045 
00046 #define MAX_NO_OF_BRANCHES 10
00047 
00048 
00049 typedef struct
00050 {
00051   int basisFuncGroupIndex;
00052   ergo_real max_CS_factor;
00053   ergo_real maxMomentVectorNormList[MAX_MULTIPOLE_DEGREE_BASIC+1];
00054   int maxMultipoleDegree;
00055 } basis_func_group_info_for_box;
00056 
00057 
00058 struct box_struct {
00059   box_struct_basic basicBox;
00060   distr_list_description_struct distrListForK;
00061   distr_list_description_struct branchList[MAX_NO_OF_BRANCHES];
00062   ergo_real multipolePoint[3];
00063   int branchIndexList[MAX_NO_OF_BRANCHES];
00064   int branchCountList[MAX_NO_OF_BRANCHES];
00065   int noOfBasisFuncs;
00066   int noOfRelevantBasisFuncGroups;
00067   basis_func_group_info_for_box* basisFuncGroupInfoList;
00068   ergo_real largestCSfactor; // Largest Cauchy-Schwartz factor in box
00069   ergo_real multipoleEuclideanNormList[MAX_MULTIPOLE_DEGREE_BASIC+1];
00070   box_struct();
00071 };
00072 
00073 
00074 typedef struct
00075 {
00076   ergo_real* summedIntegralList;
00077   ergo_real* primitiveIntegralList;
00078   ergo_real* primitiveIntegralList_work;
00079   ergo_real* partial_dmat_1;
00080   ergo_real* partial_dmat_2; // used in non-symmetric case
00081   ergo_real* partial_K_1;
00082   ergo_real* partial_K_2; // used in non-symmetric case
00083 } JK_contribs_buffer_struct;
00084 
00085 
00086 
00087 
00088 ergo_real get_max_abs_vector_element(int n, const ergo_real* vector);
00089 
00090 void
00091 allocate_buffers_needed_by_integral_code(const IntegralInfo* integralInfo, 
00092                                          int maxNoOfMonomials,
00093                                          int basisFuncListCount_max,
00094                                          JK_contribs_buffer_struct* bufferStruct);
00095 
00096 void
00097 free_buffers_needed_by_integral_code(JK_contribs_buffer_struct* bufferStruct);
00098 
00099 int
00100 get_related_integrals_h(const IntegralInfo* b,
00101                         const JK::ExchWeights & CAM_params,
00102                         int n1max, int noOfMonomials_1,
00103                         int n2max, int noOfMonomials_2,
00104                         ergo_real dx0, 
00105                         ergo_real dx1, 
00106                         ergo_real dx2, 
00107                         ergo_real alpha1, 
00108                         ergo_real alpha2,
00109                         ergo_real alpha0,
00110                         ergo_real* primitiveIntegralList,
00111                         ergo_real* primitiveIntegralList_work,
00112                         ergo_real resultPreFactor);
00113 
00114 void
00115 compute_extent_for_list_of_distributions(int n,
00116                                          DistributionSpecStructLabeled* distrList,
00117                                          ergo_real threshold,
00118                                          ergo_real maxLimitingFactor,
00119                                          ergo_real maxabsDmatelement);
00120 
00121 int
00122 get_list_of_labeled_distrs_maxLimitingFactor(const BasisInfoStruct & basisInfo,
00123                                              const IntegralInfo* integralInfo,
00124                                              ergo_real threshold,
00125                                              ergo_real* resultMaxLimitingFactor,
00126                                              ergo_real maxDensityMatrixElement);
00127 
00128 int
00129 get_list_of_labeled_distrs(const BasisInfoStruct & basisInfo,
00130                            const IntegralInfo* integralInfo,
00131                            ergo_real threshold,
00132                            DistributionSpecStructLabeled* resultList,
00133                            int maxCountDistrs,
00134                            ergo_real maxLimitingFactor,
00135                            const ergo_real* dens,
00136                            ergo_real maxDensityMatrixElement);
00137 
00138 int
00139 create_box_system_and_reorder_distrs(int distrCount,
00140                                      DistributionSpecStructLabeled* distrList,
00141                                      ergo_real toplevelBoxSize,
00142                                      BoxSystem & boxSystem);
00143 
00144 
00145 
00146 #endif

Generated on Wed Nov 21 09:32:10 2012 for ergo by  doxygen 1.4.7