41template<
typename vector_dist_type,
typename functor_test,
typename functor_pr
int>
42bool debug_find(vector_dist_type & vd, functor_test fun_test, functor_print fun_print,
43 debug_iterator it = debug_iterator::DOMAIN_IT, debug_run type_of_run = debug_run::HOST,
48 if (it == debug_iterator::DOMAIN_IT)
49 {ite = vd.getDomainIterator();}
50 else if (it == debug_iterator::DOMAIN_GHOST_IT)
51 {ite = vd.getDomainAndGhostIterator();}
53 {ite = vd.getGhostIterator();}
55 bool test_tot =
false;
59 bool test = fun_test(ite.get().getKey());
62 if (test ==
true && print ==
true)
63 {std::cout << fun_print(ite.get().getKey()) << std::endl;}
86template<
typename vector_type,
typename functor_test,
typename functor_pr
int>
87bool debug_find_single(
vector_type vd, functor_test fun_test, functor_print fun_print,
88 size_t g_m, debug_iterator it = debug_iterator::DOMAIN_IT, debug_run type_of_run = debug_run::HOST,
93 if (it == debug_iterator::DOMAIN_IT)
94 {ite = vd.getIteratorTo(g_m);}
95 else if (it == debug_iterator::DOMAIN_GHOST_IT)
98 {ite = vd.getIteratorFrom(g_m);}
100 bool test_tot =
false;
104 bool test = fun_test(ite.get());
107 if (test ==
true && print ==
true)
108 {std::cout << fun_print(ite.get()) << std::endl;}
125template<
typename vector_dist_type>
127 debug_iterator it = debug_iterator::DOMAIN_IT, debug_run type_of_run = debug_run::HOST,
130 auto fun_test = [&vd,&box](
unsigned int p){
return box.
isInside(vd.getPos(p));};
131 auto fun_print = [&vd,&box](
unsigned int p)
133 std::stringstream message;
134 message <<
"Debug info: detected particle p=" << p <<
" inside box: " << box.
toString() << std::endl;
135 return message.str();
138 return debug_find(vd,fun_test,fun_print,it,type_of_run,print);
151template<
typename vector_type>
153 size_t g_m, std::string message = std::string() , debug_iterator it = debug_iterator::DOMAIN_IT, debug_run type_of_run = debug_run::HOST,
156 auto fun_test = [&vd,&box](
unsigned int p){
return box.
isInside(vd.template get<0>(p));};
157 auto fun_print = [&vd,&box,&message](
unsigned int p)
159 std::stringstream message_srm;
160 message_srm <<
"Debug info: " << message <<
" detected particle p=" << p <<
" inside box: " << box.toString() << std::endl;
161 return message_srm.str();
164 return debug_find_single(vd,fun_test,fun_print,g_m,it,type_of_run,print);
This class represent an N-dimensional box.
std::string toString() const
Produce a string from the object.
__host__ __device__ bool isInside(const Point< dim, T > &p) const
Check if the point is inside the box.
Iterator that Iterate across particle indexes.
vector_dist_iterator getIterator()
Get an iterator that traverse domain and ghost particles.