Commit a52a73e5 authored by incardon's avatar incardon

Fixing vector dist key

parent 0f726cd2
......@@ -167,7 +167,7 @@ public:
* \return return the result of the expression
*
*/
template<typename r_type=typename std::remove_reference<decltype(o1.value(vect_dist_key_dx(0)) + o2.value(vect_dist_key_dx(0)))>::type >
template<typename r_type=typename std::remove_reference<decltype(o1.value(vect_dist_key_dx()) + o2.value(vect_dist_key_dx()))>::type >
inline r_type value(const vect_dist_key_dx & key) const
{
return o1.value(key) + o2.value(key);
......@@ -215,7 +215,7 @@ public:
* \return the result of the expression
*
*/
template<typename r_type=typename std::remove_reference<decltype(o1.value(vect_dist_key_dx(0)) - o2.value(vect_dist_key_dx(0)))>::type > inline r_type value(const vect_dist_key_dx & key) const
template<typename r_type=typename std::remove_reference<decltype(o1.value(vect_dist_key_dx()) - o2.value(vect_dist_key_dx()))>::type > inline r_type value(const vect_dist_key_dx & key) const
{
return o1.value(key) - o2.value(key);
}
......@@ -261,7 +261,7 @@ public:
* \return the result of the expression
*
*/
template<typename r_type=typename std::remove_reference<decltype(o1.value(vect_dist_key_dx(0)) * o2.value(vect_dist_key_dx(0)))>::type > inline r_type value(const vect_dist_key_dx & key) const
template<typename r_type=typename std::remove_reference<decltype(o1.value(vect_dist_key_dx()) * o2.value(vect_dist_key_dx()))>::type > inline r_type value(const vect_dist_key_dx & key) const
{
return o1.value(key) * o2.value(key);
}
......@@ -307,7 +307,7 @@ public:
* \return the result of the expression
*
*/
template<typename r_type=typename std::remove_reference<decltype(o1.value(vect_dist_key_dx(0)) / o2.value(vect_dist_key_dx(0)))>::type > inline r_type value(const vect_dist_key_dx & key) const
template<typename r_type=typename std::remove_reference<decltype(o1.value(vect_dist_key_dx()) / o2.value(vect_dist_key_dx()))>::type > inline r_type value(const vect_dist_key_dx & key) const
{
return o1.value(key) / o2.value(key);
}
......
......@@ -106,8 +106,11 @@ struct apply_kernel_is_number_or_expression
// given by the Near particle, exclude itself
if (nnp != key.getKey())
{
vect_dist_key_dx nnp_k;
nnp_k.setKey(nnp);
// property of the particle x
rtype prp_q = v_exp.value(nnp);
rtype prp_q = v_exp.value(nnp_k);
// position of the particle q
Point<vector::dims,typename vector::stype> q = vd.getPos(nnp);
......@@ -214,8 +217,11 @@ struct apply_kernel_is_number_or_expression_gen
// given by the Near particle, exclude itself
if (nnp != key.getKey())
{
vect_dist_key_dx nnp_k;
nnp_k.setKey(nnp);
// property of the particle x
rtype prp_q = v_exp.value(nnp);
rtype prp_q = v_exp.value(nnp_k);
pse += lker.value(key.getKey(),nnp,prp_p,prp_q,vd);
}
......@@ -258,7 +264,7 @@ class vector_dist_expression_op<exp1,vector_type,VECT_APPLYKER_IN>
const vector_orig & vd;
//! Get the return type of applying the kernel to a particle
typedef typename apply_kernel_rtype<decltype(o1.value(vect_dist_key_dx(0)))>::rtype rtype;
typedef typename apply_kernel_rtype<decltype(o1.value(vect_dist_key_dx()))>::rtype rtype;
public:
......@@ -390,7 +396,7 @@ class vector_dist_expression_op<exp1,vector_type,VECT_APPLYKER_IN_GEN>
const vector_orig & vd;
//! Return type of the expression
typedef typename apply_kernel_rtype<decltype(o1.value(vect_dist_key_dx(0)))>::rtype rtype;
typedef typename apply_kernel_rtype<decltype(o1.value(vect_dist_key_dx()))>::rtype rtype;
public:
......
......@@ -222,7 +222,7 @@ class vector_dist_expression_op<exp1,vector_type,VECT_SUM_REDUCE>
const exp1 o1;
//! return type of this expression
typedef typename apply_kernel_rtype<decltype(o1.value(vect_dist_key_dx(0)))>::rtype rtype;
typedef typename apply_kernel_rtype<decltype(o1.value(vect_dist_key_dx()))>::rtype rtype;
//! return type of the calculated value (without reference)
mutable typename std::remove_reference<rtype>::type val;
......@@ -261,7 +261,7 @@ public:
inline typename std::remove_reference<rtype>::type get()
{
init();
return value(vect_dist_key_dx(0));
return value(vect_dist_key_dx());
}
//! it return the result of the expression (precalculated before)
......
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