votca 2024.2-dev
Loading...
Searching...
No Matches
radial_euler_maclaurin_rule.h
Go to the documentation of this file.
1/*
2 * Copyright 2009-2020 The VOTCA Development Team
3 * (http://www.votca.org)
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License")
6 *
7 * You may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 *
18 */
19
20#pragma once
21#ifndef VOTCA_XTP_RADIAL_EULER_MACLAURIN_RULE_H
22#define VOTCA_XTP_RADIAL_EULER_MACLAURIN_RULE_H
23
24// VOTCA includes
26
27// Local VOTCA includes
28#include "basisset.h"
29#include "grid_containers.h"
30#include "qmatom.h"
31
32namespace votca {
33namespace xtp {
34
36 public:
38
39 std::map<std::string, GridContainers::radial_grid> CalculateAtomicRadialGrids(
40 const AOBasis& aobasis, const QMMolecule& atoms, const std::string& type);
41
42 std::vector<double> CalculatePruningIntervals(const std::string& element);
43
44 private:
45 struct min_exp {
46 double alpha;
48 double range;
49 };
50
51 std::map<std::string, min_exp> element_ranges_;
52 std::map<std::string, Index> pruning_set_;
53
54 std::map<std::string, double> BraggSlaterRadii_;
55
56 Index getGridParameters(const std::string& element, const std::string& type);
57
58 double DetermineCutoff(double alpha, Index l, double eps);
59 double CalcResidual(double alpha, Index l, double cutoff);
60 double RadialIntegral(double alpha, Index l, double cutoff);
61
62 void CalculateRadialCutoffs(const AOBasis& aobasis, const QMMolecule& atoms,
63 const std::string& gridtype);
64 void RefineElementRangeMap(const AOBasis& aobasis, const QMMolecule& atoms,
65 double eps);
66
67 void FillElementRangeMap(const AOBasis& aobasis, const QMMolecule& atoms,
68 double eps);
69
71 const std::string& type, const std::pair<std::string, min_exp>& element);
72
73 std::map<std::string, Index> MediumGrid;
74 std::map<std::string, Index> CoarseGrid;
75 std::map<std::string, Index> XcoarseGrid;
76 std::map<std::string, Index> FineGrid;
77 std::map<std::string, Index> XfineGrid;
78 std::map<std::string, double> Accuracy;
79
90
91 inline void FillBraggSlaterRadii() {
92 const double ang2bohr = votca::tools::conv::ang2bohr;
93 //
94 BraggSlaterRadii_["H"] = 0.35 * ang2bohr;
95 BraggSlaterRadii_["He"] = 0.35 * ang2bohr;
96
97 // row of period system for 1st row elements taken from NWChem
98 BraggSlaterRadii_["Li"] = 1.45 * ang2bohr;
99 BraggSlaterRadii_["Be"] = 1.05 * ang2bohr;
100 BraggSlaterRadii_["B"] = 0.85 * ang2bohr;
101 BraggSlaterRadii_["C"] = 0.70 * ang2bohr;
102 BraggSlaterRadii_["N"] = 0.65 * ang2bohr;
103 BraggSlaterRadii_["O"] = 0.60 * ang2bohr;
104 BraggSlaterRadii_["F"] = 0.50 * ang2bohr;
105 BraggSlaterRadii_["Ne"] = 0.50 * ang2bohr;
106
107 // row of period system for 2nd row elements taken from NWChem
108 BraggSlaterRadii_["Na"] = 1.80 * ang2bohr;
109 BraggSlaterRadii_["Mg"] = 1.5 * ang2bohr;
110 BraggSlaterRadii_["Al"] = 1.25 * ang2bohr;
111 BraggSlaterRadii_["Si"] = 1.1 * ang2bohr;
112 BraggSlaterRadii_["P"] = 1.0 * ang2bohr;
113 BraggSlaterRadii_["S"] = 1.0 * ang2bohr;
114 BraggSlaterRadii_["Cl"] = 1.0 * ang2bohr;
115 BraggSlaterRadii_["Ar"] = 1.0 * ang2bohr;
116
117 // row of period system for 3rd row elements taken from NWChem
118 BraggSlaterRadii_["K"] = 2.2 * ang2bohr;
119 BraggSlaterRadii_["Ca"] = 1.8 * ang2bohr;
120 BraggSlaterRadii_["Sc"] = 1.6 * ang2bohr;
121 BraggSlaterRadii_["Ti"] = 1.4 * ang2bohr;
122 BraggSlaterRadii_["V"] = 1.35 * ang2bohr;
123 BraggSlaterRadii_["Cr"] = 1.4 * ang2bohr;
124 BraggSlaterRadii_["Mn"] = 1.4 * ang2bohr;
125 BraggSlaterRadii_["Fe"] = 1.4 * ang2bohr;
126 BraggSlaterRadii_["Co"] = 1.35 * ang2bohr;
127 BraggSlaterRadii_["Ni"] = 1.35 * ang2bohr;
128 BraggSlaterRadii_["Cu"] = 1.35 * ang2bohr;
129 BraggSlaterRadii_["Zn"] = 1.35 * ang2bohr;
130 BraggSlaterRadii_["Ga"] = 1.30 * ang2bohr;
131 BraggSlaterRadii_["Ge"] = 1.25 * ang2bohr;
132 BraggSlaterRadii_["As"] = 1.15 * ang2bohr;
133 BraggSlaterRadii_["Se"] = 1.15 * ang2bohr;
134 BraggSlaterRadii_["Br"] = 1.15 * ang2bohr;
135 BraggSlaterRadii_["Kr"] = 1.15 * ang2bohr;
136
137 // 4th row (selection)
138 BraggSlaterRadii_["Ag"] = 1.60 * ang2bohr;
139 BraggSlaterRadii_["Rb"] = 2.35 * ang2bohr;
140 BraggSlaterRadii_["Xe"] = 1.40 * ang2bohr;
141 BraggSlaterRadii_["I"] = 1.40 * ang2bohr;
142
143 /* Copied from grid_atom_type_info.F of NWChem
144
145 * VALUES are in ANGSTROM
146 Data BSrad/0.35,0.35,1.45,1.05,0.85,0.70,0.65,0.60,0.50,0.50,
147c Na Mg Al Si P S Cl Ar K Ca
148& 1.80,1.50,1.25,1.10,1.00,1.00,1.00,1.00,2.20,1.80,
149c Sc Ti V Cr Mn Fe Co Ni Cu Zn
150& 1.60,1.40,1.35,1.40,1.40,1.40,1.35,1.35,1.35,1.35,
151c Ga Ge As Se Br Kr Rb Sr Y Zr
152& 1.30,1.25,1.15,1.15,1.15,1.15,2.35,2.00,1.80,1.55,
153c Nb Mo Tc Ru Rh Pd Ag Cd In Sn
154& 1.45,1.45,1.35,1.30,1.35,1.40,1.60,1.55,1.55,1.45,
155c Sb Te I Xe Cs Ba La Ce Pr Nd
156& 1.45,1.40,1.40,1.40,2.60,2.15,1.95,1.85,1.85,1.85,
157c Pm Sm Eu Gd Tb Dy Ho Er Tm Yb
158& 1.85,1.85,1.85,1.80,1.75,1.75,1.75,1.75,1.75,1.75,
159c Lu Hf Ta W Re Os Ir Pt Au Hg
160& 1.75,1.55,1.45,1.35,1.35,1.30,1.35,1.35,1.35,1.50,
161c Tl Pb Bi Po At Rn Fr Ra Ac Th
162& 1.90,1.80,1.60,1.90,1.90,1.90,2.60,2.15,1.95,1.80,
163c Pa U Np Pu Am Cm Bk Cf Es Fm
164& 1.80,1.75,1.75,1.75,1.75,1.75,1.75,1.75,1.75,1.75,
165c Md No Lr Unq Unp
166& 1.75,1.75,1.75,1.55,1.55/
167
168
169
170 */
171 }
172
173 inline void FillPruningSet() {
174
175 // row of period system for H, He (not given in NWChem, assuming same as 1st
176 // row)
177 pruning_set_["H"] = 1;
178 pruning_set_["He"] = 1;
179
180 // row of period system for 1st row elements taken from NWChem
181 pruning_set_["Li"] = 2;
182 pruning_set_["Be"] = 2;
183 pruning_set_["B"] = 2;
184 pruning_set_["C"] = 2;
185 pruning_set_["N"] = 2;
186 pruning_set_["O"] = 2;
187 pruning_set_["F"] = 2;
188 pruning_set_["Ne"] = 2;
189
190 // row of period system for 2nd row elements taken from NWChem
191 pruning_set_["Na"] = 3;
192 pruning_set_["Mg"] = 3;
193 pruning_set_["Al"] = 3;
194 pruning_set_["Si"] = 3;
195 pruning_set_["P"] = 3;
196 pruning_set_["S"] = 3;
197 pruning_set_["Cl"] = 3;
198 pruning_set_["Ar"] = 3;
199
200 // row of period system for 3rd row elements taken from NWChem
201 pruning_set_["K"] = 3;
202 pruning_set_["Ca"] = 3;
203 pruning_set_["Sc"] = 3;
204 pruning_set_["Ti"] = 3;
205 pruning_set_["V"] = 3;
206 pruning_set_["Cr"] = 3;
207 pruning_set_["Mn"] = 3;
208 pruning_set_["Fe"] = 3;
209 pruning_set_["Co"] = 3;
210 pruning_set_["Ni"] = 3;
211 pruning_set_["Cu"] = 3;
212 pruning_set_["Zn"] = 3;
213 pruning_set_["Ga"] = 3;
214 pruning_set_["Ge"] = 3;
215 pruning_set_["As"] = 3;
216 pruning_set_["Se"] = 3;
217 pruning_set_["Br"] = 3;
218 pruning_set_["Kr"] = 3;
219
220 // row of period system for 4th row elements taken from NWChem
221 pruning_set_["Ag"] = 3;
222 pruning_set_["Rb"] = 3;
223 pruning_set_["I"] = 3;
224 pruning_set_["Xe"] = 3;
225 }
226
227 inline void FillAccuracy() {
228 Accuracy["xcoarse"] = 1e-4;
229 Accuracy["coarse"] = 1e-5;
230 Accuracy["medium"] = 1e-6;
231 Accuracy["fine"] = 1e-7;
232 Accuracy["xfine"] = 1e-8;
233 }
234
235 inline void FillMediumGrid() {
236
237 // order for H, He (not given in NWChem, assuming same as 1st row)
238 MediumGrid["H"] = 49;
239 MediumGrid["He"] = 49;
240
241 // orders for 1st row elements taken from NWChem
242 MediumGrid["Li"] = 49;
243 MediumGrid["Be"] = 49;
244 MediumGrid["B"] = 49;
245 MediumGrid["C"] = 49;
246 MediumGrid["N"] = 49;
247 MediumGrid["O"] = 49;
248 MediumGrid["F"] = 49;
249 MediumGrid["Ne"] = 49;
250
251 // orders for 2nd row elements taken from NWChem
252 MediumGrid["Na"] = 88;
253 MediumGrid["Mg"] = 88;
254 MediumGrid["Al"] = 88;
255 MediumGrid["Si"] = 88;
256 MediumGrid["P"] = 88;
257 MediumGrid["S"] = 88;
258 MediumGrid["Cl"] = 88;
259 MediumGrid["Ar"] = 88;
260
261 // orders for 3rd row elements taken from NWChem
262 MediumGrid["K"] = 112;
263 MediumGrid["Ca"] = 112;
264 MediumGrid["Sc"] = 112;
265 MediumGrid["Ti"] = 112;
266 MediumGrid["V"] = 112;
267 MediumGrid["Cr"] = 112;
268 MediumGrid["Mn"] = 112;
269 MediumGrid["Fe"] = 112;
270 MediumGrid["Co"] = 112;
271 MediumGrid["Ni"] = 112;
272 MediumGrid["Cu"] = 112;
273 MediumGrid["Zn"] = 112;
274 MediumGrid["Ga"] = 112;
275 MediumGrid["Ge"] = 112;
276 MediumGrid["As"] = 112;
277 MediumGrid["Se"] = 112;
278 MediumGrid["Br"] = 112;
279 MediumGrid["Kr"] = 112;
280
281 // orders for 4th row elements (selected)
282 MediumGrid["Ag"] = 123;
283 MediumGrid["Rb"] = 123;
284 MediumGrid["Xe"] = 123;
285 MediumGrid["I"] = 123;
286 }
287
288 inline void FillFineGrid() {
289
290 // order for H, He (not given in NWChem, assuming same as 1st row)
291 FineGrid["H"] = 70;
292 FineGrid["He"] = 70;
293
294 // orders for 1st row elements taken from NWChem
295 FineGrid["Li"] = 70;
296 FineGrid["Be"] = 70;
297 FineGrid["B"] = 70;
298 FineGrid["C"] = 70;
299 FineGrid["N"] = 70;
300 FineGrid["O"] = 70;
301 FineGrid["F"] = 70;
302 FineGrid["Ne"] = 70;
303
304 // orders for 2nd row elements taken from NWChem
305 FineGrid["Na"] = 123;
306 FineGrid["Mg"] = 123;
307 FineGrid["Al"] = 123;
308 FineGrid["Si"] = 123;
309 FineGrid["P"] = 123;
310 FineGrid["S"] = 123;
311 FineGrid["Cl"] = 123;
312 FineGrid["Ar"] = 123;
313
314 // orders for 3rd row elements taken from NWChem
315 FineGrid["K"] = 130;
316 FineGrid["Ca"] = 130;
317 FineGrid["Sc"] = 130;
318 FineGrid["Ti"] = 130;
319 FineGrid["V"] = 130;
320 FineGrid["Cr"] = 130;
321 FineGrid["Mn"] = 130;
322 FineGrid["Fe"] = 130;
323 FineGrid["Co"] = 130;
324 FineGrid["Ni"] = 130;
325 FineGrid["Cu"] = 130;
326 FineGrid["Zn"] = 130;
327 FineGrid["Ga"] = 130;
328 FineGrid["Ge"] = 130;
329 FineGrid["As"] = 130;
330 FineGrid["Se"] = 130;
331 FineGrid["Br"] = 130;
332 FineGrid["Kr"] = 130;
333
334 // 4th row (selected)
335 FineGrid["Ag"] = 141;
336 FineGrid["Rb"] = 141;
337 FineGrid["I"] = 141;
338 FineGrid["Xe"] = 141;
339 }
340
341 inline void FillXfineGrid() {
342
343 // order for H, He (not given in NWChem, assuming same as 1st row)
344 XfineGrid["H"] = 100;
345 XfineGrid["He"] = 100;
346
347 // orders for 1st row elements taken from NWChem
348 XfineGrid["Li"] = 100;
349 XfineGrid["Be"] = 100;
350 XfineGrid["B"] = 100;
351 XfineGrid["C"] = 100;
352 XfineGrid["N"] = 100;
353 XfineGrid["O"] = 100;
354 XfineGrid["F"] = 100;
355 XfineGrid["Ne"] = 100;
356
357 // orders for 2nd row elements taken from NWChem
358 XfineGrid["Na"] = 125;
359 XfineGrid["Mg"] = 125;
360 XfineGrid["Al"] = 125;
361 XfineGrid["Si"] = 125;
362 XfineGrid["P"] = 125;
363 XfineGrid["S"] = 125;
364 XfineGrid["Cl"] = 125;
365 XfineGrid["Ar"] = 125;
366
367 // orders for 3rd row elements taken from NWChem
368 XfineGrid["K"] = 160;
369 XfineGrid["Ca"] = 160;
370 XfineGrid["Sc"] = 160;
371 XfineGrid["Ti"] = 160;
372 XfineGrid["V"] = 160;
373 XfineGrid["Cr"] = 160;
374 XfineGrid["Mn"] = 160;
375 XfineGrid["Fe"] = 160;
376 XfineGrid["Co"] = 160;
377 XfineGrid["Ni"] = 160;
378 XfineGrid["Cu"] = 160;
379 XfineGrid["Zn"] = 160;
380 XfineGrid["Ga"] = 160;
381 XfineGrid["Ge"] = 160;
382 XfineGrid["As"] = 160;
383 XfineGrid["Se"] = 160;
384 XfineGrid["Br"] = 160;
385 XfineGrid["Kr"] = 160;
386
387 // 4th row (selection)
388 XfineGrid["Ag"] = 205;
389 XfineGrid["Rb"] = 205;
390 XfineGrid["I"] = 205;
391 XfineGrid["Xe"] = 205;
392 }
393
394 inline void FillCoarseGrid() {
395
396 // order for H, He (not given in NWChem, assuming same as 1st row)
397 CoarseGrid["H"] = 35;
398 CoarseGrid["He"] = 35;
399
400 // orders for 1st row elements taken from NWChem
401 CoarseGrid["Li"] = 35;
402 CoarseGrid["Be"] = 35;
403 CoarseGrid["B"] = 35;
404 CoarseGrid["C"] = 35;
405 CoarseGrid["N"] = 35;
406 CoarseGrid["O"] = 35;
407 CoarseGrid["F"] = 35;
408 CoarseGrid["Ne"] = 35;
409
410 // orders for 2nd row elements taken from NWChem
411 CoarseGrid["Na"] = 70;
412 CoarseGrid["Mg"] = 70;
413 CoarseGrid["Al"] = 70;
414 CoarseGrid["Si"] = 70;
415 CoarseGrid["P"] = 70;
416 CoarseGrid["S"] = 70;
417 CoarseGrid["Cl"] = 70;
418 CoarseGrid["Ar"] = 70;
419
420 // orders for 3rd row elements taken from NWChem
421 CoarseGrid["K"] = 95;
422 CoarseGrid["Ca"] = 95;
423 CoarseGrid["Sc"] = 95;
424 CoarseGrid["Ti"] = 95;
425 CoarseGrid["V"] = 95;
426 CoarseGrid["Cr"] = 95;
427 CoarseGrid["Mn"] = 95;
428 CoarseGrid["Fe"] = 95;
429 CoarseGrid["Co"] = 95;
430 CoarseGrid["Ni"] = 95;
431 CoarseGrid["Cu"] = 95;
432 CoarseGrid["Zn"] = 95;
433 CoarseGrid["Ga"] = 95;
434 CoarseGrid["Ge"] = 95;
435 CoarseGrid["As"] = 95;
436 CoarseGrid["Se"] = 95;
437 CoarseGrid["Br"] = 95;
438 CoarseGrid["Kr"] = 95;
439
440 // 4th row (selection)
441 CoarseGrid["Ag"] = 104;
442 CoarseGrid["Rb"] = 104;
443 CoarseGrid["I"] = 104;
444 CoarseGrid["Xe"] = 104;
445 }
446
447 inline void FillXcoarseGrid() {
448
449 // order for H, He (not given in NWChem, assuming same as 1st row)
450 XcoarseGrid["H"] = 21;
451 XcoarseGrid["He"] = 21;
452
453 // orders for 1st row elements taken from NWChem
454 XcoarseGrid["Li"] = 21;
455 XcoarseGrid["Be"] = 21;
456 XcoarseGrid["B"] = 21;
457 XcoarseGrid["C"] = 21;
458 XcoarseGrid["N"] = 21;
459 XcoarseGrid["O"] = 21;
460 XcoarseGrid["F"] = 21;
461 XcoarseGrid["Ne"] = 21;
462
463 // orders for 2nd row elements taken from NWChem
464 XcoarseGrid["Na"] = 42;
465 XcoarseGrid["Mg"] = 42;
466 XcoarseGrid["Al"] = 42;
467 XcoarseGrid["Si"] = 42;
468 XcoarseGrid["P"] = 42;
469 XcoarseGrid["S"] = 42;
470 XcoarseGrid["Cl"] = 42;
471 XcoarseGrid["Ar"] = 42;
472
473 // orders for 3rd row elements taken from NWChem
474 XcoarseGrid["K"] = 75;
475 XcoarseGrid["Ca"] = 75;
476 XcoarseGrid["Sc"] = 75;
477 XcoarseGrid["Ti"] = 75;
478 XcoarseGrid["V"] = 75;
479 XcoarseGrid["Cr"] = 75;
480 XcoarseGrid["Mn"] = 75;
481 XcoarseGrid["Fe"] = 75;
482 XcoarseGrid["Co"] = 75;
483 XcoarseGrid["Ni"] = 75;
484 XcoarseGrid["Cu"] = 75;
485 XcoarseGrid["Zn"] = 75;
486 XcoarseGrid["Ga"] = 75;
487 XcoarseGrid["Ge"] = 75;
488 XcoarseGrid["As"] = 75;
489 XcoarseGrid["Se"] = 75;
490 XcoarseGrid["Br"] = 75;
491 XcoarseGrid["Kr"] = 75;
492
493 // 4th row (selection)
494 XcoarseGrid["Ag"] = 84;
495 XcoarseGrid["Rb"] = 84;
496 XcoarseGrid["I"] = 84;
497 XcoarseGrid["Xe"] = 84;
498 }
499};
500
501} // namespace xtp
502} // namespace votca
503#endif // VOTCA_XTP_RADIAL_EULER_MACLAURIN_RULE_H
Container to hold Basisfunctions for all atoms.
Definition aobasis.h:42
std::vector< double > CalculatePruningIntervals(const std::string &element)
std::map< std::string, GridContainers::radial_grid > CalculateAtomicRadialGrids(const AOBasis &aobasis, const QMMolecule &atoms, const std::string &type)
std::map< std::string, Index > pruning_set_
void FillElementRangeMap(const AOBasis &aobasis, const QMMolecule &atoms, double eps)
Index getGridParameters(const std::string &element, const std::string &type)
std::map< std::string, Index > FineGrid
GridContainers::radial_grid CalculateRadialGridforAtom(const std::string &type, const std::pair< std::string, min_exp > &element)
double DetermineCutoff(double alpha, Index l, double eps)
std::map< std::string, double > Accuracy
std::map< std::string, Index > CoarseGrid
void CalculateRadialCutoffs(const AOBasis &aobasis, const QMMolecule &atoms, const std::string &gridtype)
std::map< std::string, min_exp > element_ranges_
void RefineElementRangeMap(const AOBasis &aobasis, const QMMolecule &atoms, double eps)
double CalcResidual(double alpha, Index l, double cutoff)
std::map< std::string, Index > XcoarseGrid
std::map< std::string, double > BraggSlaterRadii_
double RadialIntegral(double alpha, Index l, double cutoff)
std::map< std::string, Index > MediumGrid
std::map< std::string, Index > XfineGrid
const double ang2bohr
Definition constants.h:48
base class for all analysis tools
Definition basebead.h:33
Eigen::Index Index
Definition types.h:26