Commit 359ef9ab authored by Berenger Bramas's avatar Berenger Bramas
Browse files

update P2P computation

parent 1bab0435
Pipeline #19488 failed with stage
in 6 minutes and 14 seconds
......@@ -43,22 +43,13 @@ public:
const real_number pos_part2[], const real_number data_part2[], real_number rhs_part2[],
const real_number dist_pow2,
const real_number xshift_coef, const real_number yshift_coef, const real_number zshift_coef) const{
static_assert(size_particle_positions == 3, "This kernel works only with 3 values for one position");
// TODO:
// Should I put 0 in the rhs corresponding to the orientations?
// Or should I just add the interaction term?
// In other words: is this method called after the vorticity and strain terms have been computed?
// The following two lines set the rhs to 0:
//std::fill_n(rhs_part1+3, 3, 0);
//std::fill_n(rhs_part2+3, 3, 0);
real_number distance = sqrt(dist_pow2);
double max_distance = 1.0;
double tau = 1.0;
if (distance >= max_distance)
return;
static_assert(size_particle_positions == 3, "This kernel works only with 3 values for one particle's position");
static_assert(size_particle_rhs >= 6, "This kernel works only with more than 6 values per particle's rhs");
static_assert(size_particle_data == 3, "This kernel works only with 3 values per particle's' data");
// TODO: a reasonable way of choosing between different distance_weight functions should be thought of.
// We need to ask Michael about how flexible this distance_weight needs to be.
double ww = dumb_distance_weight(distance, max_distance);
const double ww = dumb_distance_weight(distance, max_distance);
///
/// term in equation is:
///
......@@ -66,9 +57,9 @@ public:
/// (4 / \tau) \sum_j W_\ell ( | x^i - x^j | ) (p^i \cdot p^j)p^j
/// \f]
///
double dot_product = (data_part1[0]*data_part2[0] +
const double dot_product = (data_part1[0]*data_part2[0] +
data_part1[1]*data_part2[1] +
data_part1[2]*data_part2[2])
data_part1[2]*data_part2[2]);
rhs_part1[3] += data_part2[0] * 4 * ww * dot_product;
rhs_part1[4] += data_part2[1] * 4 * ww * dot_product;
rhs_part1[5] += data_part2[2] * 4 * ww * dot_product;
......
Supports Markdown
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