OpenFPM_pdata  4.1.0
Project that contain the implementation of distributed structures
grid_dist_amr_key.hpp
1 /*
2  * grid_dist_amr_key.hpp
3  *
4  * Created on: Sep 23, 2017
5  * Author: i-bird
6  */
7 
8 #ifndef SRC_AMR_GRID_DIST_AMR_KEY_HPP_
9 #define SRC_AMR_GRID_DIST_AMR_KEY_HPP_
10 
16 template<unsigned int dim>
18 {
20  size_t lvl;
21 
24 
25 
26 public:
27 
35  inline grid_dist_amr_key(size_t lvl,
37  :lvl(lvl),key(key)
38  {}
39 
45  inline const grid_dist_key_dx<dim> & getKey() const
46  {
47  return key;
48  }
49 
56  {
57  return key;
58  }
59 
60 
66  inline size_t getLvl() const
67  {
68  return lvl;
69  }
70 
76  inline void setLvl(size_t lvl)
77  {
78  this->lvl = lvl;
79  }
80 
89  inline grid_dist_amr_key<dim> moveSpace(size_t d,size_t s)
90  {
91  return grid_dist_amr_key<dim>(lvl,key.move(d,s));
92  }
93 };
94 
95 
96 
97 
98 #endif /* SRC_AMR_GRID_DIST_AMR_KEY_HPP_ */
size_t getLvl() const
Return the level.
grid_dist_amr_key< dim > moveSpace(size_t d, size_t s)
Create a new key moving the old one.
grid_dist_key_dx< dim, base_key > move(size_t i, int s) const
Create a new key moving the old one.
void setLvl(size_t lvl)
Return the level.
grid_dist_key_dx< dim > key
actual position in the distributed grid
grid_dist_key_dx< dim > & getKeyRef()
Return the grid key (as reference)
grid_dist_amr_key(size_t lvl, grid_dist_key_dx< dim > key)
Amr grid distributed key.
size_t lvl
actual level
const grid_dist_key_dx< dim > & getKey() const
Return the grid key.