ergo
basisinfo.h
Go to the documentation of this file.
1 /* Ergo, version 3.2, a program for linear scaling electronic structure
2  * calculations.
3  * Copyright (C) 2012 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 BASISINFO_HEADER
29 #define BASISINFO_HEADER
30 
31 /* for NULL */
32 #include <stdlib.h>
33 
34 #include "realtype.h"
35 #include "integral_info.h"
36 /* for Molecule */
37 #include "molecule.h"
38 
39 #include "basisset.h"
40 
41 #define MAX_NO_OF_PRIMITIVES_PER_BASIS_FUNC 44
42 
48  char monomialInts[4];
49 };
51 
52 typedef struct
53 {
56  int pairIndex;
57  int groupID;
58  ergo_real limitingFactor; // squareroot of repulsion integral of this distr with itself.
62 
63 
64 #define MAX_NO_OF_CONTR_GAUSSIANS 20
65 
70  ergo_real padding; /* We keep this for compatibility with old density files... */
71  ergo_real centerCoords[3]; /* x0, y0, z0 */
72  int noOfContr;
73  int shellType;
74  int shell_ID;
76  int startIndexInMatrix; /* start index in density matrix */
77  int dummy; /* padding to make sure the size of this structure is a multiple of 8 bytes */
78 };
80 
82  int noOfContr;
86  Vector3D centerCoords; /* x0, y0, z0 */
87  int shellType; /* 0 <-> 's', 1 <-> 'p', 2 <-> 'd' etc */
88  int functionNumber; /* -1,0,1 for 'p', -2,-1,0,1,2 for 'd', etc */
93 };
95 
96 
97 typedef struct
98 {
100  int count;
103 
104 typedef struct
105 {
107  int count;
110 
123 
125  BasisInfoStruct(int use_6_d_funcs_ = 0) :
126  use_6_d_funcs(use_6_d_funcs_),
127  noOfShells(0),
128  shellList(NULL),
129  noOfBasisFuncs(0),
130  basisFuncList(NULL),
132  simplePrimitiveList(NULL)
133  {
134  }
135 
137  {
138  if(shellList) delete [] shellList;
139  if(basisFuncList) delete [] basisFuncList;
141  }
142 
143  int addBasisfuncsForMolecule(const Molecule& molecule,
144  const char* basisset_filename_default,
145  int noOfRanges,
146  const BasissetNameRange* rangeList,
147  const IntegralInfo& integralInfo,
148  int print_raw,
149  int do_normalization,
150  int skip_sort_shells);
151 
152  BasisInfoStruct *permuteShells(const int *shellMap,
153  const IntegralInfo& ii) const;
154 
155  int normalizeShells(const IntegralInfo& integralInfo);
156 
157  int get_basis_funcs();
158 
159  int getSimplePrimitivesAll(const IntegralInfo& integralInfo);
160 };
161 
162 
163 
170  const int MAX_NO_OF_PRIMS;
174  {
177  }
179  {
180  delete []list;
181  delete []productlist;
182  }
184  (const IntegralInfo& integralInfo, BasisFuncStruct* basisFunc, int use_6_d_funcs);
185 
186  ergo_real getShellFactor(const IntegralInfo& integralInfo,
187  ergo_real exponent, int shellType, int use_6_d_funcs);
188 };
189 
190 
191 
192 
193 #ifdef ERGO_ENABLE_DEPRECATED
194 
195 int basisinfo_construct_multi_basis(BasisInfoStruct* result_basisInfo,
196  const Molecule* molecule,
197  const char* basisset_filename_default,
198  const Molecule* ghostMolecule,
199  const char* ghost_molecule_basisset_filename,
200  int noOfRanges,
201  const BasissetNameRange* rangeList,
202  IntegralInfo* integralInfo,
203  int print_raw,
204  int do_normalization,
205  int skip_sort_shells,
206  int skip_standard_basis);
207 struct AtomInfoStruct_{
208  int charge;
209  ergo_real coords[3];
210 };
211 typedef struct AtomInfoStruct_ AtomInfoStruct;
212 #endif
213 
214 int get_basis_funcs(BasisInfoStruct* basisInfo,
215  const IntegralInfo* integralInfo,
216  int do_normalization);
217 
219  const IntegralInfo* integralInfo);
220 
221 int output_basisinfo(const BasisInfoStruct & basisInfo);
222 
223 ergo_real getSafeMaxDistance(const BasisInfoStruct & basisInfo);
224 
225 
226 #endif