Dendro  5.01
Dendro in Greek language means tree. The Dendro library is a large scale (262K cores on ORNL's Titan) distributed memory adaptive octree framework. The main goal of Dendro is to perform large scale multiphysics simulations efficeiently in mordern supercomputers. Dendro consists of efficient parallel data structures and algorithms to perform variational ( finite element) methods and finite difference mthods on 2:1 balanced arbitary adaptive octrees which enables the users to perform simulations raning from black holes (binary black hole mergers) to blood flow in human body, where applications ranging from relativity, astrophysics to biomedical engineering.
skey.h
1 //
2 // Created by milinda on 8/25/17.
8 //
9 
10 #ifndef SFCSORTBENCH_SEARCHKEY_H
11 #define SFCSORTBENCH_SEARCHKEY_H
12 
13 #include "TreeNode.h"
14 #include <iostream>
15 #include <vector>
16 #include <climits>
17 #include <memory>
18 
19 namespace ot
20 {
21 
22 
26  class SearchKey : public ot::TreeNode
27  {
28 
29  protected:
30  int m_uiOwner;
31  int m_uiStencilIndexWithDirection;
32 
33 
34 
35  public:
36  SearchKey()
37  {
38  m_uiX=0;
39  m_uiY=0;
40  m_uiZ=0;
41  m_uiLevel=0;
42  m_uiOwner=-1;
43  m_uiStencilIndexWithDirection=-1;
44 
45 
46  }
47 
48  SearchKey(unsigned int px, unsigned int py, unsigned int pz, unsigned int plevel,unsigned int pDim,unsigned int pMaxDepth)/*: ot::TreeNode(px,py,pz,plevel,pDim,pMaxDepth)*/
49  {
50  m_uiX=px;
51  m_uiY=py;
52  m_uiZ=pz;
53  m_uiLevel=plevel;
54  m_uiOwner=-1;
55  m_uiStencilIndexWithDirection=-1;
56 
57  }
58 
59  SearchKey(unsigned int pLevel, unsigned int pMaxDepth)
60  {
61  m_uiX=0;
62  m_uiY=0;
63  m_uiZ=0;
64  m_uiLevel=pLevel;
65  m_uiOwner=-1;
66  m_uiStencilIndexWithDirection=-1;
67 
68  }
69 
70  SearchKey(const ot::TreeNode node)
71  {
72  m_uiX=node.getX();
73  m_uiY=node.getY();
74  m_uiZ=node.getZ();
75  m_uiLevel=node.getFlag();
76  m_uiOwner=-1;
77  m_uiStencilIndexWithDirection=-1;
78 
79  }
80 
81  ~SearchKey()
82  {
83  // need to delete the allocated variables
84  }
85 
86  inline void operator= (const SearchKey& node )
87  {
88  m_uiX=node.getX();
89  m_uiY=node.getY();
90  m_uiZ=node.getZ();
91  m_uiLevel=node.getFlag();
92  m_uiOwner=node.m_uiOwner;
93  m_uiStencilIndexWithDirection=node.m_uiStencilIndexWithDirection;
94  }
95 
96  inline void operator= ( const ot::TreeNode & node )
97 
98  {
99  m_uiX=node.getX();
100  m_uiY=node.getY();
101  m_uiZ=node.getZ();
102  m_uiLevel=node.getFlag();
103  m_uiOwner=-1;
104  m_uiStencilIndexWithDirection=-1;
105  }
106 
107  inline void addOwner(unsigned int ownerLocalID){
108  m_uiOwner=ownerLocalID;
109  }
110 
111 
112  inline void addStencilIndexAndDirection(unsigned int index, unsigned int direction)
113  {
114  m_uiStencilIndexWithDirection=((index<<3) | direction);
115  }
116 
117  inline void addStencilIndexAndDirection(unsigned int direction)
118  {
119  m_uiStencilIndexWithDirection=direction;
120  }
121 
122 
123  inline int getOwner(){return m_uiOwner;}
124  inline int getStencilIndexDirectionList(){return m_uiStencilIndexWithDirection;}
125 
126 
127  };
128 
129 }
130 
131 
132 #endif //SFCSORTBENCH_SEARCHKEY_H
Simple class to manage async data transfer in the ODA class.
Definition: asyncExchangeContex.h:16
unsigned int getFlag() const
get the m_uiFlag value. Which is used to store the level and other aditional info.
Definition: TreeNode.h:402
A class to manage octants.
Definition: TreeNode.h:35
Definition: skey.h:26
unsigned int getX() const
get integer values of the octree coordinates.
Definition: TreeNode.h:366