ergo
boysfunction.h
Go to the documentation of this file.
1 /* Ergo, version 3.8, a program for linear scaling electronic structure
2  * calculations.
3  * Copyright (C) 2019 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 
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 
64 typedef struct {
68 
69 typedef struct {
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
template_blas_pow
Treal template_blas_pow(Treal x, Treal y)
template_blas_sqrt
Treal template_blas_sqrt(Treal x)
BoysFunctionManager::Boys_list
std::vector< BoysFuncIntervalSetStruct > Boys_list
Definition: boysfunction.h:75
realtype.h
Definition of the main floating-point datatype used; the ergo_real type.
pi.h
Constants for the number pi and some related numbers like sqrt(pi).
BoysFunctionManager::assign_from_buffer
void assign_from_buffer(char const *dataBuffer, size_t const bufferSize)
Function needed for Chunks&Tasks usage.
Definition: boysfunction.cc:303
BoysFunctionManager::BoysFunction_pretabulated
ergo_real BoysFunction_pretabulated(int n, ergo_real x) const
Definition: boysfunction.cc:215
ergo_real
double ergo_real
Definition: realtype.h:69
boysfunction.h
Code for Boys function evaluation.
BoysFunction_raw_GaussLobatto
static ergo_real BoysFunction_raw_GaussLobatto(int n, ergo_real x, int noOfIntegrationIntervals, ergo_real endPt=1)
Definition: boysfunction.cc:128
BoysFunctionManager::BoysFunction_expensive
ergo_real BoysFunction_expensive(int n, ergo_real x, int noOfIntegrationIntervals, int method=0) const
Definition: boysfunction.cc:256
template_blas_exp
Treal template_blas_exp(Treal x)
BoysFunctionManager::get_size
size_t get_size() const
Function needed for Chunks&Tasks usage.
Definition: boysfunction.cc:298
mat_gblas.h
BoysFunctionManager
Definition: boysfunction.h:73
polydegree.h
Constant determining which kinds of Gaussian basis functions are allowed; s, p, d,...
BoysFuncIntervalStruct::midx
ergo_real midx
Definition: boysfunction.h:65
BoysFunctionManager::init
void init()
Definition: boysfunction.cc:177
pi
#define pi
Definition: pi.h:57
BoysFunction_raw_simpson
static ergo_real BoysFunction_raw_simpson(int n, ergo_real x, int noOfIntegrationIntervals)
Definition: boysfunction.cc:60
BoysFunctionIntegrand
static ergo_real BoysFunctionIntegrand(int n, ergo_real x, ergo_real t)
Definition: boysfunction.cc:94
BoysFunctionManager::write_to_buffer
void write_to_buffer(char *dataBuffer, size_t const bufferSize) const
Function needed for Chunks&Tasks usage.
Definition: boysfunction.cc:281
Util::TimeMeter::print
void print(int area, const char *routine)
Definition: utilities.h:111
utilities.h
Basic OS access utilities.
A
#define A
BOYS_X_MAX
#define BOYS_X_MAX
Definition: boysfunction.h:59
LOG_AREA_INTEGRALS
#define LOG_AREA_INTEGRALS
Definition: output.h:60
BoysFunctionManager::BoysFunction
ergo_real BoysFunction(int n, ergo_real x) const
Definition: boysfunction.cc:252
BoysFuncIntervalStruct::A
ergo_real A[BOYS_TAB_DEGREE]
Definition: boysfunction.h:66
BoysFunction_raw_booles_rule
static ergo_real BoysFunction_raw_booles_rule(int n, ergo_real x, int noOfIntegrationIntervals)
Definition: boysfunction.cc:100
BOYS_NO_OF_INTERVALS
#define BOYS_NO_OF_INTERVALS
Definition: boysfunction.h:61
BoysFuncIntervalStruct
Definition: boysfunction.h:64
config.h
BOYS_N_MAX
#define BOYS_N_MAX
Definition: boysfunction.h:47
BoysFunctionManager::SavedPrefactor_list
ergo_real SavedPrefactor_list[BOYS_N_MAX]
Definition: boysfunction.h:76
BoysFunctionManager::BoysFunctionManager
BoysFunctionManager()
Definition: boysfunction.cc:275
BoysFuncIntervalSetStruct
Definition: boysfunction.h:69
BoysFunctionManager::Boys_init_flag
int Boys_init_flag
Definition: boysfunction.h:77
BOYS_TAB_DEGREE
#define BOYS_TAB_DEGREE
Definition: boysfunction.h:60
Util::TimeMeter
Time-measuring class.
Definition: utilities.h:80
output.h
Functionality for writing output messages to a text file.
semiFactorial
static ergo_real semiFactorial(int n)
Definition: boysfunction.cc:50