ergo
grid_atomic.h
Go to the documentation of this file.
1 /* Ergo, version 3.3, a program for linear scaling electronic structure
2  * calculations.
3  * Copyright (C) 2013 Elias Rudberg, Emanuel H. Rubensson, and Pawel Salek.
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  *
18  * Primary academic reference:
19  * Kohn−Sham Density Functional Theory Electronic Structure Calculations
20  * with Linearly Scaling Computational Time and Memory Usage,
21  * Elias Rudberg, Emanuel H. Rubensson, and Pawel Salek,
22  * J. Chem. Theory Comput. 7, 340 (2011),
23  * <http://dx.doi.org/10.1021/ct100611z>
24  *
25  * For further information about Ergo, see <http://www.ergoscf.org>.
26  */
27 
32 #if !defined(_GRID_ATOMIC_H_)
33 #define _GRID_ATOMIC_H_ 1
34 
35 #include "realtype.h"
36 #include "matrix_typedefs.h"
37 #include "basisinfo.h"
38 #include "grid_interface.h"
39 
40 typedef ergo_real real;
42 
43 extern const real BraggRadii[];
44 extern const unsigned BraggSize;
45 
46 
48 struct RadialScheme {
49  const char *name;
50  int gridSize;
51  explicit RadialScheme(const char *n) : name(n), gridSize(0) {}
52  inline int size() const { return gridSize; }
53  virtual void init(int myNumber, int charge, real threshold) = 0;
54  virtual void generate(real *r, real *w) = 0;
55  virtual ~RadialScheme() {}
56 };
57 
58 struct RadialSchemeGC2 : public RadialScheme {
59  void *quadData;
60  RadialSchemeGC2(): RadialScheme("Gauss-Chebychev scheme of second kind")
61  {}
62  virtual void init(int myNumber, int charge, real threshold);
63  virtual void generate(real *r, real *w);
64 };
65 
68  RadialSchemeTurbo(): RadialScheme("Chebychev T2 scheme/M4 mapping (Turbo)")
69  {}
70  virtual void init(int myNumber, int charge, real threshold);
71  virtual void generate(real *r, real *w);
72 };
73 
74 struct RadialSchemeLMG : public RadialScheme {
75  explicit RadialSchemeLMG(const GridGenMolInfo& ggmi_);
76 
77  virtual void init(int myNumber, int charge, real threshold);
78  virtual void generate(real *r, real *w);
79  virtual ~RadialSchemeLMG();
80  private:
82  int *nucorb;
83  real (*aa)[2];
84  int maxL;
85  /* grid params */
87 };
88 
89 
90 
91 #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:110
Definition: grid_atomic.h:66
double ergo_real
Definition: realtype.h:53
RadialScheme(const char *n)
Definition: grid_atomic.h:51
int maxL
Definition: grid_atomic.h:84
virtual void generate(real *r, real *w)
Generates grid point positions and associated weights using LMG method.
Definition: grid_atomic.cc:366
virtual void generate(real *r, real *w)
Actual generation of the radial quadrature.
Definition: grid_atomic.cc:183
int gridSize
Definition: grid_atomic.h:50
const real BraggRadii[]
vector of atoms' Bragg radii.
Definition: grid_atomic.cc:37
ergo_long_real long_real
Definition: grid_atomic.h:41
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:322
RadialSchemeGC2()
Definition: grid_atomic.h:60
const char * name
Definition: grid_atomic.h:49
Grid Generator interface.
Definition: grid_atomic.h:58
void * quadData
Definition: grid_atomic.h:59
virtual void generate(real *r, real *w)=0
int * nucorb
Definition: grid_atomic.h:82
Definition: grid_atomic.h:74
int size() const
Definition: grid_atomic.h:52
double ergo_long_real
Definition: realtype.h:54
RadialSchemeLMG(const GridGenMolInfo &ggmi_)
Definition: grid_atomic.cc:210
virtual ~RadialSchemeLMG()
Definition: grid_atomic.cc:377
ergo_real real
Definition: grid_atomic.h:40
real grdc
Definition: grid_atomic.h:86
real(* aa)[2]
Definition: grid_atomic.h:83
virtual void init(int myNumber, int charge, real threshold)=0
ergo_real real
Definition: cubature_rules.h:33
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:43
RadialScheme describes the radial grid.
Definition: grid_atomic.h:48
real zeta
Definition: grid_atomic.h:67
real eph
Definition: grid_atomic.h:86
real h
Definition: grid_atomic.h:86
int charge
Definition: grid_test.cc:49
RadialSchemeTurbo()
Definition: grid_atomic.h:68
virtual void init(int myNumber, int charge, real threshold)
Initializes RadialSchemeGC2 grid generator.
Definition: grid_atomic.cc:88
const unsigned BraggSize
Number of defined elements in BraggRadii array.
Definition: grid_atomic.cc:73
virtual ~RadialScheme()
Definition: grid_atomic.h:55
const GridGenMolInfo & ggmi
Definition: grid_atomic.h:81
real rl
Definition: grid_atomic.h:86
virtual void init(int myNumber, int charge, real threshold)
This quadrature follows [JCP 102, 346 (1995)].
Definition: grid_atomic.cc:144