ergo
boysfunction.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
36
37#ifndef BOYSFUNCTION_HEADER
38#define BOYSFUNCTION_HEADER
39
40#include <vector>
41#include "realtype.h"
42#include "polydegree.h"
43
44#include "config.h" // Needed to get the PRECISION_QUAD_FLT128 macro
45
46/* We need Boys functions up to a degree 4 times the highest degree of basis functions. */
47#define BOYS_N_MAX (BASIS_FUNC_POLY_MAX_DEGREE*4+1)
48
49/* Tune things differently depending on required precision. */
50#if defined(PRECISION_QUAD_FLT128)
51#define BOYS_X_MAX 120.0
52#define BOYS_TAB_DEGREE 12
53#define BOYS_NO_OF_INTERVALS 1600
54#elif defined(PRECISION_LONG_DOUBLE)
55#define BOYS_X_MAX 85.0
56#define BOYS_TAB_DEGREE 10
57#define BOYS_NO_OF_INTERVALS 300
58#else
59#define BOYS_X_MAX 75.0
60#define BOYS_TAB_DEGREE 10
61#define BOYS_NO_OF_INTERVALS 200
62#endif
63
68
72
74 private:
75 std::vector<BoysFuncIntervalSetStruct> Boys_list;
79 public:
81 void init();
82 ergo_real BoysFunction(int n, ergo_real x) const;
83 ergo_real BoysFunction_expensive(int n, ergo_real x, int noOfIntegrationIntervals, int method = 0) const;
84 // Stuff needed for Chunks&Tasks usage
85 void write_to_buffer ( char * dataBuffer, size_t const bufferSize ) const;
86 size_t get_size() const;
87 void assign_from_buffer ( char const * dataBuffer, size_t const bufferSize);
88};
89
90#endif
#define BOYS_NO_OF_INTERVALS
Definition boysfunction.h:61
#define BOYS_N_MAX
Definition boysfunction.h:47
#define BOYS_TAB_DEGREE
Definition boysfunction.h:60
void assign_from_buffer(char const *dataBuffer, size_t const bufferSize)
Function needed for Chunks&Tasks usage.
Definition boysfunction.cc:303
size_t get_size() const
Function needed for Chunks&Tasks usage.
Definition boysfunction.cc:298
ergo_real BoysFunction_expensive(int n, ergo_real x, int noOfIntegrationIntervals, int method=0) const
Definition boysfunction.cc:256
ergo_real BoysFunction(int n, ergo_real x) const
Definition boysfunction.cc:252
std::vector< BoysFuncIntervalSetStruct > Boys_list
Definition boysfunction.h:75
int Boys_init_flag
Definition boysfunction.h:77
ergo_real SavedPrefactor_list[BOYS_N_MAX]
Definition boysfunction.h:76
void write_to_buffer(char *dataBuffer, size_t const bufferSize) const
Function needed for Chunks&Tasks usage.
Definition boysfunction.cc:281
BoysFunctionManager()
Definition boysfunction.cc:275
void init()
Definition boysfunction.cc:177
ergo_real BoysFunction_pretabulated(int n, ergo_real x) const
Definition boysfunction.cc:215
Constant determining which kinds of Gaussian basis functions are allowed; s, p, d,...
Definition of the main floating-point datatype used; the ergo_real type.
double ergo_real
Definition realtype.h:69
Definition boysfunction.h:69
BoysFuncIntervalStruct list[BOYS_NO_OF_INTERVALS]
Definition boysfunction.h:70
Definition boysfunction.h:64
ergo_real A[BOYS_TAB_DEGREE]
Definition boysfunction.h:66
ergo_real midx
Definition boysfunction.h:65