00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00038 #ifndef BASISINFO_BASIC_HEADER
00039 #define BASISINFO_BASIC_HEADER
00040
00041
00042 #include "realtype.h"
00043 #include "monomial_info.h"
00044 #include "hermite_conversion_prep.h"
00045 #include "boysfunction.h"
00046 #include "multipole_prep.h"
00047 #include "mm_limit_table.h"
00048
00049 #ifndef BASIS_FUNC_POLY_MAX_DEGREE
00050 #error The constant BASIS_FUNC_POLY_MAX_DEGREE must be defined.
00051 #endif
00052 #if BASIS_FUNC_POLY_MAX_DEGREE<6
00053 #define MAX_NO_OF_TERMS_IN_BASIS_FUNC_POLY 12
00054 #define MAX_NO_OF_POLY_12_TERMS 180
00055 #define MAX_NO_OF_BASIS_FUNC_POLYS 50
00056 #else
00057 #define MAX_NO_OF_TERMS_IN_BASIS_FUNC_POLY 16
00058 #define MAX_NO_OF_POLY_12_TERMS 360
00059 #define MAX_NO_OF_BASIS_FUNC_POLYS 100
00060 #endif
00061
00062 typedef struct
00063 {
00064 ergo_real coeff;
00065 char monomialInts[4];
00066 int monomialID;
00067 } basis_func_term_struct;
00068
00069 typedef struct
00070 {
00071 int noOfTerms;
00072 basis_func_term_struct termList[MAX_NO_OF_TERMS_IN_BASIS_FUNC_POLY];
00073 ergo_real scaledSolidHarmonicPrefactor;
00074 } basis_func_poly_struct;
00075
00076 typedef struct
00077 {
00078 int id_1;
00079 int id_2;
00080 ergo_real coeff;
00081 } poly_12_term_struct;
00082
00083 typedef struct
00084 {
00085 int noOfTerms;
00086 poly_12_term_struct termList[MAX_NO_OF_POLY_12_TERMS];
00087 } poly_12_struct;
00088
00093 class IntegralInfo
00094 {
00095 private:
00096 BoysFunctionManager boysFunctionManager;
00097 MultipolePrepManager multipolePrep;
00098 MMLimitTable mmLimitTable;
00099 hermite_conversion_info_struct hermite_conversion_info;
00100 bool initialized;
00101 IntegralInfo();
00102 public:
00103 basis_func_poly_struct basis_func_poly_list[MAX_NO_OF_BASIS_FUNC_POLYS];
00104 int no_of_basis_func_polys;
00105 monomial_info_struct monomial_info;
00106 void init();
00107 ergo_real BoysFunction(int n, ergo_real x) const;
00108 ergo_real BoysFunction_expensive(int n, ergo_real x, int noOfIntegrationIntervals) const;
00109 const MultipolePrepManager & GetMultipolePrep() const { return multipolePrep; }
00110 const MMLimitTable & GetMMLimitTable() const { return mmLimitTable; }
00111 int multiply_by_hermite_conversion_matrix_from_right(int n1max,
00112 int n2max,
00113 ergo_real a,
00114 ergo_real* A,
00115 ergo_real* result) const;
00116 int multiply_by_hermite_conversion_matrix_from_left(int n1max,
00117 int n2max,
00118 ergo_real a,
00119 ergo_real* A,
00120 ergo_real* result) const;
00121 int get_hermite_conversion_matrix_right(int nmax,
00122 ergo_real a,
00123 ergo_real* result) const;
00124 int get_hermite_conversion_matrix_left(int nmax,
00125 ergo_real a,
00126 ergo_real* result) const;
00127 int get_hermite_conversion_matrix_right_sparse(int nmax,
00128 ergo_real a,
00129 i_j_val_struct* result) const;
00130
00131 IntegralInfo(bool initialize);
00132 ~IntegralInfo();
00133
00134
00135 IntegralInfo(const IntegralInfo & ii);
00136 void write_to_buffer ( char * dataBuffer, size_t const bufferSize ) const;
00137 size_t get_size() const;
00138 void assign_from_buffer ( char const * dataBuffer, size_t const bufferSize);
00139 };
00140
00141
00142 namespace JK {
00143
00144
00145
00146
00147 struct ExchWeights
00148 {
00149 ergo_real alpha;
00150 ergo_real beta;
00151 ergo_real mu;
00152 int computeRangeSeparatedExchange;
00154 ExchWeights() :
00155 alpha(0),
00156 beta(0),
00157 mu(0),
00158 computeRangeSeparatedExchange(0)
00159 {}
00160
00161 };
00162
00163 }
00164
00165
00166 int get_poly_info_from_shell_type(int* polyid_start, int* poly_count, int shellType);
00167
00168 int get_no_of_basis_func_polys_used_from_no_of_shell_types(int no_of_shell_types);
00169
00170 int get_shell_type_from_basis_func_poly_id(int basfuncpolyid);
00171
00172
00173 #endif