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.
key.h
1 //
2 // Created by milinda on 6/28/17.
8 //
9 
10 #ifndef SFCSORTBENCH_KEY_H
11 #define SFCSORTBENCH_KEY_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 Key : public ot::TreeNode
27  {
28 
29  protected:
30  std::vector<unsigned int >m_uiOwnerList;
31  std::vector<unsigned int> m_uiStencilIndexWithDirection; // first 3 bits contains the direction (OCT_DIR_LEFT,OCT_DIR_RIGHT etc) and the other 5 bit contains the stencil index. Hence k_s max is 31.
32  unsigned int m_uiSearchResult;
33 
34 
35  public:
36  Key()
37  {
38  m_uiX=0;
39  m_uiY=0;
40  m_uiZ=0;
41  m_uiLevel=0;
42  m_uiSearchResult=0;
43 
44  m_uiOwnerList.clear();
45  m_uiStencilIndexWithDirection.clear();
46 
47  }
48 
49  Key(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)*/
50  {
51  m_uiX=px;
52  m_uiY=py;
53  m_uiZ=pz;
54  m_uiLevel=plevel;
55  m_uiSearchResult=0;
56 
57  m_uiOwnerList.clear();
58  m_uiStencilIndexWithDirection.clear();
59 
60 
61  }
62 
63  Key(unsigned int pLevel, unsigned int pMaxDepth)
64  {
65  m_uiX=0;
66  m_uiY=0;
67  m_uiZ=0;
68  m_uiSearchResult=0;
69  m_uiLevel=pLevel;
70 
71  m_uiOwnerList.clear();
72  m_uiStencilIndexWithDirection.clear();
73 
74 
75  }
76 
77  Key(const ot::TreeNode node)
78  {
79  m_uiX=node.getX();
80  m_uiY=node.getY();
81  m_uiZ=node.getZ();
82  m_uiLevel=node.getFlag();
83  m_uiSearchResult=0;
84 
85  m_uiOwnerList.clear();
86  m_uiStencilIndexWithDirection.clear();
87 
88 
89  }
90 
91  ~Key()
92  {
93  // need to delete the allocated variables
94 
95  m_uiOwnerList.clear();
96  m_uiStencilIndexWithDirection.clear();
97 
98  }
99 
100 
101  inline void operator= ( const ot::TreeNode & node )
102 
103  {
104 
105  //std::cout<<"shared_ptr_ copy begin0 : "<<*this<< " = "<<node<<std::endl;
106  //std::cout<<"shared_ptr_ copy begin1 : "<<*this<<" owner Size: "<<m_uiOwnerList.get()->size()<< " = "<<node<<" node ownerSize : "<<node.m_uiOwnerList.get()->size()<<std::endl;
107  m_uiX=node.getX();
108  m_uiY=node.getY();
109  m_uiZ=node.getZ();
110  m_uiLevel=node.getFlag();
111  m_uiSearchResult=0;
112 
113  m_uiOwnerList.clear();
114  m_uiStencilIndexWithDirection.clear();
115 
116  }
117 
118 
119  inline void setSearchResult(unsigned int pIndex)
120  {
121  m_uiSearchResult=pIndex;
122  }
123 
124  inline void addOwner(unsigned int ownerLocalID){
125  m_uiOwnerList.push_back(ownerLocalID);
126  }
127 
128 
129 
130  inline void addStencilIndexAndDirection(unsigned int index, unsigned int direction)
131  {
132  m_uiStencilIndexWithDirection.push_back(((index<<3) | direction));
133  }
134 
135 
136  inline unsigned int getOwnerListSize(){return m_uiOwnerList.size();}
137  inline std::vector<unsigned int>*getOwnerList(){return &m_uiOwnerList; }
138  inline std::vector<unsigned int>*getStencilIndexDirectionList(){return &m_uiStencilIndexWithDirection; }
139 
140  inline unsigned int getSearchResult()const {return m_uiSearchResult;}
141 
142 
143  };
144 
145 }
146 
147 
148 #endif //SFCSORTBENCH_KEY_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: key.h:26
unsigned int getX() const
get integer values of the octree coordinates.
Definition: TreeNode.h:366