8#ifndef CARTDECOMPOSITION_GPU_HPP_
9#define CARTDECOMPOSITION_GPU_HPP_
11#include "ie_ghost_gpu.cuh"
13template<
unsigned int dim,
typename bc_type,
typename T2,
typename fine_s_type,
typename vsub_domain_type,
typename box_type>
14__device__ __host__
inline int processorID_impl(T2 & p,
16 vsub_domain_type & sub_domains_global,
17 const box_type & domain,
18 const bc_type (& bc)[dim])
23 int cl = fine_s.getCell(p);
24 int n_ele = fine_s.getNelements(cl);
27 for ( ; i < n_ele ; i++)
31 if (sub_domains_global.template get<0>(e).isInsideNP_with_border(p,domain,bc) ==
true)
41 printf(
"CartDecomposition_gpu.cuh:processorID_impl, error I cannot detect in which processor this particle go \n");
47 printf(
"CartDecomposition_gpu.cuh:processorID_impl, error I cannot detect in which processor this particle go because of round-off inconsistencies \n");
55 return sub_domains_global.template get<1>(e);
69 for (
size_t i = 0 ; i < dim ; i++)
71 if (bc.bc[i] == PERIODIC)
72 {pt.template get<0>()[i] = openfpm::math::periodic_l(pt.template get<0>()[i],domain.getHigh(i),domain.getLow(i));}
76template<
unsigned int dim,
typename T,
typename Memory,
template <
typename>
class layout_base>
98 for (
int i = 0 ; i < dim ; i++)
100 if (bc[i] == PERIODIC)
101 {pt.
get(i) = openfpm::math::periodic_l(pt.
get(i),domain.getHigh(i),domain.getLow(i));}
111 const int (& bc)[dim])
112 :
ie_ghost_gpu<dim,T,Memory,layout_base>(ieg),clk(clk),domain(domain),sub_domains_global(sub_domains_global)
114 for (
int s = 0 ; s < dim ; s++)
115 {this->bc[s] = bc[s];}
119 :
ie_ghost_gpu<dim,T,Memory,layout_base>(dec),clk(dec.clk),domain(dec.domain),sub_domains_global(dec.sub_domains_global)
121 for (
int s = 0 ; s < dim ; s++)
122 {this->bc[s] = dec.bc[s];}
139 return processorID_impl(pt,clk,sub_domains_global,domain,bc);
153 for (
size_t i = 0 ; i < dim ; i++)
155 if (bc[i] == PERIODIC)
156 {pt.template get<0>()[i] = openfpm::math::periodic_l(pt.template get<0>()[i],domain.getHigh(i),domain.getLow(i));}
170 return processorID_impl(pt,clk,sub_domains_global,domain,bc);
This class represent an N-dimensional box.
__device__ __host__ int processorID(const Point< dim, T > &pt)
Given a point return in which processor the particle should go.
__device__ __host__ int processorIDBC(const Point< dim, T > &p)
Given a point return in which processor the point/particle should go.
__device__ __host__ void applyPointBC(Point< dim, T > &pt) const
Apply boundary condition to the point.
__device__ __host__ void applyPointBC(encapc< 1, Point< dim, T >, Mem > &&pt) const
Apply boundary condition to the point.
This class implement the point shape in an N-dimensional space.
__device__ __host__ const T & get(unsigned int i) const
Get coordinate.
structure that store and compute the internal and external local ghost box. Version usable in kernel
aggregate of properties, from a list of object if create a struct that follow the OPENFPM native stru...
grid interface available when on gpu