ergo
box_system.h
Go to the documentation of this file.
1 /* Ergo, version 3.4, a program for linear scaling electronic structure
2  * calculations.
3  * Copyright (C) 2014 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 
28 #ifndef BOX_SYSTEM_HEADER
29 #define BOX_SYSTEM_HEADER
30 
31 
32 #include "realtype.h"
33 
34 
35 typedef struct
36 {
37  ergo_real centerCoords[3];
40 
41 
42 typedef struct
43 {
44  ergo_real centerCoords[3];
46  int noOfItems;
51 
52 typedef struct
53 {
54  int noOfBoxes;
57 
58 #define MAX_NO_OF_BOX_LEVELS 30
59 
60 class BoxSystem
61 {
62  public:
67  BoxSystem();
68  ~BoxSystem();
69  int create_box_system(box_item_struct* itemList,
70  int noOfItems,
71  ergo_real toplevelBoxSize);
72  int get_items_near_point(const box_item_struct* itemList,
73  const ergo_real* coords,
75  int* resultOrgIndexList) const;
76  private:
78  const ergo_real* coords,
80  int* resultOrgIndexList,
81  int level,
82  int boxIndex) const;
83 };
84 
85 
86 
87 
88 #endif
int totNoOfBoxes
Definition: box_system.h:63
ergo_real width
Definition: box_system.h:45
double ergo_real
Definition: realtype.h:53
int noOfItems
Definition: box_system.h:46
int noOfLevels
Definition: box_system.h:64
Definition: box_system.h:42
~BoxSystem()
Definition: box_system.cc:52
int firstItemIndex
Definition: box_system.h:47
static ergo_real distance(const ergo_real *a, const ergo_real *b)
Coomputes distance between two points, they do not need to be of the Vector3D type.
Definition: dft_common.cc:530
int create_box_system(box_item_struct *itemList, int noOfItems, ergo_real toplevelBoxSize)
Creates the box system.
Definition: box_system.cc:67
int get_items_near_point_recursive(const box_item_struct *itemList, const ergo_real *coords, ergo_real distance, int *resultOrgIndexList, int level, int boxIndex) const
Definition: box_system.cc:336
Definition: box_system.h:52
int get_items_near_point(const box_item_struct *itemList, const ergo_real *coords, ergo_real distance, int *resultOrgIndexList) const
Goes through existning box system to find all items within specified distance from given reference po...
Definition: box_system.cc:414
int noOfBoxes
Definition: box_system.h:54
box_level_struct levelList[MAX_NO_OF_BOX_LEVELS]
Definition: box_system.h:65
box_struct_basic * boxList
Definition: box_system.h:66
Definition: box_system.h:35
#define MAX_NO_OF_BOX_LEVELS
Definition: box_system.h:58
BoxSystem()
Definition: box_system.cc:47
int firstChildBoxIndex
Definition: box_system.h:49
int startIndexInBoxList
Definition: box_system.h:55
int noOfChildBoxes
Definition: box_system.h:48
int originalIndex
Definition: box_system.h:38
Definition: box_system.h:60