Commit 3ff0c661 authored by incardon's avatar incardon

Fixing decompisition processing processorID_impl

parent adc6d487
openfpm_data @ 98254b90
Subproject commit e667bae7130d2472018ea68de9db15c110272b79 Subproject commit 98254b90ea298be282e62fc25ef69ee942a60d67
...@@ -1068,7 +1068,7 @@ public: ...@@ -1068,7 +1068,7 @@ public:
*/ */
template<typename Mem> size_t inline processorID(const encapc<1, Point<dim,T>, Mem> & p) const template<typename Mem> size_t inline processorID(const encapc<1, Point<dim,T>, Mem> & p) const
{ {
return processorID_impl(p,fine_s,sub_domains_global); return processorID_impl(p,fine_s,sub_domains_global,getDomain(),bc);
} }
/*! \brief Given a point return in which processor the particle should go /*! \brief Given a point return in which processor the particle should go
...@@ -1080,7 +1080,7 @@ public: ...@@ -1080,7 +1080,7 @@ public:
*/ */
size_t inline processorID(const Point<dim,T> &p) const size_t inline processorID(const Point<dim,T> &p) const
{ {
return processorID_impl(p,fine_s,sub_domains_global); return processorID_impl(p,fine_s,sub_domains_global,getDomain(),bc);
} }
/*! \brief Given a point return in which processor the particle should go /*! \brief Given a point return in which processor the particle should go
...@@ -1092,7 +1092,7 @@ public: ...@@ -1092,7 +1092,7 @@ public:
*/ */
size_t inline processorID(const T (&p)[dim]) const size_t inline processorID(const T (&p)[dim]) const
{ {
return processorID_impl(p,fine_s,sub_domains_global); return processorID_impl(p,fine_s,sub_domains_global,getDomain(),bc);
} }
/*! \brief Given a point return in which processor the point/particle should go /*! \brief Given a point return in which processor the point/particle should go
...@@ -1110,7 +1110,7 @@ public: ...@@ -1110,7 +1110,7 @@ public:
applyPointBC(pt); applyPointBC(pt);
return processorID_impl(pt,fine_s,sub_domains_global); return processorID_impl(pt,fine_s,sub_domains_global,getDomain(),bc);
} }
/*! \brief Given a point return in which processor the particle should go /*! \brief Given a point return in which processor the particle should go
...@@ -1129,7 +1129,7 @@ public: ...@@ -1129,7 +1129,7 @@ public:
// Get the number of elements in the cell // Get the number of elements in the cell
return processorID_impl(pt,fine_s,sub_domains_global); return processorID_impl(pt,fine_s,sub_domains_global,getDomain(),bc);
} }
/*! \brief Given a point return in which processor the particle should go /*! \brief Given a point return in which processor the particle should go
...@@ -1146,7 +1146,7 @@ public: ...@@ -1146,7 +1146,7 @@ public:
Point<dim,T> pt = p; Point<dim,T> pt = p;
applyPointBC(pt); applyPointBC(pt);
return processorID_impl(pt,fine_s,sub_domains_global); return processorID_impl(pt,fine_s,sub_domains_global,getDomain(),bc);
} }
/*! \brief Get the periodicity on i dimension /*! \brief Get the periodicity on i dimension
......
...@@ -10,8 +10,12 @@ ...@@ -10,8 +10,12 @@
#include "ie_ghost_gpu.cuh" #include "ie_ghost_gpu.cuh"
template<typename T2, typename fine_s_type, typename vsub_domain_type> template<unsigned int dim, typename bc_type, typename T2, typename fine_s_type, typename vsub_domain_type, typename box_type>
__device__ __host__ inline int processorID_impl(T2 & p, fine_s_type & fine_s, vsub_domain_type & sub_domains_global) __device__ __host__ inline int processorID_impl(T2 & p,
fine_s_type & fine_s,
vsub_domain_type & sub_domains_global,
const box_type & domain,
const bc_type (& bc)[dim])
{ {
// Get the number of elements in the cell // Get the number of elements in the cell
...@@ -24,7 +28,7 @@ __device__ __host__ inline int processorID_impl(T2 & p, fine_s_type & fine_s, vs ...@@ -24,7 +28,7 @@ __device__ __host__ inline int processorID_impl(T2 & p, fine_s_type & fine_s, vs
{ {
e = fine_s.get(cl,i); e = fine_s.get(cl,i);
if (sub_domains_global.template get<0>(e).isInsideNP(p) == true) if (sub_domains_global.template get<0>(e).isInsideNP_with_border(p,domain,bc) == true)
{ {
break; break;
} }
...@@ -34,13 +38,13 @@ __device__ __host__ inline int processorID_impl(T2 & p, fine_s_type & fine_s, vs ...@@ -34,13 +38,13 @@ __device__ __host__ inline int processorID_impl(T2 & p, fine_s_type & fine_s, vs
if (n_ele == 0) if (n_ele == 0)
{ {
printf("CartDecomposition_gpu.cuh:processorID_impl, error I cannot detect in which processor this particle go"); printf("CartDecomposition_gpu.cuh:processorID_impl, error I cannot detect in which processor this particle go \n");
return -1; return -1;
} }
if (i == n_ele) if (i == n_ele)
{ {
printf("CartDecomposition_gpu.cuh:processorID_impl, error I cannot detect in which processor this particle go because of round-off inconsistencies"); printf("CartDecomposition_gpu.cuh:processorID_impl, error I cannot detect in which processor this particle go because of round-off inconsistencies \n");
return -1; return -1;
} }
...@@ -132,7 +136,7 @@ public: ...@@ -132,7 +136,7 @@ public:
Point<dim,T> pt = p; Point<dim,T> pt = p;
this->applyPointBC(pt); this->applyPointBC(pt);
return processorID_impl(pt,clk,sub_domains_global); return processorID_impl(pt,clk,sub_domains_global,domain,bc);
} }
/*! \brief Apply boundary condition to the point /*! \brief Apply boundary condition to the point
...@@ -163,7 +167,7 @@ public: ...@@ -163,7 +167,7 @@ public:
*/ */
__device__ __host__ int inline processorID(const Point<dim,T> &pt) __device__ __host__ int inline processorID(const Point<dim,T> &pt)
{ {
return processorID_impl(pt,clk,sub_domains_global); return processorID_impl(pt,clk,sub_domains_global,domain,bc);
} }
}; };
......
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