Commit a2154f09 authored by DUFOYER Benjamin's avatar DUFOYER Benjamin
Browse files

fix error

parent 68b820ae
...@@ -21,7 +21,7 @@ protected: ...@@ -21,7 +21,7 @@ protected:
std::vector<node_t>* linear_tree; std::vector<node_t>* linear_tree;
std::vector<std::pair<unsigned long long int,unsigned long long int>> particle_repartition; std::vector<std::pair<unsigned long long int,unsigned long long int>> particle_repartition;
bool unknow_particle_repartition = true:; bool unknow_particle_repartition = true;
public: public:
...@@ -179,14 +179,18 @@ public: ...@@ -179,14 +179,18 @@ public:
return this->get_leaf_level(); return this->get_leaf_level();
} }
size_t get_first_morton_index(){ size_t get_first_morton_index() const{
return this->linear_tree->front().morton_index; return this->linear_tree->front().morton_index;
} }
size_t get_last_morton_index(){ size_t get_last_morton_index() const{
return this->linear_tree->back().morton_index; return this->linear_tree->back().morton_index;
} }
/**
* This function print the information of this current class
* @author benjamin.dufoyer@inria.fr
*/
void print_info_tree(){ void print_info_tree(){
std::cout << " nb_leaf : " << this->linear_tree->size() << std::endl; std::cout << " nb_leaf : " << this->linear_tree->size() << std::endl;
std::cout << " nb_block : " << nb_block << std::endl; std::cout << " nb_block : " << nb_block << std::endl;
...@@ -196,6 +200,10 @@ public: ...@@ -196,6 +200,10 @@ public:
} }
} }
/**
* This function return the linear tree associated with this calss
* @author benjamin.dufoyer@inria.fr
*/
std::vector<node_t>* get_tree(){ std::vector<node_t>* get_tree(){
return this->linear_tree; return this->linear_tree;
} }
...@@ -210,6 +218,7 @@ public: ...@@ -210,6 +218,7 @@ public:
void set_particle_repartition( void set_particle_repartition(
std::vector<particle_t> particle_container) std::vector<particle_t> particle_container)
{ {
unknow_particle_repartition = false;
dstr_grp_tree_builder::know_particle_division( dstr_grp_tree_builder::know_particle_division(
this->mpi_conf, this->mpi_conf,
particle_container, particle_container,
...@@ -217,7 +226,7 @@ public: ...@@ -217,7 +226,7 @@ public:
} }
std::vector<std::pair<unsigned long long int,unsigned long long int>>* std::vector<std::pair<unsigned long long int,unsigned long long int>>*
get_particle_repartition() get_particle_repartition(){
// TO get the particle repartition, you will compute it before // TO get the particle repartition, you will compute it before
FAssert(!unknow_particle_repartition); FAssert(!unknow_particle_repartition);
return &this->particle_repartition; return &this->particle_repartition;
...@@ -233,15 +242,17 @@ public: ...@@ -233,15 +242,17 @@ public:
/** /**
* return the max morton index of the left proc * return the max morton index of the left proc
* it's needed for the distributed construction of the groupTree * it's needed for the distributed construction of the groupTree
* you will compute the repartition before calling this function * [RESTRICTION] you will compute the repartition before calling this function
* @author benjamin.dufoyer@inria.fr * @author benjamin.dufoyer@inria.fr
* @return Morton Index * @return max left morton index, -1 if he doesn't exist
*/ */
unsigned long long int get_left_limit(){ long long int get_left_limit(){
// Check if the repartition have been compute
FAssert(!unknow_particle_repartition); FAssert(!unknow_particle_repartition);
int my_rank = this->mpi_conf.comm.rank(); int my_rank = this->mpi_conf.comm.rank();
long long int left_limit = -1;
if(my_rank != 0){ if(my_rank != 0){
left_limit = this->particle_repartition[my_rank-1].second; left_limit = (long long int )this->particle_repartition[my_rank-1].second;
} }
return left_limit; return left_limit;
} }
...@@ -316,6 +327,19 @@ public: ...@@ -316,6 +327,19 @@ public:
} }
/**
* This function is used to show the FGroupLinearTee more easly
* @author benjamin.dufoyer@inria.fr
*/
friend
std::ostream& operator<<(std::ostream& os, const FGroupLinearTree& n) {
return os << "--> Number of leaf : " << n.get_nb_leaf()
<< "\n first leaf : " << n.get_first_morton_index()
<< "\n last leaf : " << n.get_last_morton_index()
<< "\n block_size " << n.get_block_size()
<< "\n number of block : " << n.get_nb_block();
}
}; };
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment