ergo
grid_atomic.h
Go to the documentation of this file.
1 /* Ergo, version 3.7, a program for linear scaling electronic structure
2  * calculations.
3  * Copyright (C) 2018 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 
34 #if !defined(_GRID_ATOMIC_H_)
35 #define _GRID_ATOMIC_H_ 1
36 
37 #include "realtype.h"
38 #include "matrix_typedefs.h"
39 #include "basisinfo.h"
40 #include "grid_interface.h"
41 
42 typedef ergo_real real;
44 
45 extern const real BraggRadii[];
46 extern const unsigned BraggSize;
47 
48 
50 struct RadialScheme {
51  const char *name;
52  int gridSize;
53  explicit RadialScheme(const char *n) : name(n), gridSize(0) {}
54  inline int size() const { return gridSize; }
55  virtual void init(int myNumber, int charge, real threshold) = 0;
56  virtual void generate(real *r, real *w) = 0;
57  virtual ~RadialScheme() {}
58 };
59 
60 struct RadialSchemeGC2 : public RadialScheme {
61  void *quadData;
62  RadialSchemeGC2(): RadialScheme("Gauss-Chebychev scheme of second kind")
63  {}
64  virtual void init(int myNumber, int charge, real threshold);
65  virtual void generate(real *r, real *w);
66 };
67 
70  RadialSchemeTurbo(): RadialScheme("Chebychev T2 scheme/M4 mapping (Turbo)")
71  {}
72  virtual void init(int myNumber, int charge, real threshold);
73  virtual void generate(real *r, real *w);
74 };
75 
76 struct RadialSchemeLMG : public RadialScheme {
77  explicit RadialSchemeLMG(const GridGenMolInfo& ggmi_);
78 
79  virtual void init(int myNumber, int charge, real threshold);
80  virtual void generate(real *r, real *w);
81  virtual ~RadialSchemeLMG();
82  private:
84  int *nucorb;
85  real (*aa)[2];
86  int maxL;
87  /* grid params */
89 };
90 
91 
92 
93 #endif /* _GRID_ATOMIC_H_ */
virtual void generate(real *r, real *w)
Generates grid point positions and weights using Gauss-Chebyshev quadrature of second kind...
Definition: grid_atomic.cc:112
Definition: grid_atomic.h:68
double ergo_real
Definition: realtype.h:69
RadialScheme(const char *n)
Definition: grid_atomic.h:53
int maxL
Definition: grid_atomic.h:86
virtual void generate(real *r, real *w)
Generates grid point positions and associated weights using LMG method.
Definition: grid_atomic.cc:368
virtual void generate(real *r, real *w)
Actual generation of the radial quadrature.
Definition: grid_atomic.cc:185
int gridSize
Definition: grid_atomic.h:52
const real BraggRadii[]
vector of atoms&#39; Bragg radii.
Definition: grid_atomic.cc:39
Code for setting up basis functions starting from shells.
ergo_long_real long_real
Definition: grid_atomic.h:43
virtual void init(int myNumber, int charge, real threshold)
Initializes the LMG radial grid generator for given atom charge and acceptable error threshold...
Definition: grid_atomic.cc:324
RadialSchemeGC2()
Definition: grid_atomic.h:62
ergo_real real
Definition: test.cc:46
const char * name
Definition: grid_atomic.h:51
int size() const
Definition: grid_atomic.h:54
Grid Generator interface.
Definition: grid_atomic.h:60
void * quadData
Definition: grid_atomic.h:61
Definition of the main floating-point datatype used; the ergo_real type.
virtual void generate(real *r, real *w)=0
int * nucorb
Definition: grid_atomic.h:84
Definition: grid_atomic.h:76
double ergo_long_real
Definition: realtype.h:70
RadialSchemeLMG(const GridGenMolInfo &ggmi_)
Definition: grid_atomic.cc:212
virtual ~RadialSchemeLMG()
Definition: grid_atomic.cc:379
ergo_real real
Definition: grid_atomic.h:42
real grdc
Definition: grid_atomic.h:88
real(* aa)[2]
Definition: grid_atomic.h:85
virtual void init(int myNumber, int charge, real threshold)=0
Header file with typedefs for matrix and vector types.
GridGenMolInfo is an abstract class providing information about the molecule so that the grid generat...
Definition: grid_interface.h:45
RadialScheme describes the radial grid.
Definition: grid_atomic.h:50
real zeta
Definition: grid_atomic.h:69
real eph
Definition: grid_atomic.h:88
real h
Definition: grid_atomic.h:88
int charge
Definition: grid_test.cc:51
RadialSchemeTurbo()
Definition: grid_atomic.h:70
virtual void init(int myNumber, int charge, real threshold)
Initializes RadialSchemeGC2 grid generator.
Definition: grid_atomic.cc:90
const unsigned BraggSize
Number of defined elements in BraggRadii array.
Definition: grid_atomic.cc:75
virtual ~RadialScheme()
Definition: grid_atomic.h:57
const GridGenMolInfo & ggmi
Definition: grid_atomic.h:83
real rl
Definition: grid_atomic.h:88
virtual void init(int myNumber, int charge, real threshold)
This quadrature follows [JCP 102, 346 (1995)].
Definition: grid_atomic.cc:146