Commit 77ebd35b authored by incardon's avatar incardon

Fix for layout gpu

parent 4e569e3b
......@@ -43,8 +43,8 @@ public:
* \return an iterator to the selected particles
*
*/
template<unsigned int dim, typename T, typename aggr, typename Decomposition> static PointIteratorSkin<dim,T,Decomposition>
DrawSkin(vector_dist<dim,T,aggr,Decomposition> & vd,
template<unsigned int dim, typename T, typename aggr, typename layout, template<typename> class layout_base ,typename Decomposition> static PointIteratorSkin<dim,T,Decomposition>
DrawSkin(vector_dist<dim,T,aggr,layout,layout_base,Decomposition> & vd,
size_t (& sz)[dim],
Box<dim,T> & domain,
Box<dim,T> & sub_A,
......@@ -79,8 +79,8 @@ public:
* \return an iterator to the selected particles
*
*/
template<unsigned int dim, typename T, typename aggr, typename Decomposition> static PointIteratorSkin<dim,T,Decomposition>
DrawSkin(vector_dist<dim,T,aggr,Decomposition> & vd,
template<unsigned int dim, typename T, typename aggr, typename layout, template <typename> class layout_base, typename Decomposition> static PointIteratorSkin<dim,T,Decomposition>
DrawSkin(vector_dist<dim,T,aggr,layout,layout_base,Decomposition> & vd,
size_t (& sz)[dim],
Box<dim,T> & domain,
openfpm::vector<Box<dim,T>> & sub_A,
......@@ -117,8 +117,8 @@ public:
* \return an iterator to the selected particles
*
*/
template<unsigned int dim, typename T, typename aggr, typename Decomposition> static PointIterator<dim,T,Decomposition>
DrawBox(vector_dist<dim,T,aggr,Decomposition> & vd,
template<unsigned int dim, typename T, typename aggr, typename layout, template <typename> class layout_base, typename Decomposition> static PointIterator<dim,T,Decomposition>
DrawBox(vector_dist<dim,T,aggr,layout,layout_base,Decomposition> & vd,
size_t (& sz)[dim],
Box<dim,T> & domain,
Box<dim,T> & sub)
......
......@@ -136,8 +136,15 @@ public:
* \param sp grid spacing
*
*/
PointIteratorSkin( Decomposition & dec, size_t (& sz)[dim], const Box<dim,T> & domain, const Box<dim,T> & sub_A, const Box<dim,T> & sub_B, size_t (& bc)[dim])
:grid_dist_id_iterator_dec_skin<Decomposition>(dec, sz, getAB(sz,domain,sub_A,sub_B,sp,RETURN_A), getAB(sz,domain,sub_A,sub_B,sp,RETURN_B), bc),domain(domain)
PointIteratorSkin( Decomposition & dec,
size_t (& sz)[dim],
const Box<dim,T> & domain,
const Box<dim,T> & sub_A,
const Box<dim,T> & sub_B,
size_t (& bc)[dim])
:grid_dist_id_iterator_dec_skin<Decomposition>(dec, sz, getAB(sz,domain,sub_A,sub_B,sp,RETURN_A),
getAB(sz,domain,sub_A,sub_B,sp,RETURN_B), bc),
domain(domain)
{
sub_domainA.add(sub_A);
calculateAp();
......
......@@ -204,7 +204,6 @@ fun_name(double d, const vector_dist_expression_op<exp1,exp2,op1> & va)\
CREATE_VDIST_ARG2_FUNC(pmul,pmul,VECT_PMUL)
////////// Special function reduce /////////////////////////
......@@ -291,5 +290,17 @@ rsum(const vector_dist_expression<prp1,v1> & va, const vector_type & vd)
return exp_sum;
}
namespace openfpm
{
/*! \brief General distance formula
*
*
*/
template <typename T, typename P> auto distance(T exp1, P exp2) -> decltype(norm(exp1 - exp2))
{
return norm(exp1 - exp2);
}
}
#endif /* OPENFPM_NUMERICS_SRC_OPERATORS_VECTOR_VECTOR_DIST_OPERATORS_FUNCTIONS_HPP_ */
......@@ -937,7 +937,7 @@ BOOST_AUTO_TEST_CASE( vector_dist_operators_test )
// normalization function
vA = vVB * vVC + norm(vVC + vVB) + distance(vVC,vVB);
vA = vVB * vVC + norm(vVC + vVB) + openfpm::distance(vVC,vVB);
check_values_scal_norm_dist(vd);
Point<3,float> p0({2.0,2.0,2.0});
......
......@@ -86,7 +86,7 @@ template<typename T, typename Kernel> void PSE_test(size_t Npart, size_t overlap
size_t bc[1]={NON_PERIODIC};
Ghost<1,T> g(20*eps);
vector_dist<1,T, aggregate<T>, CartDecomposition<1,T> > vd(Npart,box,bc,g);
vector_dist<1,T, aggregate<T> > vd(Npart,box,bc,g);
auto it2 = vd.getIterator();
......
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