ergo
multipole_prep.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 
38 #ifndef MULTIPOLE_PREP_HEADER
39 #define MULTIPOLE_PREP_HEADER
40 
41 #include "realtype.h"
42 #include "polydegree.h"
43 #include <cstddef> /* size_t */
44 
45 #define MAX_MULTIPOLE_DEGREE 15
46 #define MAX_NO_OF_MOMENTS_PER_MULTIPOLE ((MAX_MULTIPOLE_DEGREE+1)*(MAX_MULTIPOLE_DEGREE+1))
47 
48 #define MAX_MULTIPOLE_DEGREE_BASIC BASIS_FUNC_POLY_MAX_DEGREE
49 #define MAX_NO_OF_MOMENTS_PER_MULTIPOLE_BASIC ((MAX_MULTIPOLE_DEGREE_BASIC+1)*(MAX_MULTIPOLE_DEGREE_BASIC+1))
50 
51 typedef struct
52 {
53  ergo_real centerCoords[3];
54  int degree;
57  ergo_real maxAbsMomentList[MAX_MULTIPOLE_DEGREE+1];
58  ergo_real euclideanNormList[MAX_MULTIPOLE_DEGREE+1];
60 
61 typedef struct
62 {
63  ergo_real centerCoords[3];
64  int degree;
68 
70  public:
71  typedef struct {
72  int l;
73  int m;
74  } l_m_struct;
75  private:
79  public:
81  void init();
82  bool is_initialized() const;
83  const l_m_struct* get_l_m_list_ptr() const { return prepared_l_m_list; }
84  ergo_real get_lm_factor(int l, int m) const;
85  // Stuff needed for Chunks&Tasks usage
86  void write_to_buffer ( char * dataBuffer, size_t const bufferSize ) const;
87  size_t get_size() const;
88  void assign_from_buffer ( char const * dataBuffer, size_t const bufferSize);
89 };
90 
91 #endif
MultipolePrepManager::l_m_struct::m
int m
Definition: multipole_prep.h:73
multipole_struct_large::degree
int degree
Definition: multipole_prep.h:54
template_blas_sqrt
Treal template_blas_sqrt(Treal x)
MultipolePrepManager::prepared_l_m_list
l_m_struct prepared_l_m_list[MAX_NO_OF_MOMENTS_PER_MULTIPOLE]
Definition: multipole_prep.h:78
MultipolePrepManager::l_m_struct
Definition: multipole_prep.h:71
realtype.h
Definition of the main floating-point datatype used; the ergo_real type.
multipole_prep.h
This file contains preparatory stuff for computing multipole moments and related things.
MultipolePrepManager::assign_from_buffer
void assign_from_buffer(char const *dataBuffer, size_t const bufferSize)
Definition: multipole_prep.cc:116
ergo_real
double ergo_real
Definition: realtype.h:69
MultipolePrepManager::get_lm_factor
ergo_real get_lm_factor(int l, int m) const
Definition: multipole_prep.cc:98
get_l_m_from_index
static void get_l_m_from_index(int index, int *result_l, int *result_m)
Definition: multipole_prep.cc:61
template_blas_common.h
MultipolePrepManager::is_initialized
bool is_initialized() const
Definition: multipole_prep.cc:91
MultipolePrepManager
Definition: multipole_prep.h:69
polydegree.h
Constant determining which kinds of Gaussian basis functions are allowed; s, p, d,...
MAX_MULTIPOLE_DEGREE
#define MAX_MULTIPOLE_DEGREE
Definition: multipole_prep.h:45
MAX_NO_OF_MOMENTS_PER_MULTIPOLE_BASIC
#define MAX_NO_OF_MOMENTS_PER_MULTIPOLE_BASIC
Definition: multipole_prep.h:49
MultipolePrepManager::write_to_buffer
void write_to_buffer(char *dataBuffer, size_t const bufferSize) const
Definition: multipole_prep.cc:105
MultipolePrepManager::MultipolePrepManager
MultipolePrepManager()
Definition: multipole_prep.cc:73
slow_factorial
static ergo_real slow_factorial(int n)
Definition: multipole_prep.cc:49
multipole_struct_large::noOfMoments
int noOfMoments
Definition: multipole_prep.h:55
multipole_struct_large
Definition: multipole_prep.h:52
MultipolePrepManager::get_l_m_list_ptr
const l_m_struct * get_l_m_list_ptr() const
Definition: multipole_prep.h:83
MAX_NO_OF_MOMENTS_PER_MULTIPOLE
#define MAX_NO_OF_MOMENTS_PER_MULTIPOLE
Definition: multipole_prep.h:46
A
#define A
multipole_struct_small::noOfMoments
int noOfMoments
Definition: multipole_prep.h:65
MultipolePrepManager::l_m_struct::l
int l
Definition: multipole_prep.h:72
multipole_struct_small::degree
int degree
Definition: multipole_prep.h:64
multipole_struct_small
Definition: multipole_prep.h:62
MultipolePrepManager::initialized_flag
int initialized_flag
Definition: multipole_prep.h:76
get_lm_factor_slow
static ergo_real get_lm_factor_slow(int l, int m)
Definition: multipole_prep.cc:56
MultipolePrepManager::init
void init()
Definition: multipole_prep.cc:79
MultipolePrepManager::get_size
size_t get_size() const
Definition: multipole_prep.cc:112
output.h
Functionality for writing output messages to a text file.
MultipolePrepManager::prepared_lm_factor_list
ergo_real prepared_lm_factor_list[MAX_MULTIPOLE_DEGREE+1][MAX_MULTIPOLE_DEGREE+1]
Definition: multipole_prep.h:77